4 #include <sys/syscall.h>
8 #ifndef SYS___pthread_chdir
9 # define SYS___pthread_chdir 348
12 #ifndef SYS___pthread_fchdir
13 # define SYS___pthread_fchdir 349
16 int __pthread_chdir(const char *path
)
18 return syscall(SYS___pthread_chdir
, path
);
21 int __pthread_fchdir(int dirfd
)
23 return syscall(SYS___pthread_fchdir
, dirfd
);
30 dirfd
= open("/", O_RDONLY
);
32 perror("open"), exit(1);
34 if (__pthread_chdir("/"))
35 perror("__pthread_chdir");
37 if (__pthread_fchdir(dirfd
))
38 perror("__pthread_fchdir");