Skip to content

Commit 931f0ac

Browse files
committed
rename EACCES to EACCESS
The WASI spec has decided to deviate from POSIX starting in snapshot preview 2. Refs: #59
1 parent 1761729 commit 931f0ac

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@ Possible values:
13701370

13711371
Argument list too long.
13721372

1373-
- <a href="#errno.acces" name="errno.acces"></a>**`UVWASI_EACCES`**
1373+
- <a href="#errno.access" name="errno.access"></a>**`UVWASI_EACCESS`**
13741374

13751375
Permission denied.
13761376

include/wasi_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ typedef uint64_t uvwasi_dircookie_t;
3131
typedef uint16_t uvwasi_errno_t;
3232
#define UVWASI_ESUCCESS 0
3333
#define UVWASI_E2BIG 1
34-
#define UVWASI_EACCES 2
34+
#define UVWASI_EACCESS 2
3535
#define UVWASI_EADDRINUSE 3
3636
#define UVWASI_EADDRNOTAVAIL 4
3737
#define UVWASI_EAFNOSUPPORT 5

src/uv_mapping.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
uvwasi_errno_t uvwasi__translate_uv_error(int err) {
2929
switch (err) {
3030
case UV_E2BIG: return UVWASI_E2BIG;
31-
case UV_EACCES: return UVWASI_EACCES;
31+
case UV_EACCES: return UVWASI_EACCESS;
3232
case UV_EADDRINUSE: return UVWASI_EADDRINUSE;
3333
case UV_EADDRNOTAVAIL: return UVWASI_EADDRNOTAVAIL;
3434
case UV_EAFNOSUPPORT: return UVWASI_EAFNOSUPPORT;

src/uvwasi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2410,7 +2410,7 @@ const char* uvwasi_embedder_err_code_to_string(uvwasi_errno_t code) {
24102410
switch (code) {
24112411
#define V(errcode) case errcode: return #errcode;
24122412
V(UVWASI_E2BIG)
2413-
V(UVWASI_EACCES)
2413+
V(UVWASI_EACCESS)
24142414
V(UVWASI_EADDRINUSE)
24152415
V(UVWASI_EADDRNOTAVAIL)
24162416
V(UVWASI_EAFNOSUPPORT)

test/test-uv-mapping.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
int main(void) {
99
/* Verify error code translation. */
1010
CHECK_ERR(E2BIG);
11-
CHECK_ERR(EACCES);
1211
CHECK_ERR(EADDRINUSE);
1312
CHECK_ERR(EADDRNOTAVAIL);
1413
CHECK_ERR(EAFNOSUPPORT);
@@ -63,6 +62,10 @@ int main(void) {
6362
CHECK_ERR(ETIMEDOUT);
6463
CHECK_ERR(ETXTBSY);
6564
CHECK_ERR(EXDEV);
65+
66+
/* EACCES is no longer consistently named. */
67+
assert(uvwasi__translate_uv_error(UV_EACCES) == UVWASI_EACCESS);
68+
6669
assert(uvwasi__translate_uv_error(0) == UVWASI_ESUCCESS);
6770
assert(uvwasi__translate_uv_error(1) == 1);
6871
assert(uvwasi__translate_uv_error(-99999) == UVWASI_ENOSYS);

0 commit comments

Comments
 (0)