diff options
| -rw-r--r-- | include/unistd.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/unistd.h b/include/unistd.h index c2f5feb..3d27b15 100644 --- a/include/unistd.h +++ b/include/unistd.h | |||
| @@ -39,6 +39,17 @@ __fortify_gethostname(char *name, size_t len) | |||
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | static inline __attribute__ ((always_inline)) | 41 | static inline __attribute__ ((always_inline)) |
| 42 | int | ||
| 43 | __fortify_getlogin_r(char *name, size_t len) | ||
| 44 | { | ||
| 45 | size_t bos = __builtin_object_size(name, 0); | ||
| 46 | |||
| 47 | if (len > bos) | ||
| 48 | __builtin_trap(); | ||
| 49 | return getlogin_r(name, len); | ||
| 50 | } | ||
| 51 | |||
| 52 | static inline __attribute__ ((always_inline)) | ||
| 42 | ssize_t | 53 | ssize_t |
| 43 | __fortify_pread(int fd, void *buf, size_t n, off_t offset) | 54 | __fortify_pread(int fd, void *buf, size_t n, off_t offset) |
| 44 | { | 55 | { |
| @@ -77,6 +88,8 @@ __fortify_write(int fd, const void *buf, size_t n) | |||
| 77 | #define getcwd(buf, len) __fortify_getcwd(buf, len) | 88 | #define getcwd(buf, len) __fortify_getcwd(buf, len) |
| 78 | #undef gethostname | 89 | #undef gethostname |
| 79 | #define gethostname(name, len) __fortify_gethostname(name, len) | 90 | #define gethostname(name, len) __fortify_gethostname(name, len) |
| 91 | #undef getlogin_r | ||
| 92 | #define getlogin_r(name, len) __fortify_getlogin_r(name, len) | ||
| 80 | #undef pread | 93 | #undef pread |
| 81 | #define pread(fd, buf, n, offset) __fortify_pread(fd, buf, n, offset) | 94 | #define pread(fd, buf, n, offset) __fortify_pread(fd, buf, n, offset) |
| 82 | #undef read | 95 | #undef read |
