Skip to content

Commit 4e9b107

Browse files
committed
More header cleanups; disable more unsupported features.
1 parent c08dc10 commit 4e9b107

3 files changed

Lines changed: 31 additions & 25 deletions

File tree

expected/wasm32-wasi/predefined-macros.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,7 +2651,6 @@
26512651
#define _POSIX_AIO_LISTIO_MAX 2
26522652
#define _POSIX_AIO_MAX 1
26532653
#define _POSIX_ARG_MAX 4096
2654-
#define _POSIX_ASYNCHRONOUS_IO _POSIX_VERSION
26552654
#define _POSIX_BARRIERS _POSIX_VERSION
26562655
#define _POSIX_CHILD_MAX 25
26572656
#define _POSIX_CHOWN_RESTRICTED 1
@@ -2673,16 +2672,13 @@
26732672
#define _POSIX_OPEN_MAX 20
26742673
#define _POSIX_PATH_MAX 256
26752674
#define _POSIX_PIPE_BUF 512
2676-
#define _POSIX_RAW_SOCKETS _POSIX_VERSION
26772675
#define _POSIX_READER_WRITER_LOCKS _POSIX_VERSION
26782676
#define _POSIX_REALTIME_SIGNALS _POSIX_VERSION
26792677
#define _POSIX_REGEXP 1
26802678
#define _POSIX_RE_DUP_MAX 255
26812679
#define _POSIX_RTSIG_MAX 8
2682-
#define _POSIX_SEMAPHORES _POSIX_VERSION
26832680
#define _POSIX_SEM_NSEMS_MAX 256
26842681
#define _POSIX_SEM_VALUE_MAX 32767
2685-
#define _POSIX_SHARED_MEMORY_OBJECTS _POSIX_VERSION
26862682
#define _POSIX_SIGQUEUE_MAX 32
26872683
#define _POSIX_SPIN_LOCKS _POSIX_VERSION
26882684
#define _POSIX_SSIZE_MAX 32767

libc-bottom-half/headers/public/__header_fcntl.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
#define O_EXCL (__WASI_O_EXCL << 12)
1414
#define O_TRUNC (__WASI_O_TRUNC << 12)
1515

16-
#define O_NOFOLLOW 0x1000000
17-
#define O_EXEC 0x2000000
18-
#define O_RDONLY 0x4000000
19-
#define O_SEARCH 0x8000000
20-
#define O_WRONLY 0x10000000
16+
#define O_NOFOLLOW (0x01000000)
17+
#define O_EXEC (0x02000000)
18+
#define O_RDONLY (0x04000000)
19+
#define O_SEARCH (0x08000000)
20+
#define O_WRONLY (0x10000000)
2121

22-
#define O_CLOEXEC 0
23-
#define O_NOCTTY 0
22+
#define O_CLOEXEC (0)
23+
#define O_NOCTTY (0)
2424

2525
#define O_RDWR (O_RDONLY | O_WRONLY)
2626
#define O_ACCMODE (O_EXEC | O_RDWR | O_SEARCH)
@@ -32,16 +32,16 @@
3232
#define POSIX_FADV_SEQUENTIAL __WASI_ADVICE_SEQUENTIAL
3333
#define POSIX_FADV_WILLNEED __WASI_ADVICE_WILLNEED
3434

35-
#define F_GETFD 1
36-
#define F_SETFD 2
37-
#define F_GETFL 3
38-
#define F_SETFL 4
35+
#define F_GETFD (1)
36+
#define F_SETFD (2)
37+
#define F_GETFL (3)
38+
#define F_SETFL (4)
3939

40-
#define FD_CLOEXEC 1
40+
#define FD_CLOEXEC (1)
4141

42-
#define AT_EACCESS 0x0
43-
#define AT_SYMLINK_NOFOLLOW 0x1
44-
#define AT_SYMLINK_FOLLOW 0x2
45-
#define AT_REMOVEDIR 0x4
42+
#define AT_EACCESS (0x0)
43+
#define AT_SYMLINK_NOFOLLOW (0x1)
44+
#define AT_SYMLINK_FOLLOW (0x2)
45+
#define AT_REMOVEDIR (0x4)
4646

4747
#endif

libc-top-half/musl/include/unistd.h

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,15 @@ int setpgid(pid_t, pid_t);
123123
pid_t setsid(void);
124124
pid_t getsid(pid_t);
125125
#endif
126+
#ifdef __wasilibc_unmodified_upstream
126127
char *ttyname(int);
127128
int ttyname_r(int, char *, size_t);
129+
#endif
128130
int isatty(int);
131+
#ifdef __wasilibc_unmodified_upstream
129132
pid_t tcgetpgrp(int);
130133
int tcsetpgrp(int, pid_t);
134+
#endif
131135

132136
#ifdef __wasilibc_unmodified_upstream /* getpid */
133137
uid_t getuid(void);
@@ -164,11 +168,15 @@ size_t confstr(int, char *, size_t);
164168
int setreuid(uid_t, uid_t);
165169
int setregid(gid_t, gid_t);
166170
#endif
171+
#ifdef __wasilibc_unmodified_upstream
167172
int lockf(int, int, off_t);
173+
#endif
168174
long gethostid(void);
175+
#ifdef __wasilibc_unmodified_upstream
169176
int nice(int);
170177
void sync(void);
171178
pid_t setpgrp(void);
179+
#endif
172180
char *crypt(const char *, const char *);
173181
void encrypt(char *, int);
174182
void swab(const void *__restrict, void *__restrict, ssize_t);
@@ -190,13 +198,10 @@ int brk(void *);
190198
void *sbrk(intptr_t);
191199
#ifdef __wasilibc_unmodified_upstream
192200
pid_t vfork(void);
193-
#endif
194201
int vhangup(void);
195-
#ifdef __wasilibc_unmodified_upstream
196202
int chroot(const char *);
197203
int getpagesize(void);
198204
int getdtablesize(void);
199-
#endif
200205
int sethostname(const char *, size_t);
201206
int getdomainname(char *, size_t);
202207
int setdomainname(const char *, size_t);
@@ -208,10 +213,9 @@ void endusershell(void);
208213
char *getusershell(void);
209214
int acct(const char *);
210215
long syscall(long, ...);
211-
#ifdef __wasilibc_unmodified_upstream
212216
int execvpe(const char *, char *const [], char *const []);
213-
#endif
214217
int issetugid(void);
218+
#endif
215219
int getentropy(void *, size_t);
216220
#endif
217221

@@ -226,7 +230,9 @@ int getresgid(gid_t *, gid_t *, gid_t *);
226230
#ifdef __wasilibc_unmodified_upstream /* cwd */
227231
char *get_current_dir_name(void);
228232
#endif
233+
#ifdef __wasilibc_unmodified_upstream /* syncfs */
229234
int syncfs(int);
235+
#endif
230236
#ifdef __wasilibc_unmodified_upstream /* getpid */
231237
int euidaccess(const char *, int);
232238
int eaccess(const char *, int);
@@ -265,7 +271,9 @@ int eaccess(const char *, int);
265271
#endif
266272
#define _POSIX_FSYNC _POSIX_VERSION
267273
#define _POSIX_NO_TRUNC 1
274+
#ifdef __wasilibc_unmodified_upstream
268275
#define _POSIX_RAW_SOCKETS _POSIX_VERSION
276+
#endif
269277
#define _POSIX_REALTIME_SIGNALS _POSIX_VERSION
270278
#define _POSIX_REGEXP 1
271279
#ifdef __wasilibc_unmodified_upstream
@@ -290,9 +298,11 @@ int eaccess(const char *, int);
290298
#define _POSIX_BARRIERS _POSIX_VERSION
291299
#define _POSIX_SPIN_LOCKS _POSIX_VERSION
292300
#define _POSIX_READER_WRITER_LOCKS _POSIX_VERSION
301+
#ifdef __wasilibc_unmodified_upstream
293302
#define _POSIX_ASYNCHRONOUS_IO _POSIX_VERSION
294303
#define _POSIX_SEMAPHORES _POSIX_VERSION
295304
#define _POSIX_SHARED_MEMORY_OBJECTS _POSIX_VERSION
305+
#endif
296306

297307
#define _POSIX2_C_BIND _POSIX_VERSION
298308

0 commit comments

Comments
 (0)