Skip to content

Commit

Permalink
Add generic musl arch headers. NFC.
Browse files Browse the repository at this point in the history
This allows us to then remove some of our emscripten-specific
arch headers that are not longer needed (since they do not
differ from the generic version).

This is part of making musl updates easier.

See #7279
  • Loading branch information
sbc100 committed Jan 18, 2021
1 parent 540d3ba commit 87e5e2f
Show file tree
Hide file tree
Showing 21 changed files with 204 additions and 98 deletions.
2 changes: 1 addition & 1 deletion src/struct_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@
]
},
{
"file": "bits/mman.h",
"file": "sys/mman.h",
"defines": [
"MAP_ANONYMOUS",
"MAP_FAILED",
Expand Down
62 changes: 0 additions & 62 deletions system/lib/libc/musl/arch/emscripten/bits/mman.h

This file was deleted.

2 changes: 0 additions & 2 deletions system/lib/libc/musl/arch/emscripten/bits/resource.h

This file was deleted.

134 changes: 134 additions & 0 deletions system/lib/libc/musl/arch/generic/bits/errno.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#define EPERM 1
#define ENOENT 2
#define ESRCH 3
#define EINTR 4
#define EIO 5
#define ENXIO 6
#define E2BIG 7
#define ENOEXEC 8
#define EBADF 9
#define ECHILD 10
#define EAGAIN 11
#define ENOMEM 12
#define EACCES 13
#define EFAULT 14
#define ENOTBLK 15
#define EBUSY 16
#define EEXIST 17
#define EXDEV 18
#define ENODEV 19
#define ENOTDIR 20
#define EISDIR 21
#define EINVAL 22
#define ENFILE 23
#define EMFILE 24
#define ENOTTY 25
#define ETXTBSY 26
#define EFBIG 27
#define ENOSPC 28
#define ESPIPE 29
#define EROFS 30
#define EMLINK 31
#define EPIPE 32
#define EDOM 33
#define ERANGE 34
#define EDEADLK 35
#define ENAMETOOLONG 36
#define ENOLCK 37
#define ENOSYS 38
#define ENOTEMPTY 39
#define ELOOP 40
#define EWOULDBLOCK EAGAIN
#define ENOMSG 42
#define EIDRM 43
#define ECHRNG 44
#define EL2NSYNC 45
#define EL3HLT 46
#define EL3RST 47
#define ELNRNG 48
#define EUNATCH 49
#define ENOCSI 50
#define EL2HLT 51
#define EBADE 52
#define EBADR 53
#define EXFULL 54
#define ENOANO 55
#define EBADRQC 56
#define EBADSLT 57
#define EDEADLOCK EDEADLK
#define EBFONT 59
#define ENOSTR 60
#define ENODATA 61
#define ETIME 62
#define ENOSR 63
#define ENONET 64
#define ENOPKG 65
#define EREMOTE 66
#define ENOLINK 67
#define EADV 68
#define ESRMNT 69
#define ECOMM 70
#define EPROTO 71
#define EMULTIHOP 72
#define EDOTDOT 73
#define EBADMSG 74
#define EOVERFLOW 75
#define ENOTUNIQ 76
#define EBADFD 77
#define EREMCHG 78
#define ELIBACC 79
#define ELIBBAD 80
#define ELIBSCN 81
#define ELIBMAX 82
#define ELIBEXEC 83
#define EILSEQ 84
#define ERESTART 85
#define ESTRPIPE 86
#define EUSERS 87
#define ENOTSOCK 88
#define EDESTADDRREQ 89
#define EMSGSIZE 90
#define EPROTOTYPE 91
#define ENOPROTOOPT 92
#define EPROTONOSUPPORT 93
#define ESOCKTNOSUPPORT 94
#define EOPNOTSUPP 95
#define ENOTSUP EOPNOTSUPP
#define EPFNOSUPPORT 96
#define EAFNOSUPPORT 97
#define EADDRINUSE 98
#define EADDRNOTAVAIL 99
#define ENETDOWN 100
#define ENETUNREACH 101
#define ENETRESET 102
#define ECONNABORTED 103
#define ECONNRESET 104
#define ENOBUFS 105
#define EISCONN 106
#define ENOTCONN 107
#define ESHUTDOWN 108
#define ETOOMANYREFS 109
#define ETIMEDOUT 110
#define ECONNREFUSED 111
#define EHOSTDOWN 112
#define EHOSTUNREACH 113
#define EALREADY 114
#define EINPROGRESS 115
#define ESTALE 116
#define EUCLEAN 117
#define ENOTNAM 118
#define ENAVAIL 119
#define EISNAM 120
#define EREMOTEIO 121
#define EDQUOT 122
#define ENOMEDIUM 123
#define EMEDIUMTYPE 124
#define ECANCELED 125
#define ENOKEY 126
#define EKEYEXPIRED 127
#define EKEYREVOKED 128
#define EKEYREJECTED 129
#define EOWNERDEAD 130
#define ENOTRECOVERABLE 131
#define ERFKILL 132
#define EHWPOISON 133
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define O_LARGEFILE 0100000
#define O_NOATIME 01000000
#define O_PATH 010000000
#define O_TMPFILE 020000000
#define O_TMPFILE 020200000
#define O_NDELAY O_NONBLOCK

#define F_DUPFD 0
Expand Down
10 changes: 10 additions & 0 deletions system/lib/libc/musl/arch/generic/bits/fenv.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#define FE_ALL_EXCEPT 0
#define FE_TONEAREST 0

typedef unsigned long fexcept_t;

typedef struct {
unsigned long __cw;
} fenv_t;

#define FE_DFL_ENV ((const fenv_t *) -1)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,23 @@
#define TIOCSETD 0x5423
#define TIOCGETD 0x5424
#define TCSBRKP 0x5425
#define TIOCTTYGSTRUCT 0x5426
#define TIOCSBRK 0x5427
#define TIOCCBRK 0x5428
#define TIOCGSID 0x5429
#define TIOCGRS485 0x542E
#define TIOCSRS485 0x542F
#define TIOCGPTN 0x80045430
#define TIOCSPTLCK 0x40045431
#define TIOCGDEV 0x80045432
#define TCGETX 0x5432
#define TCSETX 0x5433
#define TCSETXF 0x5434
#define TCSETXW 0x5435
#define TIOCSIG 0x40045436
#define TIOCVHANGUP 0x5437
#define TIOCGPKT 0x80045438
#define TIOCGPTLCK 0x80045439
#define TIOCGEXCL 0x80045440

#define FIONCLEX 0x5450
#define FIOCLEX 0x5451
Expand All @@ -72,8 +79,6 @@

#define TIOCMIWAIT 0x545C
#define TIOCGICOUNT 0x545D
#define TIOCGHAYESESP 0x545E
#define TIOCSHAYESESP 0x545F
#define FIOQSIZE 0x5460

#define TIOCPKT_DATA 0
Expand Down Expand Up @@ -108,7 +113,6 @@ struct winsize {
#define TIOCM_OUT1 0x2000
#define TIOCM_OUT2 0x4000
#define TIOCM_LOOP 0x8000
#define TIOCM_MODEM_BITS TIOCM_OUT2

#define N_TTY 0
#define N_SLIP 1
Expand Down Expand Up @@ -157,6 +161,7 @@ struct winsize {
#define SIOCSIFMEM 0x8920
#define SIOCGIFMTU 0x8921
#define SIOCSIFMTU 0x8922
#define SIOCSIFNAME 0x8923
#define SIOCSIFHWADDR 0x8924
#define SIOCGIFENCAP 0x8925
#define SIOCSIFENCAP 0x8926
Expand Down Expand Up @@ -195,3 +200,5 @@ struct winsize {

#define SIOCDEVPRIVATE 0x89F0
#define SIOCPROTOPRIVATE 0x89E0

#include <bits/ioctl_fix.h>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
struct ipc_perm
{
struct ipc_perm {
key_t __ipc_perm_key;
uid_t uid;
gid_t gid;
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
struct msqid_ds
{
struct msqid_ds {
struct ipc_perm msg_perm;
time_t msg_stime;
int __unused1;
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ struct semid_ds {
time_t __unused1;
time_t sem_ctime;
time_t __unused2;
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned short sem_nsems;
char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
#else
char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
unsigned short sem_nsems;
#endif
time_t __unused3;
time_t __unused4;
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#define SHMLBA 4096

struct shmid_ds
{
struct shmid_ds {
struct ipc_perm shm_perm;
size_t shm_segsz;
time_t shm_atime;
Expand All @@ -16,3 +15,14 @@ struct shmid_ds
unsigned long __pad1;
unsigned long __pad2;
};

struct shminfo {
unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
};

struct shm_info {
int __used_ids;
unsigned long shm_tot, shm_rss, shm_swp;
unsigned long __swap_attempts, __swap_successes;
};

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
struct msghdr
{
struct msghdr {
void *msg_name;
socklen_t msg_namelen;
struct iovec *msg_iov;
Expand All @@ -9,8 +8,7 @@ struct msghdr
int msg_flags;
};

struct cmsghdr
{
struct cmsghdr {
socklen_t cmsg_len;
int cmsg_level;
int cmsg_type;
Expand Down
Loading

0 comments on commit 87e5e2f

Please sign in to comment.