diff options
| author | jvoisin | 2025-01-28 12:52:23 +0100 |
|---|---|---|
| committer | jvoisin | 2025-01-28 13:18:31 +0100 |
| commit | f09abdf6e236198e6dbf7d049dc99534d9f8af01 (patch) | |
| tree | 5d1850df9ea2f8ddd68db3b778b0f48515e880fe /include | |
| parent | 369e73c80984aef940e9286e6d985c339924d1d1 (diff) | |
Fix a compilation error on C99
Add some ifdef guards around `getlogin_r`.
Diffstat (limited to 'include')
| -rw-r--r-- | include/unistd.h | 4 |
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) |
