aboutsummaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
Diffstat (limited to 'compat')
-rw-r--r--compat/check_getpwuid.c11
-rw-r--r--compat/compat.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/compat/check_getpwuid.c b/compat/check_getpwuid.c
new file mode 100644
index 00000000..c435eb89
--- /dev/null
+++ b/compat/check_getpwuid.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+#include <pwd.h>
+
+int main()
+{
+ struct passwd passwd, *ignored;
+
+ (void) getpwuid_r (0, &passwd, NULL, 0, &ignored);
+
+ return (0);
+}
diff --git a/compat/compat.h b/compat/compat.h
index b2e27368..c1ee0f93 100644
--- a/compat/compat.h
+++ b/compat/compat.h
@@ -30,6 +30,10 @@
extern "C" {
#endif
+#if !STD_GETPWUID
+#define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+
#if !HAVE_GETLINE
#include <stdio.h>
#include <unistd.h>