summaryrefslogtreecommitdiff
path: root/include/unistd.h
diff options
context:
space:
mode:
authorjvoisin2023-09-21 15:50:32 +0200
committerjvoisin2023-09-21 15:50:32 +0200
commit8c2352b985b1bf69efb965ba15f5e300eb7e8e12 (patch)
tree9901e915156ca32c0b9f006f3139ba34958f68ef /include/unistd.h
parent46add4c4aecbbb8edb4b70ac5ed3a8c144f497ee (diff)
Properly enable diagnose_as_builtin attribute
Diffstat (limited to 'include/unistd.h')
-rw-r--r--include/unistd.h13
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{