Skip to content

Commit fd1f44e

Browse files
committed
unistd: add docs for chdir
Signed-off-by: Paul Osborne <osbpau@gmail.com>
1 parent 7b5068a commit fd1f44e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/unistd.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ fn dup3_polyfill(oldfd: RawFd, newfd: RawFd, flags: OFlag) -> Result<RawFd> {
197197
Ok(fd)
198198
}
199199

200+
/// Change the current working directory of the calling process (see
201+
/// [chdir(2)](http://man7.org/linux/man-pages/man2/chdir.2.html)).
202+
///
203+
/// This function may fail in a number of different scenarios. See the man
204+
/// pages for additional details on possible failure cases.
200205
#[inline]
201206
pub fn chdir<P: ?Sized + NixPath>(path: &P) -> Result<()> {
202207
let res = try!(path.with_nix_path(|cstr| {

0 commit comments

Comments
 (0)