syscall() declaration belongs in unistd.h, not sys/syscall.h
authorRich Felker <dalias@aerifal.cx>
Mon, 10 Dec 2012 21:40:45 +0000 (16:40 -0500)
committerRich Felker <dalias@aerifal.cx>
Mon, 10 Dec 2012 21:40:45 +0000 (16:40 -0500)
traditionally, both BSD and GNU systems have it this way.
sys/syscall.h is purely syscall number macros. presently glibc exposes
the syscall declaration in unistd.h only with _GNU_SOURCE, but that
does not reflect historical practice.

include/sys/syscall.h
include/unistd.h

index af3ca46..24987dd 100644 (file)
@@ -1,16 +1,6 @@
 #ifndef _SYS_SYSCALL_H
 #define _SYS_SYSCALL_H
 #ifndef _SYS_SYSCALL_H
 #define _SYS_SYSCALL_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <features.h>
-
-long syscall(long, ...);
 
 #include <bits/syscall.h>
 
 
 #include <bits/syscall.h>
 
-#ifdef __cplusplus
-}
-#endif
 #endif
 #endif
index 64a6b46..89015ad 100644 (file)
@@ -175,6 +175,7 @@ void setusershell(void);
 void endusershell(void);
 char *getusershell(void);
 int acct(const char *);
 void endusershell(void);
 char *getusershell(void);
 int acct(const char *);
+long syscall(long, ...);
 #endif
 
 #ifdef _GNU_SOURCE
 #endif
 
 #ifdef _GNU_SOURCE