aboutsummaryrefslogtreecommitdiff
path: root/man/2/sys-chdir
diff options
context:
space:
mode:
authorbhgv <bhgv.empire@gmail.com>2018-03-01 16:54:45 +0200
committerbhgv <bhgv.empire@gmail.com>2018-03-01 16:54:45 +0200
commitb786f20bbab5a59046aa78a2c6c2a11536497202 (patch)
tree0851ecdec889eb9b7ba3751cc04d4f0b474e4a9e /man/2/sys-chdir
inferno-os tree was separated from the inferno-os-android (separated from the Android driver)
Diffstat (limited to 'man/2/sys-chdir')
-rw-r--r--man/2/sys-chdir40
1 files changed, 40 insertions, 0 deletions
diff --git a/man/2/sys-chdir b/man/2/sys-chdir
new file mode 100644
index 0000000..8604d7f
--- /dev/null
+++ b/man/2/sys-chdir
@@ -0,0 +1,40 @@
+.TH SYS-CHDIR 2
+.SH NAME
+chdir \- change working directory
+.SH SYNOPSIS
+.EX
+include "sys.m";
+sys := load Sys Sys->PATH;
+
+chdir: fn(path: string): int;
+.EE
+.SH DESCRIPTION
+.B Chdir
+changes the working directory
+of the invoking process and its file name space group to
+.IR path .
+.PP
+The working directory is the starting point for
+evaluating file names that do not begin with
+.B /
+or
+.BR # ,
+as explained in
+.IR sys-intro (2).
+.PP
+When Inferno boots,
+the initial process has
+.B /
+for its working directory.
+.PP
+Applications that invoke
+.B chdir
+normally use the
+.B FORKNS
+option of
+.IR sys-pctl (2)
+to prevent the change from affecting the surrounding environment.
+.SH DIAGNOSTICS
+Returns 0 on success; -1 on failure.
+.SH SEE ALSO
+.IR sys-intro (2)