hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 641d3307c8d46c6794baba832d160f5c9afe26f3
parent 3cf80e4b3e2dd1b770182ab689dcc69e00bd97f9
Author: Drew DeVault <sir@cmpwn.com>
Date:   Tue, 20 Apr 2021 14:35:00 -0400

os: remove os::root

This requires us to open a file descriptor during @init for every
process that links to os, which is a tall order. Users who desire an
fs::fs for the root can use os::diropen("/").

Diffstat:
Mos/+linux/fs.ha | 6------
Mos/fs.ha | 3---
2 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/os/+linux/fs.ha b/os/+linux/fs.ha @@ -5,12 +5,6 @@ use rt; use strings; @init fn init() void = { - static let root_fs = os_filesystem { ... }; - let dirfd = rt::open("/", - rt::O_RDONLY | rt::O_DIRECTORY | rt::O_CLOEXEC, - 0u) as int; - root = static_dirfdopen(dirfd, &root_fs); - static let cwd_fs = os_filesystem { ... }; cwd = static_dirfdopen(rt::AT_FDCWD, &cwd_fs); }; diff --git a/os/fs.ha b/os/fs.ha @@ -2,9 +2,6 @@ use fs; use io; use path; -// Provides an implementation of [[fs::fs]] for the host filesystem. -export let root: *fs::fs = null: *fs::fs; - // Provides an implementation of [[fs::fs]] for the current working directory. export let cwd: *fs::fs = null: *fs::fs;