chdir(2) System Calls Manual chdir(2) chdir, fchdir - LIBRARY Standard C library (libc, -lc) #include int chdir(const char *path); int fchdir(int fd); glibc (. feature_test_macros(7)): fchdir(): _XOPEN_SOURCE >= 500 || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L || /* glibc up to and including 2.19: */ _BSD_SOURCE chdir() , path. fchdir() chdir(); , . On success, zero is returned. On error, -1 is returned, and errno is set to indicate the error. . chdir() : EACCES path (c. path_resolution(7)). EFAULT path . EIO -. ELOOP path . ENAMETOOLONG path . ENOENT , path, . ENOMEM . ENOTDIR path . fchdir(): EACCES , fd. EBADF fd . ENOTDIR fd . POSIX.1-2008. POSIX.1-2001, SVr4, 4.4BSD. The current working directory is the starting point for interpreting relative pathnames (those not starting with '/'). , fork(2), . execve(2). . chroot(2), getcwd(3), path_resolution(7) Azamat Hackimov , Dmitriy S. Seregin , Dmitry Bolkhovskikh , Katrin Kutepova , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . chdir(2)