summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorjvoisin2025-01-28 12:52:23 +0100
committerjvoisin2025-01-28 13:18:31 +0100
commitf09abdf6e236198e6dbf7d049dc99534d9f8af01 (patch)
tree5d1850df9ea2f8ddd68db3b778b0f48515e880fe /include
parent369e73c80984aef940e9286e6d985c339924d1d1 (diff)
Fix a compilation error on C99
Add some ifdef guards around `getlogin_r`.
Diffstat (limited to 'include')
-rw-r--r--include/unistd.h4
1 files changed, 3 insertions, 1 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)