summaryrefslogtreecommitdiff
path: root/src/sysdeps
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-03-15 09:32:36 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-03-15 09:32:36 +0000
commita36a3eb159d88507705253577814a8fdcb2a86d1 (patch)
tree7b1af1e5909b330f4a602fc20229c3911dd0b233 /src/sysdeps
parent329aee76f71ca3fdc832e14e1b4ef7309e97e638 (diff)
downloadskalibs-a36a3eb159d88507705253577814a8fdcb2a86d1.tar.xz
sysdeps tests cleanup. (I expect BSDs to break, as usual.)
Diffstat (limited to 'src/sysdeps')
-rw-r--r--src/sysdeps/tryaccept4.c2
-rw-r--r--src/sysdeps/tryancilautoclose.c1
-rw-r--r--src/sysdeps/tryclockmon.c1
-rw-r--r--src/sysdeps/tryclockrt.c1
-rw-r--r--src/sysdeps/trycmsgcloexec.c1
-rw-r--r--src/sysdeps/trydevurandom.c19
-rw-r--r--src/sysdeps/tryeproto.c2
-rw-r--r--src/sysdeps/tryflock.c1
-rw-r--r--src/sysdeps/tryfutimens.c2
-rw-r--r--src/sysdeps/tryfutimes.c1
-rw-r--r--src/sysdeps/trygetpeereid.c1
-rw-r--r--src/sysdeps/tryipv6.c1
-rw-r--r--src/sysdeps/trylsock.c1
-rw-r--r--src/sysdeps/trymalloc0.c6
-rw-r--r--src/sysdeps/trymsgdontwait.c1
-rw-r--r--src/sysdeps/trynbwaitall.c1
-rw-r--r--src/sysdeps/tryposixspawn.c1
-rw-r--r--src/sysdeps/tryrevoke.c6
-rw-r--r--src/sysdeps/trysendfile.c1
-rw-r--r--src/sysdeps/trysetgroups.c1
-rw-r--r--src/sysdeps/trysettimeofday.c1
-rw-r--r--src/sysdeps/trysignalfd.c1
-rw-r--r--src/sysdeps/trysizeofgid.c8
-rw-r--r--src/sysdeps/trysizeoftime.c8
-rw-r--r--src/sysdeps/trysizeofuint.c7
-rw-r--r--src/sysdeps/trysizeofulong.c7
-rw-r--r--src/sysdeps/trysizeofushort.c7
-rw-r--r--src/sysdeps/trysopeercred.c1
-rw-r--r--src/sysdeps/trysplice.c4
-rw-r--r--src/sysdeps/trystrnlen.c6
30 files changed, 24 insertions, 77 deletions
diff --git a/src/sysdeps/tryaccept4.c b/src/sysdeps/tryaccept4.c
index d6c462a..98a75e6 100644
--- a/src/sysdeps/tryaccept4.c
+++ b/src/sysdeps/tryaccept4.c
@@ -11,8 +11,6 @@
#define _GNU_SOURCE
#endif
-#include <sys/types.h>
-
#include <sys/socket.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/src/sysdeps/tryancilautoclose.c b/src/sysdeps/tryancilautoclose.c
index 1db7a7a..c7f461f 100644
--- a/src/sysdeps/tryancilautoclose.c
+++ b/src/sysdeps/tryancilautoclose.c
@@ -11,7 +11,6 @@
#define _XPG4_2
#endif
-#include <sys/types.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
diff --git a/src/sysdeps/tryclockmon.c b/src/sysdeps/tryclockmon.c
index 2564ed3..acd18f9 100644
--- a/src/sysdeps/tryclockmon.c
+++ b/src/sysdeps/tryclockmon.c
@@ -1,6 +1,5 @@
/* ISC license. */
-#include <sys/types.h>
#include <time.h>
int main (void)
diff --git a/src/sysdeps/tryclockrt.c b/src/sysdeps/tryclockrt.c
index 01bae7c..8070114 100644
--- a/src/sysdeps/tryclockrt.c
+++ b/src/sysdeps/tryclockrt.c
@@ -1,6 +1,5 @@
/* ISC license. */
-#include <sys/types.h>
#include <time.h>
int main (void)
diff --git a/src/sysdeps/trycmsgcloexec.c b/src/sysdeps/trycmsgcloexec.c
index 7923340..46bffe0 100644
--- a/src/sysdeps/trycmsgcloexec.c
+++ b/src/sysdeps/trycmsgcloexec.c
@@ -15,7 +15,6 @@
# define _GNU_SOURCE
#endif
-#include <sys/types.h>
#include <sys/socket.h>
int main (void)
diff --git a/src/sysdeps/trydevurandom.c b/src/sysdeps/trydevurandom.c
index 3d0f912..9c56e94 100644
--- a/src/sysdeps/trydevurandom.c
+++ b/src/sysdeps/trydevurandom.c
@@ -1,22 +1,11 @@
/* ISC license. */
+#include <string.h>
#include <unistd.h>
-#include <sys/types.h>
#include <fcntl.h>
+#include <sys/stat.h>
-static int byte_diff (char *s, unsigned int n, char *t)
-{
- for (;;)
- {
- if (!n) return 0 ;
- if (*s != *t) break ;
- ++s ; ++t ; --n ;
- }
- return ((int)(unsigned int)(unsigned char) *s)
- - ((int)(unsigned int)(unsigned char) *t);
-}
-
-int main ()
+int main (void)
{
char a[64] ;
char b[64] ;
@@ -27,5 +16,5 @@ int main ()
fd = open("/dev/urandom", O_RDONLY) ;
if ((fd == -1) || (read(fd, b, 64) < 64) ) return 111 ;
close(fd) ;
- return (!byte_diff(a, 64, b)) ;
+ return (!memcmp(a, 64, b)) ;
}
diff --git a/src/sysdeps/tryeproto.c b/src/sysdeps/tryeproto.c
index b5cc66c..e7a0942 100644
--- a/src/sysdeps/tryeproto.c
+++ b/src/sysdeps/tryeproto.c
@@ -1,7 +1,9 @@
/* ISC license. */
#include <errno.h>
+
static int dummy ;
+
#ifndef EPROTO
syntax error !
#endif
diff --git a/src/sysdeps/tryflock.c b/src/sysdeps/tryflock.c
index 47fadf8..0a65bdc 100644
--- a/src/sysdeps/tryflock.c
+++ b/src/sysdeps/tryflock.c
@@ -3,7 +3,6 @@
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
-#include <sys/types.h>
#include <sys/file.h>
#include <fcntl.h>
diff --git a/src/sysdeps/tryfutimens.c b/src/sysdeps/tryfutimens.c
index 222fea5..7ed1635 100644
--- a/src/sysdeps/tryfutimens.c
+++ b/src/sysdeps/tryfutimens.c
@@ -6,9 +6,7 @@
#define __EXTENSIONS__
#endif
-#include <sys/types.h>
#include <sys/stat.h>
-#include <time.h>
int main (void)
{
diff --git a/src/sysdeps/tryfutimes.c b/src/sysdeps/tryfutimes.c
index ad56f95..9a6e41c 100644
--- a/src/sysdeps/tryfutimes.c
+++ b/src/sysdeps/tryfutimes.c
@@ -6,7 +6,6 @@
#define _BSD_SOURCE
#endif
-#include <sys/types.h>
#include <sys/time.h>
int main (void)
diff --git a/src/sysdeps/trygetpeereid.c b/src/sysdeps/trygetpeereid.c
index 10a411a..63cdbf1 100644
--- a/src/sysdeps/trygetpeereid.c
+++ b/src/sysdeps/trygetpeereid.c
@@ -3,7 +3,6 @@
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
-#include <sys/types.h>
#include <unistd.h>
int main (void)
diff --git a/src/sysdeps/tryipv6.c b/src/sysdeps/tryipv6.c
index a384b0a..a1db92e 100644
--- a/src/sysdeps/tryipv6.c
+++ b/src/sysdeps/tryipv6.c
@@ -6,7 +6,6 @@
#define _XPG4_2
#define _XPG6
-#include <sys/types.h>
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
diff --git a/src/sysdeps/trylsock.c b/src/sysdeps/trylsock.c
index 7e3b501..e588d65 100644
--- a/src/sysdeps/trylsock.c
+++ b/src/sysdeps/trylsock.c
@@ -11,7 +11,6 @@
#define _GNU_SOURCE
#endif
-#include <sys/types.h>
#include <sys/socket.h>
int main (void)
diff --git a/src/sysdeps/trymalloc0.c b/src/sysdeps/trymalloc0.c
index 0f68329..4545598 100644
--- a/src/sysdeps/trymalloc0.c
+++ b/src/sysdeps/trymalloc0.c
@@ -1,4 +1,8 @@
/* ISC license */
#include <stdlib.h>
-int main() { return !malloc(0) ; }
+
+int main (void)
+{
+ return !malloc(0) ;
+}
diff --git a/src/sysdeps/trymsgdontwait.c b/src/sysdeps/trymsgdontwait.c
index 0c8ad15..ac118b7 100644
--- a/src/sysdeps/trymsgdontwait.c
+++ b/src/sysdeps/trymsgdontwait.c
@@ -11,7 +11,6 @@
#define _BSD_SOURCE
#endif
-#include <sys/types.h>
#include <sys/socket.h>
int value = MSG_DONTWAIT ;
diff --git a/src/sysdeps/trynbwaitall.c b/src/sysdeps/trynbwaitall.c
index a10fd0b..48f6b89 100644
--- a/src/sysdeps/trynbwaitall.c
+++ b/src/sysdeps/trynbwaitall.c
@@ -14,7 +14,6 @@
#define _GNU_SOURCE
#endif
-#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
diff --git a/src/sysdeps/tryposixspawn.c b/src/sysdeps/tryposixspawn.c
index dccdba4..86df3af 100644
--- a/src/sysdeps/tryposixspawn.c
+++ b/src/sysdeps/tryposixspawn.c
@@ -1,6 +1,5 @@
/* ISC license. */
-#include <sys/types.h>
#include <spawn.h>
int main (void)
diff --git a/src/sysdeps/tryrevoke.c b/src/sysdeps/tryrevoke.c
index 9cbc615..7fe1a70 100644
--- a/src/sysdeps/tryrevoke.c
+++ b/src/sysdeps/tryrevoke.c
@@ -4,4 +4,8 @@
#undef _XOPEN_SOURCE
#include <unistd.h>
-int main () { return revoke("/") ; }
+
+int main (void)
+{
+ return revoke("/") ;
+}
diff --git a/src/sysdeps/trysendfile.c b/src/sysdeps/trysendfile.c
index 6c99ad0..a5a6111 100644
--- a/src/sysdeps/trysendfile.c
+++ b/src/sysdeps/trysendfile.c
@@ -1,6 +1,5 @@
/* ISC license. */
-#include <sys/types.h>
#include <sys/sendfile.h>
int main (void)
diff --git a/src/sysdeps/trysetgroups.c b/src/sysdeps/trysetgroups.c
index af2d8c6..ffea041 100644
--- a/src/sysdeps/trysetgroups.c
+++ b/src/sysdeps/trysetgroups.c
@@ -15,7 +15,6 @@
#define __EXTENSIONS__
#endif
-#include <sys/types.h>
#include <unistd.h>
#include <grp.h>
diff --git a/src/sysdeps/trysettimeofday.c b/src/sysdeps/trysettimeofday.c
index 05ae3c4..e970b07 100644
--- a/src/sysdeps/trysettimeofday.c
+++ b/src/sysdeps/trysettimeofday.c
@@ -15,7 +15,6 @@
#define __EXTENSIONS__
#endif
-#include <sys/types.h>
#include <sys/time.h>
int main (void)
diff --git a/src/sysdeps/trysignalfd.c b/src/sysdeps/trysignalfd.c
index 1f06933..5f13497 100644
--- a/src/sysdeps/trysignalfd.c
+++ b/src/sysdeps/trysignalfd.c
@@ -1,6 +1,5 @@
/* ISC license. */
-#include <sys/types.h>
#include <signal.h>
#include <sys/signalfd.h>
diff --git a/src/sysdeps/trysizeofgid.c b/src/sysdeps/trysizeofgid.c
deleted file mode 100644
index 75eeb2c..0000000
--- a/src/sysdeps/trysizeofgid.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <sys/types.h>
-#include <stdio.h>
-
-int main (void)
-{
- printf("%u\n", (unsigned int)sizeof(gid_t)) ;
- return 0 ;
-}
diff --git a/src/sysdeps/trysizeoftime.c b/src/sysdeps/trysizeoftime.c
deleted file mode 100644
index 13674de..0000000
--- a/src/sysdeps/trysizeoftime.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <sys/types.h>
-#include <stdio.h>
-
-int main (void)
-{
- printf("%u\n", (unsigned int)sizeof(time_t)) ;
- return 0 ;
-}
diff --git a/src/sysdeps/trysizeofuint.c b/src/sysdeps/trysizeofuint.c
deleted file mode 100644
index ca4af39..0000000
--- a/src/sysdeps/trysizeofuint.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int main (void)
-{
- printf("%u\n", (unsigned int)sizeof(unsigned int)) ;
- return 0 ;
-}
diff --git a/src/sysdeps/trysizeofulong.c b/src/sysdeps/trysizeofulong.c
deleted file mode 100644
index f2f21b1..0000000
--- a/src/sysdeps/trysizeofulong.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int main (void)
-{
- printf("%u\n", (unsigned int)sizeof(unsigned long)) ;
- return 0 ;
-}
diff --git a/src/sysdeps/trysizeofushort.c b/src/sysdeps/trysizeofushort.c
deleted file mode 100644
index fd410bb..0000000
--- a/src/sysdeps/trysizeofushort.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int main (void)
-{
- printf("%u\n", (unsigned int)sizeof(unsigned short)) ;
- return 0 ;
-}
diff --git a/src/sysdeps/trysopeercred.c b/src/sysdeps/trysopeercred.c
index a6c6806..9e50950 100644
--- a/src/sysdeps/trysopeercred.c
+++ b/src/sysdeps/trysopeercred.c
@@ -11,7 +11,6 @@
#define _GNU_SOURCE
#endif
-#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
diff --git a/src/sysdeps/trysplice.c b/src/sysdeps/trysplice.c
index 7428418..8e8bd72 100644
--- a/src/sysdeps/trysplice.c
+++ b/src/sysdeps/trysplice.c
@@ -1,7 +1,9 @@
/* ISC license. */
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE
-#include <sys/types.h>
+#endif
+
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
diff --git a/src/sysdeps/trystrnlen.c b/src/sysdeps/trystrnlen.c
index 5361cc9..7ebab53 100644
--- a/src/sysdeps/trystrnlen.c
+++ b/src/sysdeps/trystrnlen.c
@@ -1,4 +1,8 @@
/* ISC license. */
#include <string.h>
-int main () { return strnlen("/", 1) ; }
+
+int main (void)
+{
+ return strnlen("/", 1) ;
+}