While I have no intention of using syscall numbers for
non-Linux, sizeof(pid_t) was useful for OpenBSD. And maybe
Linux can have real competition from other OSes with stable
syscall numbers someday.
#define _GNU_SOURCE
#include <sys/syscall.h>
#include <sys/ioctl.h>
+#ifdef __linux__
#include <linux/fs.h>
+#endif
+#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
D(SYS_renameat2);
#endif
#endif /* Linux, any other OSes with stable syscalls? */
- printf("size_t=%zu off_t=%zu\n", sizeof(size_t), sizeof(off_t));
+ printf("size_t=%zu off_t=%zu pid_t=%zu\n",
+ sizeof(size_t), sizeof(off_t), sizeof(pid_t));
return 0;
}