include cleanups: remove unused headers and add feature test macros

This commit is contained in:
Szabolcs Nagy
2013-12-12 05:09:18 +00:00
parent ac45692a53
commit 571744447c
157 changed files with 68 additions and 207 deletions

View File

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

View File

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

View File

@ -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,

View File

@ -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,

View File

@ -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)

View File

@ -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"

View File

@ -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);

View File

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

View File

@ -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 *),

View File

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

View File

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

1
src/env/clearenv.c vendored
View File

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

2
src/env/putenv.c vendored
View File

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

1
src/env/unsetenv.c vendored
View File

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

View File

@ -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 */

View File

@ -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"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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])
{

View File

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

View File

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

View File

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

View File

@ -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";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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];

View File

@ -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>

View File

@ -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>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

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

View File

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

View File

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

View File

@ -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,

View File

@ -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;

View File

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

View File

@ -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;

View File

@ -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>

View File

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

View File

@ -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)
{

View File

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

View File

@ -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)
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Some files were not shown because too many files have changed in this diff Show More