From db055c5b3e5f30aaee2187fbef9b8aa05aea3b95 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 29 Nov 2018 12:46:16 -0800 Subject: macOS: remove glibc 2.10 workarounds. The only part of this I actually need for macOS is to remove __APPLE__ from the getdelim/getline workaround, but if we're following the usual "seven year rule", glibc 2.10 is dead to us anyway, and we should just remove all of this. --- lib/portability.h | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) (limited to 'lib/portability.h') diff --git a/lib/portability.h b/lib/portability.h index e6b542c4..a74d66d5 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -91,43 +91,7 @@ static inline char *basename(char *path) { return __xpg_basename(path); } #include char *strcasestr(const char *haystack, const char *needle); - -// When building under obsolete glibc (Ubuntu 8.04-ish), hold its hand a bit. -#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 10 -#define fstatat fstatat64 -int fstatat64(int dirfd, const char *pathname, void *buf, int flags); -int readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz); -char *stpcpy(char *dest, const char *src); -#include -int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags); -int openat(int dirfd, const char *pathname, int flags, ...); -#include -DIR *fdopendir(int fd); -#include -int fchownat(int dirfd, const char *pathname, - uid_t owner, gid_t group, int flags); -int isblank(int c); -int unlinkat(int dirfd, const char *pathname, int flags); -#include -ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream); - -// Straight from posix-2008, things old glibc had but didn't prototype - -int faccessat(int fd, const char *path, int amode, int flag); -int linkat(int fd1, const char *path1, int fd2, const char *path2, int flag); -int mkdirat(int fd, const char *path, mode_t mode); -int symlinkat(const char *path1, int fd, const char *path2); -int mknodat(int fd, const char *path, mode_t mode, dev_t dev); -#include -int futimens(int fd, const struct timespec times[2]); -int utimensat(int fd, const char *path, const struct timespec times[2], int flag); - -#ifndef MNT_DETACH -#define MNT_DETACH 2 -#endif -#endif // Old glibc - -#endif // glibc in general +#endif // defined(glibc) #if !defined(__GLIBC__) // POSIX basename. @@ -175,12 +139,6 @@ int clearenv(void); #define SWAP_LE64(x) (x) #endif -#if defined(__APPLE__) \ - || (defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 10) -ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream); -ssize_t getline(char **lineptr, size_t *n, FILE *stream); -#endif - // Linux headers not listed by POSIX or LSB #include #include -- cgit v1.2.3