From 5ce3737931bb411a8d167356d4d0287b53b0cbdc Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 12 Sep 2018 00:08:09 -0400 Subject: reduce spurious inclusion of libc.h libc.h was intended to be a header for access to global libc state and related interfaces, but ended up included all over the place because it was the way to get the weak_alias macro. most of the inclusions removed here are places where weak_alias was needed. a few were recently introduced for hidden. some go all the way back to when libc.h defined CANCELPT_BEGIN and _END, and all (wrongly implemented) cancellation points had to include it. remaining spurious users are mostly callers of the LOCK/UNLOCK macros and files that use the LFS64 macro to define the awful *64 aliases. in a few places, new inclusion of libc.h is added because several internal headers no longer implicitly include libc.h. declarations for __lockfile and __unlockfile are moved from libc.h to stdio_impl.h so that the latter does not need libc.h. putting them in libc.h made no sense at all, since the macros in stdio_impl.h are needed to use them correctly anyway. --- src/unistd/acct.c | 1 - src/unistd/close.c | 1 - src/unistd/dup3.c | 1 - src/unistd/pause.c | 2 -- src/unistd/read.c | 1 - src/unistd/readv.c | 1 - src/unistd/write.c | 1 - src/unistd/writev.c | 1 - 8 files changed, 9 deletions(-) (limited to 'src/unistd') diff --git a/src/unistd/acct.c b/src/unistd/acct.c index f6f25a8a..308ffc38 100644 --- a/src/unistd/acct.c +++ b/src/unistd/acct.c @@ -1,7 +1,6 @@ #define _GNU_SOURCE #include #include "syscall.h" -#include "libc.h" int acct(const char *filename) { diff --git a/src/unistd/close.c b/src/unistd/close.c index fa3c6cab..5b38e019 100644 --- a/src/unistd/close.c +++ b/src/unistd/close.c @@ -1,7 +1,6 @@ #include #include #include "syscall.h" -#include "libc.h" static int dummy(int fd) { diff --git a/src/unistd/dup3.c b/src/unistd/dup3.c index 0eb6caf5..f919f791 100644 --- a/src/unistd/dup3.c +++ b/src/unistd/dup3.c @@ -3,7 +3,6 @@ #include #include #include "syscall.h" -#include "libc.h" int __dup3(int old, int new, int flags) { diff --git a/src/unistd/pause.c b/src/unistd/pause.c index 56eb171e..90bbf4ca 100644 --- a/src/unistd/pause.c +++ b/src/unistd/pause.c @@ -1,7 +1,5 @@ #include -#include #include "syscall.h" -#include "libc.h" int pause(void) { diff --git a/src/unistd/read.c b/src/unistd/read.c index eb882fcc..f3589c05 100644 --- a/src/unistd/read.c +++ b/src/unistd/read.c @@ -1,6 +1,5 @@ #include #include "syscall.h" -#include "libc.h" ssize_t read(int fd, void *buf, size_t count) { diff --git a/src/unistd/readv.c b/src/unistd/readv.c index e45cb484..91e6de81 100644 --- a/src/unistd/readv.c +++ b/src/unistd/readv.c @@ -1,6 +1,5 @@ #include #include "syscall.h" -#include "libc.h" ssize_t readv(int fd, const struct iovec *iov, int count) { diff --git a/src/unistd/write.c b/src/unistd/write.c index e2f7e1f2..8fd5bc5c 100644 --- a/src/unistd/write.c +++ b/src/unistd/write.c @@ -1,6 +1,5 @@ #include #include "syscall.h" -#include "libc.h" ssize_t write(int fd, const void *buf, size_t count) { diff --git a/src/unistd/writev.c b/src/unistd/writev.c index ef300ddf..5a46c951 100644 --- a/src/unistd/writev.c +++ b/src/unistd/writev.c @@ -1,6 +1,5 @@ #include #include "syscall.h" -#include "libc.h" ssize_t writev(int fd, const struct iovec *iov, int count) { -- cgit v1.2.1