unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] devel/syscall-list: support non-Linux, show sizeof(pid_t)
@ 2022-08-11 20:33 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2022-08-11 20:33 UTC (permalink / raw)
  To: meta

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.
---
 devel/syscall-list | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/devel/syscall-list b/devel/syscall-list
index d33a8a78..adb450da 100755
--- a/devel/syscall-list
+++ b/devel/syscall-list
@@ -28,7 +28,10 @@ __DATA__
 #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>
 
@@ -60,6 +63,7 @@ int main(void)
 	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;
 }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-11 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 20:33 [PATCH] devel/syscall-list: support non-Linux, show sizeof(pid_t) Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).