diff options
| author | jvoisin | 2023-09-21 15:50:32 +0200 |
|---|---|---|
| committer | jvoisin | 2023-09-21 15:50:32 +0200 |
| commit | 8c2352b985b1bf69efb965ba15f5e300eb7e8e12 (patch) | |
| tree | 9901e915156ca32c0b9f006f3139ba34958f68ef /include/unistd.h | |
| parent | 46add4c4aecbbb8edb4b70ac5ed3a8c144f497ee (diff) | |
Properly enable diagnose_as_builtin attribute
Diffstat (limited to 'include/unistd.h')
| -rw-r--r-- | include/unistd.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/include/unistd.h b/include/unistd.h index e91f922..57f0d0c 100644 --- a/include/unistd.h +++ b/include/unistd.h | |||
| @@ -42,7 +42,6 @@ extern "C" { | |||
| 42 | #undef write | 42 | #undef write |
| 43 | 43 | ||
| 44 | __access(write_only, 2, 3) | 44 | __access(write_only, 2, 3) |
| 45 | __diagnose_as_builtin(__builtin_confstr, 1, 2, 3) | ||
| 46 | _FORTIFY_FN(confstr) size_t confstr(int __n, char * _FORTIFY_POS0 __s, size_t __l) | 45 | _FORTIFY_FN(confstr) size_t confstr(int __n, char * _FORTIFY_POS0 __s, size_t __l) |
| 47 | { | 46 | { |
| 48 | size_t __b = __bos(__s, 0); | 47 | size_t __b = __bos(__s, 0); |
| @@ -54,7 +53,6 @@ _FORTIFY_FN(confstr) size_t confstr(int __n, char * _FORTIFY_POS0 __s, size_t __ | |||
| 54 | } | 53 | } |
| 55 | 54 | ||
| 56 | __access(write_only, 1, 2) | 55 | __access(write_only, 1, 2) |
| 57 | __diagnose_as_builtin(__builtin_getcwd, 1, 2) | ||
| 58 | _FORTIFY_FN(getcwd) char *getcwd(char * _FORTIFY_POS0 __s, size_t __l) | 56 | _FORTIFY_FN(getcwd) char *getcwd(char * _FORTIFY_POS0 __s, size_t __l) |
| 59 | { | 57 | { |
| 60 | size_t __b = __bos(__s, 0); | 58 | size_t __b = __bos(__s, 0); |
| @@ -67,7 +65,6 @@ _FORTIFY_FN(getcwd) char *getcwd(char * _FORTIFY_POS0 __s, size_t __l) | |||
| 67 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) | 65 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
| 68 | #undef getdomainname | 66 | #undef getdomainname |
| 69 | __access(write_only, 1, 2) | 67 | __access(write_only, 1, 2) |
| 70 | __diagnose_as_builtin(__builtin_getdomainname, 1, 2) | ||
| 71 | _FORTIFY_FN(getdomainname) int getdomainname(char * _FORTIFY_POS0 __s, size_t __l) | 68 | _FORTIFY_FN(getdomainname) int getdomainname(char * _FORTIFY_POS0 __s, size_t __l) |
| 72 | { | 69 | { |
| 73 | size_t __b = __bos(__s, 0); | 70 | size_t __b = __bos(__s, 0); |
| @@ -78,7 +75,6 @@ _FORTIFY_FN(getdomainname) int getdomainname(char * _FORTIFY_POS0 __s, size_t __ | |||
| 78 | } | 75 | } |
| 79 | #endif | 76 | #endif |
| 80 | 77 | ||
| 81 | __diagnose_as_builtin(__builtin_getgroups, 1, 2) | ||
| 82 | _FORTIFY_FN(getgroups) int getgroups(int __l, gid_t * _FORTIFY_POS0 __s) | 78 | _FORTIFY_FN(getgroups) int getgroups(int __l, gid_t * _FORTIFY_POS0 __s) |
| 83 | { | 79 | { |
| 84 | size_t __b = __bos(__s, 0); | 80 | size_t __b = __bos(__s, 0); |
| @@ -89,7 +85,6 @@ _FORTIFY_FN(getgroups) int getgroups(int __l, gid_t * _FORTIFY_POS0 __s) | |||
| 89 | } | 85 | } |
| 90 | 86 | ||
| 91 | __access(write_only, 1, 2) | 87 | __access(write_only, 1, 2) |
| 92 | __diagnose_as_builtin(__builtin_gethostname, 1, 2) | ||
| 93 | _FORTIFY_FN(gethostname) int gethostname(char * _FORTIFY_POS0 __s, size_t __l) | 88 | _FORTIFY_FN(gethostname) int gethostname(char * _FORTIFY_POS0 __s, size_t __l) |
| 94 | { | 89 | { |
| 95 | size_t __b = __bos(__s, 0); | 90 | size_t __b = __bos(__s, 0); |
| @@ -100,7 +95,6 @@ _FORTIFY_FN(gethostname) int gethostname(char * _FORTIFY_POS0 __s, size_t __l) | |||
| 100 | } | 95 | } |
| 101 | 96 | ||
| 102 | __access(write_only, 1, 2) | 97 | __access(write_only, 1, 2) |
| 103 | __diagnose_as_builtin(__builtin_getlogin_r, 1, 2) | ||
| 104 | _FORTIFY_FN(getlogin_r) int getlogin_r(char * _FORTIFY_POS0 __s, size_t __l) | 98 | _FORTIFY_FN(getlogin_r) int getlogin_r(char * _FORTIFY_POS0 __s, size_t __l) |
| 105 | { | 99 | { |
| 106 | size_t __b = __bos(__s, 0); | 100 | size_t __b = __bos(__s, 0); |
| @@ -110,7 +104,6 @@ _FORTIFY_FN(getlogin_r) int getlogin_r(char * _FORTIFY_POS0 __s, size_t __l) | |||
| 110 | return __orig_getlogin_r(__s, __l); | 104 | return __orig_getlogin_r(__s, __l); |
| 111 | } | 105 | } |
| 112 | 106 | ||
| 113 | __diagnose_as_builtin(__builtin_pread, 1, 2, 3, 4) | ||
| 114 | _FORTIFY_FN(pread) ssize_t pread(int __f, void * _FORTIFY_POS0 __s, | 107 | _FORTIFY_FN(pread) ssize_t pread(int __f, void * _FORTIFY_POS0 __s, |
| 115 | size_t __n, off_t __o) | 108 | size_t __n, off_t __o) |
| 116 | { | 109 | { |
| @@ -122,7 +115,6 @@ _FORTIFY_FN(pread) ssize_t pread(int __f, void * _FORTIFY_POS0 __s, | |||
| 122 | } | 115 | } |
| 123 | 116 | ||
| 124 | __access(write_only, 2, 3) | 117 | __access(write_only, 2, 3) |
| 125 | __diagnose_as_builtin(__builtin_read, 1, 2, 3) | ||
| 126 | _FORTIFY_FN(read) ssize_t read(int __f, void * _FORTIFY_POS0 __s, size_t __n) | 118 | _FORTIFY_FN(read) ssize_t read(int __f, void * _FORTIFY_POS0 __s, size_t __n) |
| 127 | { | 119 | { |
| 128 | size_t __b = __bos(__s, 0); | 120 | size_t __b = __bos(__s, 0); |
| @@ -133,7 +125,6 @@ _FORTIFY_FN(read) ssize_t read(int __f, void * _FORTIFY_POS0 __s, size_t __n) | |||
| 133 | } | 125 | } |
| 134 | 126 | ||
| 135 | __access(write_only, 2, 3) | 127 | __access(write_only, 2, 3) |
| 136 | __diagnose_as_builtin(__builtin_readlink, 1, 2, 3) | ||
| 137 | _FORTIFY_FN(readlink) ssize_t readlink(const char *__p, | 128 | _FORTIFY_FN(readlink) ssize_t readlink(const char *__p, |
| 138 | char * _FORTIFY_POS0 __s, size_t __n) | 129 | char * _FORTIFY_POS0 __s, size_t __n) |
| 139 | { | 130 | { |
| @@ -145,7 +136,6 @@ _FORTIFY_FN(readlink) ssize_t readlink(const char *__p, | |||
| 145 | } | 136 | } |
| 146 | 137 | ||
| 147 | __access(write_only, 3, 4) | 138 | __access(write_only, 3, 4) |
| 148 | __diagnose_as_builtin(__builtin_readlinkat, 1, 2, 3, 4) | ||
| 149 | _FORTIFY_FN(readlinkat) ssize_t readlinkat(int __f, const char *__p, | 139 | _FORTIFY_FN(readlinkat) ssize_t readlinkat(int __f, const char *__p, |
| 150 | char * _FORTIFY_POS0 __s, size_t __n) | 140 | char * _FORTIFY_POS0 __s, size_t __n) |
| 151 | { | 141 | { |
| @@ -157,7 +147,6 @@ _FORTIFY_FN(readlinkat) ssize_t readlinkat(int __f, const char *__p, | |||
| 157 | } | 147 | } |
| 158 | 148 | ||
| 159 | __access(write_only, 2, 3) | 149 | __access(write_only, 2, 3) |
| 160 | __diagnose_as_builtin(__builtin_ttyname_r, 1, 2, 3) | ||
| 161 | _FORTIFY_FN(ttyname_r) int ttyname_r(int __f, char * _FORTIFY_POS0 __s, | 150 | _FORTIFY_FN(ttyname_r) int ttyname_r(int __f, char * _FORTIFY_POS0 __s, |
| 162 | size_t __n) | 151 | size_t __n) |
| 163 | { | 152 | { |
| @@ -169,7 +158,6 @@ _FORTIFY_FN(ttyname_r) int ttyname_r(int __f, char * _FORTIFY_POS0 __s, | |||
| 169 | } | 158 | } |
| 170 | 159 | ||
| 171 | __access(read_only, 2, 3) | 160 | __access(read_only, 2, 3) |
| 172 | __diagnose_as_builtin(__builtin_write, 1, 2, 3) | ||
| 173 | _FORTIFY_FN(write) ssize_t write(int __f, const void * _FORTIFY_POS0 __s, | 161 | _FORTIFY_FN(write) ssize_t write(int __f, const void * _FORTIFY_POS0 __s, |
| 174 | size_t __n) | 162 | size_t __n) |
| 175 | { | 163 | { |
| @@ -180,7 +168,6 @@ _FORTIFY_FN(write) ssize_t write(int __f, const void * _FORTIFY_POS0 __s, | |||
| 180 | return __orig_write(__f, __s, __n); | 168 | return __orig_write(__f, __s, __n); |
| 181 | } | 169 | } |
| 182 | 170 | ||
| 183 | __diagnose_as_builtin(__builtin_pwrite, 1, 2, 3, 4) | ||
| 184 | _FORTIFY_FN(pwrite) ssize_t pwrite(int __f, const void * _FORTIFY_POS0 __s, | 171 | _FORTIFY_FN(pwrite) ssize_t pwrite(int __f, const void * _FORTIFY_POS0 __s, |
| 185 | size_t __n, off_t __o) | 172 | size_t __n, off_t __o) |
| 186 | { | 173 | { |
