summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/unistd.h4
-rw-r--r--tests/Makefile2
-rw-r--r--tests/test_getlogin_r_dynamic.c3
-rw-r--r--tests/test_getlogin_r_static.c3
4 files changed, 10 insertions, 2 deletions
diff --git a/include/unistd.h b/include/unistd.h
index 69095d5..f6d4e87 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -33,7 +33,6 @@ extern "C" {
33#undef getcwd 33#undef getcwd
34#undef getgroups 34#undef getgroups
35#undef gethostname 35#undef gethostname
36#undef getlogin_r
37#undef pread 36#undef pread
38#undef read 37#undef read
39#undef readlink 38#undef readlink
@@ -109,6 +108,8 @@ _FORTIFY_FN(gethostname) int gethostname(char * _FORTIFY_POS0 __s, size_t __l)
109 return __orig_gethostname(__s, __l); 108 return __orig_gethostname(__s, __l);
110} 109}
111 110
111#if _REENTRANT || _POSIX_C_SOURCE >= 199506L
112#undef getlogin_r
112__fh_access(write_only, 1, 2) 113__fh_access(write_only, 1, 2)
113#if __has_builtin(__builtin_getlogin_r) 114#if __has_builtin(__builtin_getlogin_r)
114__diagnose_as_builtin(__builtin_getlogin_r, 1, 2) 115__diagnose_as_builtin(__builtin_getlogin_r, 1, 2)
@@ -121,6 +122,7 @@ _FORTIFY_FN(getlogin_r) int getlogin_r(char * _FORTIFY_POS0 __s, size_t __l)
121 __builtin_trap(); 122 __builtin_trap();
122 return __orig_getlogin_r(__s, __l); 123 return __orig_getlogin_r(__s, __l);
123} 124}
125#endif
124 126
125#if __has_builtin(__builtin_pread) 127#if __has_builtin(__builtin_pread)
126__diagnose_as_builtin(__builtin_pread, 1, 2, 3, 4) 128__diagnose_as_builtin(__builtin_pread, 1, 2, 3, 4)
diff --git a/tests/Makefile b/tests/Makefile
index a8c7ac5..740fe4d 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -150,7 +150,7 @@ RUNTIME_TARGETS= \
150 150
151.SILENT: 151.SILENT:
152 152
153gcc: CC=../x86_64-linux-musl-native/bin/gcc 153gcc: CC=../aarch64-linux-musl-native/bin/gcc
154gcc: $(RUNTIME_TARGETS) 154gcc: $(RUNTIME_TARGETS)
155 155
156clang: CC=clang 156clang: CC=clang
diff --git a/tests/test_getlogin_r_dynamic.c b/tests/test_getlogin_r_dynamic.c
index 33156ee..b1e66f7 100644
--- a/tests/test_getlogin_r_dynamic.c
+++ b/tests/test_getlogin_r_dynamic.c
@@ -3,6 +3,7 @@
3#include <unistd.h> 3#include <unistd.h>
4 4
5int main(int argc, char** argv) { 5int main(int argc, char** argv) {
6#if _REENTRANT || _POSIX_C_SOURCE >= 199506L
6 char buffer[8] = {0}; 7 char buffer[8] = {0};
7 8
8 getlogin_r(buffer, 6); 9 getlogin_r(buffer, 6);
@@ -13,4 +14,6 @@ int main(int argc, char** argv) {
13 14
14 puts(buffer); 15 puts(buffer);
15 return ret; 16 return ret;
17#endif
18 return 0;
16} 19}
diff --git a/tests/test_getlogin_r_static.c b/tests/test_getlogin_r_static.c
index 64f76c5..52638b9 100644
--- a/tests/test_getlogin_r_static.c
+++ b/tests/test_getlogin_r_static.c
@@ -3,6 +3,7 @@
3#include <unistd.h> 3#include <unistd.h>
4 4
5int main(int argc, char** argv) { 5int main(int argc, char** argv) {
6#if _REENTRANT || _POSIX_C_SOURCE >= 199506L
6 char buffer[12] = {0}; 7 char buffer[12] = {0};
7 8
8 getlogin_r(buffer, 10); 9 getlogin_r(buffer, 10);
@@ -13,4 +14,6 @@ int main(int argc, char** argv) {
13 14
14 puts(buffer); 15 puts(buffer);
15 return ret; 16 return ret;
17#endif
18 return 0;
16} 19}