Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / memcheck / tests / darwin / pth-undocumented.c
blobd9a5192b2b5f096b789da4d8e593a800c1aa65bf
1 #include <stdio.h>
2 #include <stdlib.h>
4 #include <sys/syscall.h>
5 #include <unistd.h>
6 #include <fcntl.h>
8 #ifndef SYS___pthread_chdir
9 # define SYS___pthread_chdir 348
10 #endif
12 #ifndef SYS___pthread_fchdir
13 # define SYS___pthread_fchdir 349
14 #endif
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);
26 int main(void)
28 int dirfd;
30 dirfd = open("/", O_RDONLY);
31 if (dirfd == -1)
32 perror("open"), exit(1);
34 if (__pthread_chdir("/"))
35 perror("__pthread_chdir");
37 if (__pthread_fchdir(dirfd))
38 perror("__pthread_fchdir");
40 return 0;