From 2990ce9b390ec1e2bfa1c043c406878e8aff86dd Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 21 Dec 2017 11:18:28 +0000 Subject: Big 2.6.3.0 reorganization - Add libposixplz, update headers - Add memmem and friends - Add textmessage to libunixonacid - Update some sysdeps tests --- src/sysdeps/tryarc4random.c | 16 ++++++++++++++++ src/sysdeps/tryarc4random_addrandom.c | 16 ++++++++++++++++ src/sysdeps/trygetpeereid.c | 20 ++++++++++++++++++-- src/sysdeps/trymemmem.c | 28 ++++++++++++++++++++++++++++ src/sysdeps/trynamespaces.c | 15 +++++++++++++++ src/sysdeps/trystrcasestr.c | 6 ++++++ src/sysdeps/trystrnlen.c | 3 +++ 7 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 src/sysdeps/trymemmem.c (limited to 'src/sysdeps') diff --git a/src/sysdeps/tryarc4random.c b/src/sysdeps/tryarc4random.c index b2f596a..3593eaa 100644 --- a/src/sysdeps/tryarc4random.c +++ b/src/sysdeps/tryarc4random.c @@ -3,6 +3,22 @@ #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ +#endif +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#ifndef _NETBSD_SOURCE +#define _NETBSD_SOURCE +#endif +#ifndef _INCOMPLETE_XOPEN_C063 +#define _INCOMPLETE_XOPEN_C063 +#endif + #include int main (void) diff --git a/src/sysdeps/tryarc4random_addrandom.c b/src/sysdeps/tryarc4random_addrandom.c index 1d5f84f..beb2346 100644 --- a/src/sysdeps/tryarc4random_addrandom.c +++ b/src/sysdeps/tryarc4random_addrandom.c @@ -3,6 +3,22 @@ #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ +#endif +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#ifndef _NETBSD_SOURCE +#define _NETBSD_SOURCE +#endif +#ifndef _INCOMPLETE_XOPEN_C063 +#define _INCOMPLETE_XOPEN_C063 +#endif + #include int main (void) diff --git a/src/sysdeps/trygetpeereid.c b/src/sysdeps/trygetpeereid.c index 10a411a..87b5017 100644 --- a/src/sysdeps/trygetpeereid.c +++ b/src/sysdeps/trygetpeereid.c @@ -3,6 +3,22 @@ #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ +#endif +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#ifndef _NETBSD_SOURCE +#define _NETBSD_SOURCE +#endif +#ifndef _INCOMPLETE_XOPEN_C063 +#define _INCOMPLETE_XOPEN_C063 +#endif + #include #include @@ -10,6 +26,6 @@ int main (void) { uid_t uid ; gid_t gid ; - int s = 0 ; - return getpeereid(s, &uid, &gid) ; + int fd = 0 ; + return getpeereid(fd, &uid, &gid) ; } diff --git a/src/sysdeps/trymemmem.c b/src/sysdeps/trymemmem.c new file mode 100644 index 0000000..458ac25 --- /dev/null +++ b/src/sysdeps/trymemmem.c @@ -0,0 +1,28 @@ +/* ISC license. */ + +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE + +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ +#endif +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#ifndef _NETBSD_SOURCE +#define _NETBSD_SOURCE +#endif +#ifndef _INCOMPLETE_XOPEN_C063 +#define _INCOMPLETE_XOPEN_C063 +#endif + +#include + +int main (void) +{ + memmem("blah", 4, "la", 2) ; + return 0 ; +} diff --git a/src/sysdeps/trynamespaces.c b/src/sysdeps/trynamespaces.c index 01894be..b88f414 100644 --- a/src/sysdeps/trynamespaces.c +++ b/src/sysdeps/trynamespaces.c @@ -1,8 +1,23 @@ /* ISC license. */ +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE + +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ +#endif #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#ifndef _NETBSD_SOURCE +#define _NETBSD_SOURCE +#endif +#ifndef _INCOMPLETE_XOPEN_C063 +#define _INCOMPLETE_XOPEN_C063 +#endif #include diff --git a/src/sysdeps/trystrcasestr.c b/src/sysdeps/trystrcasestr.c index f362202..3c4efc4 100644 --- a/src/sysdeps/trystrcasestr.c +++ b/src/sysdeps/trystrcasestr.c @@ -3,6 +3,9 @@ #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ +#endif #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif @@ -12,6 +15,9 @@ #ifndef _NETBSD_SOURCE #define _NETBSD_SOURCE #endif +#ifndef _INCOMPLETE_XOPEN_C063 +#define _INCOMPLETE_XOPEN_C063 +#endif #include diff --git a/src/sysdeps/trystrnlen.c b/src/sysdeps/trystrnlen.c index 7ebab53..0799dde 100644 --- a/src/sysdeps/trystrnlen.c +++ b/src/sysdeps/trystrnlen.c @@ -1,5 +1,8 @@ /* ISC license. */ +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE + #include int main (void) -- cgit 1.4.1