Skip to content

Commit 9228d7a

Browse files
committed
Synchronize reference-sysroot with wasmtime API changes.
1 parent 77a2d87 commit 9228d7a

6 files changed

Lines changed: 17 additions & 31 deletions

File tree

expected/wasm32-wasi/predefined-macros.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3518,11 +3518,10 @@
35183518
#define __WASI_FILETYPE_SOCKET_STREAM (UINT8_C(6))
35193519
#define __WASI_FILETYPE_SYMBOLIC_LINK (UINT8_C(7))
35203520
#define __WASI_FILETYPE_UNKNOWN (UINT8_C(0))
3521-
#define __WASI_FILE_STAT_ATIM (UINT16_C(0x0001))
3522-
#define __WASI_FILE_STAT_ATIM_NOW (UINT16_C(0x0002))
3523-
#define __WASI_FILE_STAT_MTIM (UINT16_C(0x0004))
3524-
#define __WASI_FILE_STAT_MTIM_NOW (UINT16_C(0x0008))
3525-
#define __WASI_FILE_STAT_SIZE (UINT16_C(0x0010))
3521+
#define __WASI_FILE_STAT_SET_ATIM (UINT16_C(0x0001))
3522+
#define __WASI_FILE_STAT_SET_ATIM_NOW (UINT16_C(0x0002))
3523+
#define __WASI_FILE_STAT_SET_MTIM (UINT16_C(0x0004))
3524+
#define __WASI_FILE_STAT_SET_MTIM_NOW (UINT16_C(0x0008))
35263525
#define __WASI_LOOKUP_SYMLINK_FOLLOW (UINT32_C(0x00000001))
35273526
#define __WASI_O_CREAT (UINT16_C(0x0001))
35283527
#define __WASI_O_DIRECTORY (UINT16_C(0x0002))
@@ -3531,7 +3530,7 @@
35313530
#define __WASI_RIGHT_FD_DATASYNC (UINT64_C(0x0000000000000001))
35323531
#define __WASI_RIGHT_FD_READ (UINT64_C(0x0000000000000002))
35333532
#define __WASI_RIGHT_FD_SEEK (UINT64_C(0x0000000000000004))
3534-
#define __WASI_RIGHT_FD_STAT_PUT_FLAGS (UINT64_C(0x0000000000000008))
3533+
#define __WASI_RIGHT_FD_STAT_SET_FLAGS (UINT64_C(0x0000000000000008))
35353534
#define __WASI_RIGHT_FD_SYNC (UINT64_C(0x0000000000000010))
35363535
#define __WASI_RIGHT_FD_TELL (UINT64_C(0x0000000000000020))
35373536
#define __WASI_RIGHT_FD_WRITE (UINT64_C(0x0000000000000040))
@@ -3589,7 +3588,6 @@
35893588
#define __WASI_SOCK_RECV_PEEK (UINT16_C(0x0001))
35903589
#define __WASI_SOCK_RECV_WAITALL (UINT16_C(0x0002))
35913590
#define __WASI_SUBSCRIPTION_CLOCK_ABSTIME (UINT16_C(0x0001))
3592-
#define __WASI_SUBSCRIPTION_FD_READWRITE_POLL (UINT16_C(0x0001))
35933591
#define __WASI_UNLINK_REMOVEDIR (UINT8_C(0x01))
35943592
#define __WASI_WHENCE_CUR (UINT8_C(0))
35953593
#define __WASI_WHENCE_END (UINT8_C(1))

libc-bottom-half/cloudlibc/src/libc/poll/poll.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ int poll(struct pollfd *fds, size_t nfds, int timeout) {
2727
.fd_readwrite.flags = __WASI_SUBSCRIPTION_FD_READWRITE_POLL,
2828
#else
2929
.u.fd_readwrite.fd = pollfd->fd,
30-
.u.fd_readwrite.flags = __WASI_SUBSCRIPTION_FD_READWRITE_POLL,
3130
#endif
3231
};
3332
created_events = true;
@@ -42,7 +41,6 @@ int poll(struct pollfd *fds, size_t nfds, int timeout) {
4241
.fd_readwrite.flags = __WASI_SUBSCRIPTION_FD_READWRITE_POLL,
4342
#else
4443
.u.fd_readwrite.fd = pollfd->fd,
45-
.u.fd_readwrite.flags = __WASI_SUBSCRIPTION_FD_READWRITE_POLL,
4644
#endif
4745
};
4846
created_events = true;

libc-bottom-half/cloudlibc/src/libc/sys/ioctl/ioctl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ int ioctl(int fildes, int request, ...) {
2020
.fd_readwrite.flags = __WASI_SUBSCRIPTION_FD_READWRITE_POLL,
2121
#else
2222
.u.fd_readwrite.fd = fildes,
23-
.u.fd_readwrite.flags = __WASI_SUBSCRIPTION_FD_READWRITE_POLL,
2423
#endif
2524
},
2625
{

libc-bottom-half/cloudlibc/src/libc/sys/select/pselect.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ int pselect(int nfds, fd_set *restrict readfds, fd_set *restrict writefds,
5555
.fd_readwrite.flags = __WASI_SUBSCRIPTION_FD_READWRITE_POLL,
5656
#else
5757
.u.fd_readwrite.fd = fd,
58-
.u.fd_readwrite.flags = __WASI_SUBSCRIPTION_FD_READWRITE_POLL,
5958
#endif
6059
};
6160
}
@@ -74,7 +73,6 @@ int pselect(int nfds, fd_set *restrict readfds, fd_set *restrict writefds,
7473
.fd_readwrite.flags = __WASI_SUBSCRIPTION_FD_READWRITE_POLL,
7574
#else
7675
.u.fd_readwrite.fd = fd,
77-
.u.fd_readwrite.flags = __WASI_SUBSCRIPTION_FD_READWRITE_POLL,
7876
#endif
7977
};
8078
}

libc-bottom-half/cloudlibc/src/libc/sys/stat/stat_impl.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static inline bool utimens_get_timestamps(const struct timespec *times,
9898
#ifdef __wasilibc_unmodified_upstream // fstat
9999
*flags = __WASI_FILESTAT_ATIM_NOW | __WASI_FILESTAT_MTIM_NOW;
100100
#else
101-
*flags = __WASI_FILE_STAT_ATIM_NOW | __WASI_FILE_STAT_MTIM_NOW;
101+
*flags = __WASI_FILE_STAT_SET_ATIM_NOW | __WASI_FILE_STAT_SET_MTIM_NOW;
102102
#endif
103103
} else {
104104
// Set individual timestamps.
@@ -108,7 +108,7 @@ static inline bool utimens_get_timestamps(const struct timespec *times,
108108
#ifdef __wasilibc_unmodified_upstream // fstat
109109
*flags |= __WASI_FILESTAT_ATIM_NOW;
110110
#else
111-
*flags |= __WASI_FILE_STAT_ATIM_NOW;
111+
*flags |= __WASI_FILE_STAT_SET_ATIM_NOW;
112112
#endif
113113
break;
114114
case UTIME_OMIT:
@@ -118,7 +118,7 @@ static inline bool utimens_get_timestamps(const struct timespec *times,
118118
*flags |= __WASI_FILESTAT_ATIM;
119119
if (!timespec_to_timestamp_exact(&times[0], &fs->st_atim))
120120
#else
121-
*flags |= __WASI_FILE_STAT_ATIM;
121+
*flags |= __WASI_FILE_STAT_SET_ATIM;
122122
if (!timespec_to_timestamp_exact(&times[0], st_atim))
123123
#endif
124124
return false;
@@ -130,7 +130,7 @@ static inline bool utimens_get_timestamps(const struct timespec *times,
130130
#ifdef __wasilibc_unmodified_upstream // fstat
131131
*flags |= __WASI_FILESTAT_MTIM_NOW;
132132
#else
133-
*flags |= __WASI_FILE_STAT_MTIM_NOW;
133+
*flags |= __WASI_FILE_STAT_SET_MTIM_NOW;
134134
#endif
135135
break;
136136
case UTIME_OMIT:
@@ -140,7 +140,7 @@ static inline bool utimens_get_timestamps(const struct timespec *times,
140140
*flags |= __WASI_FILESTAT_MTIM;
141141
if (!timespec_to_timestamp_exact(&times[1], &fs->st_mtim))
142142
#else
143-
*flags |= __WASI_FILE_STAT_MTIM;
143+
*flags |= __WASI_FILE_STAT_SET_MTIM;
144144
if (!timespec_to_timestamp_exact(&times[1], st_mtim))
145145
#endif
146146
return false;

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

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,10 @@ typedef uint8_t __wasi_filetype_t;
163163
#define __WASI_FILETYPE_SYMBOLIC_LINK (UINT8_C(7))
164164

165165
typedef uint16_t __wasi_fstflags_t;
166-
#define __WASI_FILE_STAT_ATIM (UINT16_C(0x0001))
167-
#define __WASI_FILE_STAT_ATIM_NOW (UINT16_C(0x0002))
168-
#define __WASI_FILE_STAT_MTIM (UINT16_C(0x0004))
169-
#define __WASI_FILE_STAT_MTIM_NOW (UINT16_C(0x0008))
170-
#define __WASI_FILE_STAT_SIZE (UINT16_C(0x0010))
166+
#define __WASI_FILE_STAT_SET_ATIM (UINT16_C(0x0001))
167+
#define __WASI_FILE_STAT_SET_ATIM_NOW (UINT16_C(0x0002))
168+
#define __WASI_FILE_STAT_SET_MTIM (UINT16_C(0x0004))
169+
#define __WASI_FILE_STAT_SET_MTIM_NOW (UINT16_C(0x0008))
171170

172171
typedef uint64_t __wasi_inode_t;
173172

@@ -190,7 +189,7 @@ typedef uint64_t __wasi_rights_t;
190189
#define __WASI_RIGHT_FD_DATASYNC (UINT64_C(0x0000000000000001))
191190
#define __WASI_RIGHT_FD_READ (UINT64_C(0x0000000000000002))
192191
#define __WASI_RIGHT_FD_SEEK (UINT64_C(0x0000000000000004))
193-
#define __WASI_RIGHT_FD_STAT_PUT_FLAGS (UINT64_C(0x0000000000000008))
192+
#define __WASI_RIGHT_FD_STAT_SET_FLAGS (UINT64_C(0x0000000000000008))
194193
#define __WASI_RIGHT_FD_SYNC (UINT64_C(0x0000000000000010))
195194
#define __WASI_RIGHT_FD_TELL (UINT64_C(0x0000000000000020))
196195
#define __WASI_RIGHT_FD_WRITE (UINT64_C(0x0000000000000040))
@@ -258,9 +257,6 @@ typedef uint8_t __wasi_signal_t;
258257
typedef uint16_t __wasi_subclockflags_t;
259258
#define __WASI_SUBSCRIPTION_CLOCK_ABSTIME (UINT16_C(0x0001))
260259

261-
typedef uint16_t __wasi_subrwflags_t;
262-
#define __WASI_SUBSCRIPTION_FD_READWRITE_POLL (UINT16_C(0x0001))
263-
264260
typedef uint64_t __wasi_timestamp_t;
265261

266262
typedef uint8_t __wasi_ulflags_t;
@@ -400,7 +396,6 @@ typedef struct __wasi_subscription_t {
400396
} clock;
401397
struct __wasi_subscription_u_fd_readwrite_t {
402398
__wasi_fd_t fd;
403-
__wasi_subrwflags_t flags;
404399
} fd_readwrite;
405400
} u;
406401
} __wasi_subscription_t;
@@ -424,9 +419,6 @@ _Static_assert(
424419
_Static_assert(
425420
offsetof(__wasi_subscription_t, u.fd_readwrite.fd) == 16,
426421
"non-wasi data layout");
427-
_Static_assert(
428-
offsetof(__wasi_subscription_t, u.fd_readwrite.flags) == 20,
429-
"non-wasi data layout");
430422
_Static_assert(sizeof(__wasi_subscription_t) == 56, "non-wasi data layout");
431423
_Static_assert(_Alignof(__wasi_subscription_t) == 8, "non-wasi data layout");
432424

@@ -504,7 +496,8 @@ __wasi_errno_t __wasi_fd_stat_set_flags(
504496

505497
__wasi_errno_t __wasi_fd_stat_set_rights(
506498
__wasi_fd_t fd,
507-
__wasi_rights_t rights
499+
__wasi_rights_t fs_rights_base,
500+
__wasi_rights_t fs_rights_inheriting
508501
) __WASI_SYSCALL_NAME(fd_stat_set_rights) __attribute__((__warn_unused_result__));
509502

510503
__wasi_errno_t __wasi_fd_sync(

0 commit comments

Comments
 (0)