xref: /inferno-os/man/2/sys-chdir (revision 46439007cf417cbd9ac8049bb4122c890097a0fa)
SYS-CHDIR 2
NAME
chdir - change working directory
SYNOPSIS
.EX include "sys.m"; sys := load Sys Sys->PATH; chdir: fn(path: string): int;
DESCRIPTION
Chdir changes the working directory of the invoking process and its file name space group to path .

The working directory is the starting point for evaluating file names that do not begin with / or # , as explained in sys-intro (2).

When Inferno boots, the initial process has / for its working directory.

Applications that invoke chdir normally use the FORKNS option of sys-pctl (2) to prevent the change from affecting the surrounding environment.

DIAGNOSTICS
Returns 0 on success; -1 on failure.
SEE ALSO
sys-intro (2)