source: trunk/minix/man/man2/chdir.2@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.6 KB
RevLine 
[9]1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\" @(#)chdir.2 6.3 (Berkeley) 8/26/85
6.\"
7.TH CHDIR 2 "August 26, 1985"
8.UC 4
9.SH NAME
10chdir, fchdir \- change current working directory
11.SH SYNOPSIS
12.nf
13.ft B
14#include <unistd.h>
15
16int chdir(const char *\fIpath\fP)
17int fchdir(int \fIfd\fP)
18.ft R
19.fi
20.SH DESCRIPTION
21.I Path
22is the pathname of a directory.
23.I Fd
24is the file descriptor of a directory.
25
26.B Chdir
27causes this directory
28to become the current working directory,
29the starting point for path names not beginning with ``/''.
30.PP
31In order for a directory to become the current directory,
32a process must have execute (search) access to the directory.
33.SH "RETURN VALUE
34Upon successful completion, a value of 0 is returned.
35Otherwise, a value of \-1 is returned and \fBerrno\fP is set to indicate
36the error.
37.SH ERRORS
38.B Chdir
39will fail and the current working directory will be unchanged if
40one or more of the following are true:
41.TP 15
42[ENOTDIR]
43A component of the path prefix is not a directory.
44.TP 15
45[ENAMETOOLONG]
46The path name exceeds PATH_MAX characters.
47.TP 15
48[ENOENT]
49The named directory does not exist.
50.TP 15
51[ELOOP]
52Too many symbolic links were encountered in translating the pathname.
53(Minix-vmd)
54.TP 15
55[EACCES]
56Search permission is denied for any component of
57the path name.
58.TP 15
59[EFAULT]
60.I Path
61points outside the process's allocated address space.
62.TP 15
63[EIO]
64An I/O error occurred while reading from or writing to the file system.
65.SH "SEE ALSO"
66.BR chroot (2).
Note: See TracBrowser for help on using the repository browser.