Browse Source

include cleanups: remove unused headers and add feature test macros

Szabolcs Nagy 11 năm trước cách đây
mục cha
commit
571744447c
100 tập tin đã thay đổi với 48 bổ sung149 xóa
  1. 0 1
      src/ctype/__ctype_b_loc.c
  2. 1 1
      src/ctype/__ctype_get_mb_cur_max.c
  3. 1 2
      src/ctype/__ctype_tolower_loc.c
  4. 1 2
      src/ctype/__ctype_toupper_loc.c
  5. 0 2
      src/dirent/fdopendir.c
  6. 0 4
      src/dirent/opendir.c
  7. 0 6
      src/dirent/readdir.c
  8. 0 1
      src/dirent/readdir_r.c
  9. 2 2
      src/dirent/scandir.c
  10. 0 1
      src/env/__init_security.c
  11. 1 2
      src/env/__stack_chk_fail.c
  12. 1 0
      src/env/clearenv.c
  13. 0 2
      src/env/putenv.c
  14. 0 1
      src/env/unsetenv.c
  15. 0 2
      src/exit/atexit.c
  16. 1 2
      src/exit/exit.c
  17. 0 1
      src/fcntl/fcntl.c
  18. 0 1
      src/fcntl/open.c
  19. 0 1
      src/fcntl/openat.c
  20. 0 1
      src/internal/syscall_ret.c
  21. 1 0
      src/ldso/dlinfo.c
  22. 1 0
      src/legacy/euidaccess.c
  23. 1 1
      src/legacy/futimes.c
  24. 2 0
      src/legacy/getdtablesize.c
  25. 1 0
      src/legacy/getpagesize.c
  26. 1 1
      src/legacy/getpass.c
  27. 1 2
      src/legacy/getusershell.c
  28. 1 0
      src/legacy/lutimes.c
  29. 1 0
      src/linux/chroot.c
  30. 0 2
      src/linux/clock_adjtime.c
  31. 1 0
      src/linux/klogctl.c
  32. 1 0
      src/linux/personality.c
  33. 2 1
      src/linux/prlimit.c
  34. 1 1
      src/linux/sendfile.c
  35. 1 1
      src/linux/setfsgid.c
  36. 1 1
      src/linux/setfsuid.c
  37. 1 0
      src/linux/setgroups.c
  38. 1 0
      src/linux/sethostname.c
  39. 0 1
      src/linux/setns.c
  40. 1 0
      src/linux/stime.c
  41. 1 2
      src/linux/sysinfo.c
  42. 0 1
      src/linux/wait4.c
  43. 1 0
      src/locale/intl.c
  44. 0 2
      src/locale/localeconv.c
  45. 0 1
      src/locale/strcasecmp_l.c
  46. 0 1
      src/malloc/calloc.c
  47. 1 0
      src/misc/get_current_dir_name.c
  48. 1 0
      src/misc/getgrouplist.c
  49. 0 1
      src/misc/getrusage.c
  50. 1 5
      src/misc/initgroups.c
  51. 0 2
      src/misc/nftw.c
  52. 0 1
      src/misc/syslog.c
  53. 0 1
      src/misc/uname.c
  54. 0 1
      src/mman/msync.c
  55. 0 1
      src/mman/munmap.c
  56. 0 2
      src/multibyte/internal.c
  57. 1 0
      src/multibyte/internal.h
  58. 0 5
      src/multibyte/mblen.c
  59. 0 5
      src/multibyte/mbrlen.c
  60. 0 3
      src/multibyte/mbrtowc.c
  61. 0 5
      src/multibyte/mbsinit.c
  62. 0 6
      src/multibyte/mbsnrtowcs.c
  63. 1 3
      src/multibyte/mbsrtowcs.c
  64. 1 4
      src/multibyte/mbtowc.c
  65. 0 4
      src/multibyte/wcrtomb.c
  66. 0 5
      src/multibyte/wcsnrtombs.c
  67. 0 5
      src/multibyte/wcsrtombs.c
  68. 0 4
      src/multibyte/wctomb.c
  69. 0 1
      src/network/__ipparse.c
  70. 0 2
      src/network/gethostbyaddr.c
  71. 0 2
      src/network/gethostbyname2.c
  72. 1 1
      src/network/gethostbyname2_r.c
  73. 1 0
      src/network/getifaddrs.c
  74. 0 1
      src/network/getnameinfo.c
  75. 0 2
      src/network/if_nameindex.c
  76. 0 2
      src/network/inet_ntop.c
  77. 0 1
      src/network/proto.c
  78. 0 2
      src/network/recv.c
  79. 1 0
      src/network/res_query.c
  80. 0 2
      src/network/send.c
  81. 0 2
      src/network/serv.c
  82. 1 0
      src/passwd/fgetgrent.c
  83. 1 0
      src/passwd/fgetpwent.c
  84. 1 0
      src/passwd/putgrent.c
  85. 1 0
      src/passwd/putpwent.c
  86. 0 1
      src/prng/__rand48_step.c
  87. 0 1
      src/process/fexecve.c
  88. 1 1
      src/process/system.c
  89. 1 0
      src/process/vfork.c
  90. 0 2
      src/regex/glob.c
  91. 0 1
      src/regex/regcomp.c
  92. 0 1
      src/signal/raise.c
  93. 0 1
      src/signal/sigaction.c
  94. 0 1
      src/signal/sigfillset.c
  95. 1 1
      src/signal/sighold.c
  96. 1 1
      src/signal/sigignore.c
  97. 1 1
      src/signal/siginterrupt.c
  98. 0 1
      src/signal/sigismember.c
  99. 0 1
      src/signal/siglongjmp.c
  100. 0 1
      src/signal/signal.c

+ 0 - 1
src/ctype/__ctype_b_loc.c

@@ -1,4 +1,3 @@
-#include <ctype.h>
 #include <endian.h>
 
 #if __BYTE_ORDER == __BIG_ENDIAN

+ 1 - 1
src/ctype/__ctype_get_mb_cur_max.c

@@ -1,4 +1,4 @@
-#include <stdlib.h>
+#include <stddef.h>
 
 size_t __ctype_get_mb_cur_max()
 {

+ 1 - 2
src/ctype/__ctype_tolower_loc.c

@@ -1,5 +1,4 @@
-#include <ctype.h>
-#include <inttypes.h>
+#include <stdint.h>
 
 static const int32_t table[] = {
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

+ 1 - 2
src/ctype/__ctype_toupper_loc.c

@@ -1,5 +1,4 @@
-#include <ctype.h>
-#include <inttypes.h>
+#include <stdint.h>
 
 static const int32_t table[] = {
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

+ 0 - 2
src/dirent/fdopendir.c

@@ -3,8 +3,6 @@
 #include <sys/stat.h>
 #include <errno.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <limits.h>
 #include "__dirent.h"
 
 DIR *fdopendir(int fd)

+ 0 - 4
src/dirent/opendir.c

@@ -1,11 +1,7 @@
 #define _GNU_SOURCE
 #include <dirent.h>
 #include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <limits.h>
 #include "__dirent.h"
 #include "syscall.h"
 

+ 0 - 6
src/dirent/readdir.c

@@ -1,11 +1,5 @@
 #include <dirent.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <limits.h>
 #include "__dirent.h"
-#include "syscall.h"
 #include "libc.h"
 
 int __getdents(int, struct dirent *, size_t);

+ 0 - 1
src/dirent/readdir_r.c

@@ -1,6 +1,5 @@
 #include <dirent.h>
 #include <errno.h>
-#include <stdlib.h>
 #include <string.h>
 #include "__dirent.h"
 #include "libc.h"

+ 2 - 2
src/dirent/scandir.c

@@ -1,10 +1,10 @@
 #include <dirent.h>
 #include <string.h>
 #include <stdlib.h>
-#include <inttypes.h>
+#include <stdint.h>
 #include <errno.h>
 #include <stddef.h>
-#include <libc.h>
+#include "libc.h"
 
 int scandir(const char *path, struct dirent ***res,
 	int (*sel)(const struct dirent *),

+ 0 - 1
src/env/__init_security.c

@@ -1,4 +1,3 @@
-#include <stddef.h>
 #include <elf.h>
 #include <poll.h>
 #include <fcntl.h>

+ 1 - 2
src/env/__stack_chk_fail.c

@@ -1,6 +1,5 @@
 #include <string.h>
-#include <inttypes.h>
-#include <elf.h>
+#include <stdint.h>
 #include "pthread_impl.h"
 #include "atomic.h"
 

+ 1 - 0
src/env/clearenv.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <stdlib.h>
 
 extern char **__environ;

+ 0 - 2
src/env/putenv.c

@@ -1,7 +1,5 @@
 #include <stdlib.h>
 #include <string.h>
-#include <errno.h>
-#include <stdio.h>
 
 extern char **__environ;
 char **__env_map;

+ 0 - 1
src/env/unsetenv.c

@@ -1,4 +1,3 @@
-#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>

+ 0 - 2
src/exit/atexit.c

@@ -1,7 +1,5 @@
-#include <stddef.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <limits.h>
 #include "libc.h"
 
 /* Ensure that at least 32 atexit handlers can be registered without malloc */

+ 1 - 2
src/exit/exit.c

@@ -1,6 +1,5 @@
 #include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
+#include <stdint.h>
 #include "libc.h"
 #include "atomic.h"
 #include "syscall.h"

+ 0 - 1
src/fcntl/fcntl.c

@@ -1,6 +1,5 @@
 #define _GNU_SOURCE
 #include <fcntl.h>
-#include <unistd.h>
 #include <stdarg.h>
 #include <errno.h>
 #include "syscall.h"

+ 0 - 1
src/fcntl/open.c

@@ -1,5 +1,4 @@
 #include <fcntl.h>
-#include <unistd.h>
 #include <stdarg.h>
 #include "syscall.h"
 #include "libc.h"

+ 0 - 1
src/fcntl/openat.c

@@ -1,5 +1,4 @@
 #include <fcntl.h>
-#include <unistd.h>
 #include <stdarg.h>
 #include "syscall.h"
 #include "libc.h"

+ 0 - 1
src/internal/syscall_ret.c

@@ -1,5 +1,4 @@
 #include <errno.h>
-#include <unistd.h>
 
 long __syscall_ret(unsigned long r)
 {

+ 1 - 0
src/ldso/dlinfo.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <dlfcn.h>
 
 int __dlinfo(void *, int, void *);

+ 1 - 0
src/legacy/euidaccess.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <unistd.h>
 #include <fcntl.h>
 #include "libc.h"

+ 1 - 1
src/legacy/futimes.c

@@ -1,6 +1,6 @@
+#define _GNU_SOURCE
 #include <sys/stat.h>
 #include <sys/time.h>
-#include <fcntl.h>
 
 int futimes(int fd, const struct timeval tv[2])
 {

+ 2 - 0
src/legacy/getdtablesize.c

@@ -1,3 +1,5 @@
+#define _GNU_SOURCE
+#include <unistd.h>
 #include <limits.h>
 #include <sys/resource.h>
 

+ 1 - 0
src/legacy/getpagesize.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <unistd.h>
 #include "libc.h"
 

+ 1 - 1
src/legacy/getpass.c

@@ -1,5 +1,5 @@
+#define _GNU_SOURCE
 #include <stdio.h>
-#include <string.h>
 #include <termios.h>
 #include <unistd.h>
 #include <fcntl.h>

+ 1 - 2
src/legacy/getusershell.c

@@ -1,7 +1,6 @@
 #define _GNU_SOURCE
 #include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
+#include <unistd.h>
 
 static const char defshells[] = "/bin/sh\n/bin/csh\n";
 

+ 1 - 0
src/legacy/lutimes.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <fcntl.h>

+ 1 - 0
src/linux/chroot.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <unistd.h>
 #include "syscall.h"
 

+ 0 - 2
src/linux/clock_adjtime.c

@@ -1,5 +1,3 @@
-#define _GNU_SOURCE
-#include <time.h>
 #include <sys/timex.h>
 #include "syscall.h"
 

+ 1 - 0
src/linux/klogctl.c

@@ -1,3 +1,4 @@
+#include <sys/klog.h>
 #include "syscall.h"
 
 int klogctl (int type, char *buf, int len)

+ 1 - 0
src/linux/personality.c

@@ -1,3 +1,4 @@
+#include <sys/personality.h>
 #include "syscall.h"
 #ifdef SYS_personality
 int personality(unsigned long persona)

+ 2 - 1
src/linux/prlimit.c

@@ -1,4 +1,4 @@
-#include <unistd.h>
+#define _GNU_SOURCE
 #include <sys/resource.h>
 #include "syscall.h"
 #include "libc.h"
@@ -8,4 +8,5 @@ int prlimit(pid_t pid, int resource, const struct rlimit *new_limit, struct rlim
 	return syscall(SYS_prlimit64, pid, resource, new_limit, old_limit);
 }
 
+#undef prlimit64
 LFS64(prlimit);

+ 1 - 1
src/linux/sendfile.c

@@ -1,4 +1,4 @@
-#include <unistd.h>
+#include <sys/sendfile.h>
 #include "syscall.h"
 #include "libc.h"
 

+ 1 - 1
src/linux/setfsgid.c

@@ -1,4 +1,4 @@
-#include <unistd.h>
+#include <sys/fsuid.h>
 #include "syscall.h"
 #include "libc.h"
 

+ 1 - 1
src/linux/setfsuid.c

@@ -1,4 +1,4 @@
-#include <unistd.h>
+#include <sys/fsuid.h>
 #include "syscall.h"
 #include "libc.h"
 

+ 1 - 0
src/linux/setgroups.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <unistd.h>
 #include "syscall.h"
 

+ 1 - 0
src/linux/sethostname.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <unistd.h>
 #include "syscall.h"
 

+ 0 - 1
src/linux/setns.c

@@ -1,7 +1,6 @@
 #define _GNU_SOURCE
 #include <sched.h>
 #include "syscall.h"
-#include "libc.h"
 
 int setns(int fd, int nstype)
 {

+ 1 - 0
src/linux/stime.c

@@ -1,4 +1,5 @@
 #define _GNU_SOURCE
+#include <time.h>
 #include <sys/time.h>
 
 int stime(time_t *t)

+ 1 - 2
src/linux/sysinfo.c

@@ -1,7 +1,6 @@
+#include <sys/sysinfo.h>
 #include "syscall.h"
 
-struct sysinfo;
-
 int sysinfo(struct sysinfo *info)
 {
 	return syscall(SYS_sysinfo, info);

+ 0 - 1
src/linux/wait4.c

@@ -1,7 +1,6 @@
 #define _GNU_SOURCE
 #include <sys/wait.h>
 #include <sys/resource.h>
-#include <string.h>
 #include "syscall.h"
 
 pid_t wait4(pid_t pid, int *status, int options, struct rusage *usage)

+ 1 - 0
src/locale/intl.c

@@ -1,3 +1,4 @@
+#include <libintl.h>
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>

+ 0 - 2
src/locale/localeconv.c

@@ -1,6 +1,4 @@
 #include <locale.h>
-#include <string.h>
-#include <stdlib.h>
 
 static const struct lconv posix_lconv = {
 	.decimal_point = ".",

+ 0 - 1
src/locale/strcasecmp_l.c

@@ -1,5 +1,4 @@
 #include <strings.h>
-#include <ctype.h>
 
 int strcasecmp_l(const char *l, const char *r, locale_t loc)
 {

+ 0 - 1
src/malloc/calloc.c

@@ -1,6 +1,5 @@
 #include <stdlib.h>
 #include <errno.h>
-#include <string.h>
 
 void *calloc(size_t m, size_t n)
 {

+ 1 - 0
src/misc/get_current_dir_name.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <stdlib.h>
 #include <string.h>
 #include <limits.h>

+ 1 - 0
src/misc/getgrouplist.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <grp.h>
 #include <string.h>
 #include <limits.h>

+ 0 - 1
src/misc/getrusage.c

@@ -1,5 +1,4 @@
 #include <sys/resource.h>
-#include <string.h>
 #include "syscall.h"
 
 int getrusage(int who, struct rusage *ru)

+ 1 - 5
src/misc/initgroups.c

@@ -1,11 +1,7 @@
-#include <sys/types.h>
-#include <unistd.h>
+#define _GNU_SOURCE
 #include <grp.h>
 #include <limits.h>
 
-int getgrouplist(const char *, gid_t, gid_t *, int *);
-int setgroups(size_t, const gid_t *);
-
 int initgroups(const char *user, gid_t gid)
 {
 	gid_t groups[NGROUPS_MAX];

+ 0 - 2
src/misc/nftw.c

@@ -2,8 +2,6 @@
 #include <dirent.h>
 #include <sys/stat.h>
 #include <errno.h>
-#include <stdlib.h>
-#include <fcntl.h>
 #include <unistd.h>
 #include <string.h>
 #include <limits.h>

+ 0 - 1
src/misc/syslog.c

@@ -1,7 +1,6 @@
 #include <stdarg.h>
 #include <sys/socket.h>
 #include <stdio.h>
-#include <fcntl.h>
 #include <unistd.h>
 #include <syslog.h>
 #include <time.h>

+ 0 - 1
src/misc/uname.c

@@ -1,5 +1,4 @@
 #include <sys/utsname.h>
-#include <string.h>
 #include "syscall.h"
 
 int uname(struct utsname *uts)

+ 0 - 1
src/mman/msync.c

@@ -1,4 +1,3 @@
-#include <unistd.h>
 #include <sys/mman.h>
 #include "syscall.h"
 

+ 0 - 1
src/mman/munmap.c

@@ -1,4 +1,3 @@
-#include <unistd.h>
 #include <sys/mman.h>
 #include "syscall.h"
 #include "libc.h"

+ 0 - 2
src/multibyte/internal.c

@@ -4,8 +4,6 @@
  * unnecessary.
  */
 
-#include <inttypes.h>
-
 #include "internal.h"
 
 #define C(x) ( x<2 ? -1 : ( R(0x80,0xc0) | x ) )

+ 1 - 0
src/multibyte/internal.h

@@ -6,6 +6,7 @@
 
 #define bittab __fsmu8
 
+#include <stdint.h>
 #include "libc.h"
 
 extern const uint32_t bittab[] ATTR_LIBC_VISIBILITY;

+ 0 - 5
src/multibyte/mblen.c

@@ -5,11 +5,6 @@
  */
 
 #include <stdlib.h>
-#include <inttypes.h>
-#include <wchar.h>
-#include <errno.h>
-
-#include "internal.h"
 
 int mblen(const char *s, size_t n)
 {

+ 0 - 5
src/multibyte/mbrlen.c

@@ -4,12 +4,7 @@
  * unnecessary.
  */
 
-#include <stdlib.h>
-#include <inttypes.h>
 #include <wchar.h>
-#include <errno.h>
-
-#include "internal.h"
 
 size_t mbrlen(const char *restrict s, size_t n, mbstate_t *restrict st)
 {

+ 0 - 3
src/multibyte/mbrtowc.c

@@ -4,11 +4,8 @@
  * unnecessary.
  */
 
-#include <stdlib.h>
-#include <inttypes.h>
 #include <wchar.h>
 #include <errno.h>
-
 #include "internal.h"
 
 size_t mbrtowc(wchar_t *restrict wc, const char *restrict src, size_t n, mbstate_t *restrict st)

+ 0 - 5
src/multibyte/mbsinit.c

@@ -4,12 +4,7 @@
  * unnecessary.
  */
 
-#include <stdlib.h>
-#include <inttypes.h>
 #include <wchar.h>
-#include <errno.h>
-
-#include "internal.h"
 
 int mbsinit(const mbstate_t *st)
 {

+ 0 - 6
src/multibyte/mbsnrtowcs.c

@@ -4,13 +4,7 @@
  * unnecessary.
  */
 
-#include <stdlib.h>
-#include <inttypes.h>
 #include <wchar.h>
-#include <errno.h>
-#include <stdio.h>
-
-#include "internal.h"
 
 size_t mbsnrtowcs(wchar_t *restrict wcs, const char **restrict src, size_t n, size_t wn, mbstate_t *restrict st)
 {

+ 1 - 3
src/multibyte/mbsrtowcs.c

@@ -4,11 +4,9 @@
  * unnecessary.
  */
 
-#include <stdlib.h>
-#include <inttypes.h>
+#include <stdint.h>
 #include <wchar.h>
 #include <errno.h>
-
 #include "internal.h"
 
 size_t mbsrtowcs(wchar_t *restrict ws, const char **restrict src, size_t wn, mbstate_t *restrict st)

+ 1 - 4
src/multibyte/mbtowc.c

@@ -4,13 +4,10 @@
  * unnecessary.
  */
 
-#include <stdlib.h>
-#include <inttypes.h>
 #include <wchar.h>
 #include <errno.h>
-
 #include "internal.h"
-#include <stdio.h>
+
 int mbtowc(wchar_t *restrict wc, const char *restrict src, size_t n)
 {
 	unsigned c;

+ 0 - 4
src/multibyte/wcrtomb.c

@@ -4,13 +4,9 @@
  * unnecessary.
  */
 
-#include <stdlib.h>
-#include <inttypes.h>
 #include <wchar.h>
 #include <errno.h>
 
-#include "internal.h"
-
 size_t wcrtomb(char *restrict s, wchar_t wc, mbstate_t *restrict st)
 {
 	if (!s) return 1;

+ 0 - 5
src/multibyte/wcsnrtombs.c

@@ -4,12 +4,7 @@
  * unnecessary.
  */
 
-#include <stdlib.h>
-#include <inttypes.h>
 #include <wchar.h>
-#include <errno.h>
-
-#include "internal.h"
 
 size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
 {

+ 0 - 5
src/multibyte/wcsrtombs.c

@@ -4,12 +4,7 @@
  * unnecessary.
  */
 
-#include <stdlib.h>
-#include <inttypes.h>
 #include <wchar.h>
-#include <errno.h>
-
-#include "internal.h"
 
 size_t wcsrtombs(char *restrict s, const wchar_t **restrict ws, size_t n, mbstate_t *restrict st)
 {

+ 0 - 4
src/multibyte/wctomb.c

@@ -5,11 +5,7 @@
  */
 
 #include <stdlib.h>
-#include <inttypes.h>
 #include <wchar.h>
-#include <errno.h>
-
-#include "internal.h"
 
 int wctomb(char *s, wchar_t wc)
 {

+ 0 - 1
src/network/__ipparse.c

@@ -1,4 +1,3 @@
-#include <string.h>
 #include <stdlib.h>
 #include <ctype.h>
 #include <sys/socket.h>

+ 0 - 2
src/network/gethostbyaddr.c

@@ -1,8 +1,6 @@
 #define _GNU_SOURCE
 
 #include <netdb.h>
-#include <string.h>
-#include <netinet/in.h>
 #include <errno.h>
 #include <stdlib.h>
 

+ 0 - 2
src/network/gethostbyname2.c

@@ -2,8 +2,6 @@
 
 #include <sys/socket.h>
 #include <netdb.h>
-#include <string.h>
-#include <netinet/in.h>
 #include <errno.h>
 #include <stdlib.h>
 

+ 1 - 1
src/network/gethostbyname2_r.c

@@ -5,7 +5,7 @@
 #include <string.h>
 #include <netinet/in.h>
 #include <errno.h>
-#include <inttypes.h>
+#include <stdint.h>
 
 int gethostbyname2_r(const char *name, int af,
 	struct hostent *h, char *buf, size_t buflen,

+ 1 - 0
src/network/getifaddrs.c

@@ -11,6 +11,7 @@
 #include <arpa/inet.h> /* inet_pton */
 #include <unistd.h>
 #include <sys/ioctl.h>
+#include <sys/socket.h>
 
 typedef union {
 	struct sockaddr_in6 v6;

+ 0 - 1
src/network/getnameinfo.c

@@ -1,6 +1,5 @@
 #include <netdb.h>
 #include <limits.h>
-#include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <sys/socket.h>

+ 0 - 2
src/network/if_nameindex.c

@@ -6,8 +6,6 @@
 #include <errno.h>
 #include "syscall.h"
 
-#include <stdio.h>
-
 static void *do_nameindex(int s, size_t n)
 {
 	size_t i, len, k;

+ 0 - 2
src/network/inet_ntop.c

@@ -1,7 +1,5 @@
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <arpa/inet.h>
-#include <netdb.h>
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>

+ 0 - 1
src/network/proto.c

@@ -1,5 +1,4 @@
 #include <netdb.h>
-#include <stdio.h>
 #include <string.h>
 
 /* do we really need all these?? */

+ 0 - 2
src/network/recv.c

@@ -1,6 +1,4 @@
 #include <sys/socket.h>
-#include "syscall.h"
-#include "libc.h"
 
 ssize_t recv(int fd, void *buf, size_t len, int flags)
 {

+ 1 - 0
src/network/res_query.c

@@ -1,4 +1,5 @@
 #define _GNU_SOURCE
+#include <resolv.h>
 #include <netdb.h>
 #include "__dns.h"
 #include "libc.h"

+ 0 - 2
src/network/send.c

@@ -1,6 +1,4 @@
 #include <sys/socket.h>
-#include "syscall.h"
-#include "libc.h"
 
 ssize_t send(int fd, const void *buf, size_t len, int flags)
 {

+ 0 - 2
src/network/serv.c

@@ -1,6 +1,4 @@
 #include <netdb.h>
-#include <stdio.h>
-#include <string.h>
 
 void endservent(void)
 {

+ 1 - 0
src/passwd/fgetgrent.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include "pwf.h"
 
 struct group *fgetgrent(FILE *f)

+ 1 - 0
src/passwd/fgetpwent.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include "pwf.h"
 
 struct passwd *fgetpwent(FILE *f)

+ 1 - 0
src/passwd/putgrent.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <grp.h>
 #include <stdio.h>
 

+ 1 - 0
src/passwd/putpwent.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <pwd.h>
 #include <stdio.h>
 

+ 0 - 1
src/prng/__rand48_step.c

@@ -1,4 +1,3 @@
-#include <stdlib.h>
 #include <stdint.h>
 
 uint64_t __rand48_step(unsigned short *xi, unsigned short *lc)

+ 0 - 1
src/process/fexecve.c

@@ -1,5 +1,4 @@
 #include <unistd.h>
-#include <stdio.h>
 #include <errno.h>
 
 void __procfdname(char *, unsigned);

+ 1 - 1
src/process/system.c

@@ -1,5 +1,5 @@
 #include <unistd.h>
-#include <fcntl.h>
+#include <stdlib.h>
 #include <signal.h>
 #include <sys/wait.h>
 #include <spawn.h>

+ 1 - 0
src/process/vfork.c

@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <unistd.h>
 #include "syscall.h"
 #include "libc.h"

+ 0 - 2
src/regex/glob.c

@@ -7,8 +7,6 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <stddef.h>
-#include <unistd.h>
-#include <stdio.h>
 #include "libc.h"
 
 struct match

+ 0 - 1
src/regex/regcomp.c

@@ -30,7 +30,6 @@
 */
 
 #include <string.h>
-#include <errno.h>
 #include <stdlib.h>
 #include <regex.h>
 #include <limits.h>

+ 0 - 1
src/signal/raise.c

@@ -1,5 +1,4 @@
 #include <signal.h>
-#include <errno.h>
 #include <stdint.h>
 #include "syscall.h"
 #include "pthread_impl.h"

+ 0 - 1
src/signal/sigaction.c

@@ -1,4 +1,3 @@
-#include <stdlib.h>
 #include <signal.h>
 #include <errno.h>
 #include <string.h>

+ 0 - 1
src/signal/sigfillset.c

@@ -1,5 +1,4 @@
 #include <signal.h>
-#include <string.h>
 #include <limits.h>
 
 int sigfillset(sigset_t *set)

+ 1 - 1
src/signal/sighold.c

@@ -1,5 +1,5 @@
 #include <signal.h>
-#include <stdlib.h>
+#include <stddef.h>
 
 int sighold(int sig)
 {

+ 1 - 1
src/signal/sigignore.c

@@ -1,5 +1,5 @@
 #include <signal.h>
-#include <stdlib.h>
+#include <stddef.h>
 
 int sigignore(int sig)
 {

+ 1 - 1
src/signal/siginterrupt.c

@@ -1,4 +1,4 @@
-#include <stdlib.h>
+#include <stddef.h>
 #include <signal.h>
 
 int siginterrupt(int sig, int flag)

+ 0 - 1
src/signal/sigismember.c

@@ -1,5 +1,4 @@
 #include <signal.h>
-#include <errno.h>
 
 int sigismember(const sigset_t *set, int sig)
 {

+ 0 - 1
src/signal/siglongjmp.c

@@ -1,6 +1,5 @@
 #include <setjmp.h>
 #include <signal.h>
-#include <stdlib.h>
 #include "syscall.h"
 #include "pthread_impl.h"
 

+ 0 - 1
src/signal/signal.c

@@ -1,5 +1,4 @@
 #include <signal.h>
-#include <stddef.h>
 #include "syscall.h"
 #include "libc.h"
 

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác