about summary refs log tree commit diff
path: root/src/unistd
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-09-12 00:08:09 -0400
committerRich Felker <dalias@aerifal.cx>2018-09-12 14:34:37 -0400
commit5ce3737931bb411a8d167356d4d0287b53b0cbdc (patch)
tree726fc5dde9cc462316faa715158c38f0da72292d /src/unistd
parent0676c3a34c7bf12b33f8f5efb92476f4ffc7f20e (diff)
downloadmusl-5ce3737931bb411a8d167356d4d0287b53b0cbdc.tar.gz
musl-5ce3737931bb411a8d167356d4d0287b53b0cbdc.tar.xz
musl-5ce3737931bb411a8d167356d4d0287b53b0cbdc.zip
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.
Diffstat (limited to 'src/unistd')
-rw-r--r--src/unistd/acct.c1
-rw-r--r--src/unistd/close.c1
-rw-r--r--src/unistd/dup3.c1
-rw-r--r--src/unistd/pause.c2
-rw-r--r--src/unistd/read.c1
-rw-r--r--src/unistd/readv.c1
-rw-r--r--src/unistd/write.c1
-rw-r--r--src/unistd/writev.c1
8 files changed, 0 insertions, 9 deletions
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 <unistd.h>
 #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 <unistd.h>
 #include <errno.h>
 #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 <errno.h>
 #include <fcntl.h>
 #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 <unistd.h>
-#include <signal.h>
 #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 <unistd.h>
 #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 <sys/uio.h>
 #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 <unistd.h>
 #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 <sys/uio.h>
 #include "syscall.h"
-#include "libc.h"
 
 ssize_t writev(int fd, const struct iovec *iov, int count)
 {