@ai-ecoverse/wasix-sysroot 2025.9.30-19 → 2025.9.30-21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -41,4 +41,51 @@ Since 2025.9.30-18:
41
41
  `sleep` early with the seconds left.
42
42
  - `raise()` and `pthread_kill(pthread_self())` reach the handler.
43
43
 
44
+ Since 2025.9.30-21 terminals are per descriptor (slicc-kernel's `slicc_tty`,
45
+ slicc-kernel#289):
46
+ - `tcgetattr`/`tcsetattr` carry the whole termios, so `cfmakeraw` is really
47
+ raw;
48
+ - `ioctl(TIOCGWINSZ)`, `TCGETS`/`TCSETS*` and `isatty` answer for that fd
49
+ (ENOTTY on pipes and files);
50
+ - `ioctl(TIOCSWINSZ)` returns 0 on a terminal but changes nothing: the size
51
+ is the page's, and slicc-kernel has no set-window-size call (ENOTTY
52
+ elsewhere);
53
+ - `fstat`/`stat`/`lstat` take a file's type from slicc-kernel's `slicc_fs`
54
+ mode when it carries one, so a pipe is `S_ISFIFO` once the kernel reports
55
+ it (WASI has no FIFO filetype); otherwise the WASI filetype stays;
56
+ - older kernels keep the previous behaviour.
57
+
58
+ Since 2025.9.30-20 user and group ids come from slicc-kernel's process
59
+ credentials (`slicc.cred_get`/`cred_set`/`groups_get`/`groups_set`; slicc-kernel
60
+ ≥ 1.44.0, which has users), and `getpw*`/`getgr*` read its `/etc/passwd` and `/etc/group`.
61
+ There is no fallback to uid 1000: on an older kernel `getuid()` returns -1,
62
+ the set\*id calls fail with ENOSYS, and user lookups find nothing.
63
+
44
64
  Data only — no commands. Set `WASIXCC_SYSROOT_PREFIX` to this package directory.
65
+
66
+ ## File type bits (`S_IF*`) differ from Linux
67
+
68
+ WASIX libc compiles `st_mode` file types from `__mode_t.h`. The values are
69
+ part of the ABI of every package built on this sysroot, so they stay:
70
+
71
+ | | WASIX | Linux |
72
+ | --- | --- | --- |
73
+ | `S_IFREG`, `S_IFDIR`, `S_IFLNK`, `S_IFCHR`, `S_IFBLK` | same as Linux | 0o100000, 0o040000, 0o120000, 0o020000, 0o060000 |
74
+ | `S_IFIFO` | **0o140000** (Linux's `S_IFSOCK`) | 0o010000 |
75
+ | `S_IFSOCK` | **0o160000** | 0o140000 |
76
+ | `S_IFMT` | **0o160000** (the OR of the types; Linux's FIFO bit 0o010000 is masked away) | 0o170000 |
77
+
78
+ slicc-kernel's pipes are WASI sockets (filetype `SOCKET_STREAM`, since
79
+ slicc-kernel#280). So `fstat` on any pipe gives `0o160000 | perms`, and inside
80
+ a WASIX program `S_ISSOCK` is true and `S_ISFIFO` false, consistently.
81
+
82
+ Inside one program the macros agree with each other. The hazard is a raw
83
+ `st_mode` that crosses the wasm boundary: it carries WASIX numbers. Examples:
84
+ - cpio `newc` headers;
85
+ - tar entries for sockets and FIFOs;
86
+ - JSON stat dumps read by Node or bash;
87
+ - scripts comparing octal modes with Linux constants (a cert once saw
88
+ `S_ISSOCK False` this way).
89
+
90
+ Decode such values with the table above, or translate them before they leave
91
+ the program.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/wasix-sysroot",
3
- "version": "2025.9.30-19",
4
- "description": "WASIX sysroots: st_uid/st_gid=1000 (slicc identity), file modes via slicc_fs, F_SETFD CLOEXEC fix, select exceptfds, physical chdir, POSIX TZ, socketpair flags, sigaction_set, alarm/setitimer/getitimer, EINTR sleeps, raise/pthread_kill, wasip1, clang24 exnref",
3
+ "version": "2025.9.30-21",
4
+ "description": "WASIX sysroots: st_uid/st_gid = getuid()/getgid(), file modes via slicc_fs, F_SETFD CLOEXEC fix, select exceptfds, physical chdir, POSIX TZ, socketpair flags, sigaction_set, alarm/setitimer/getitimer, EINTR sleeps, raise/pthread_kill, process credentials from slicc-kernel (no fixed uid 1000), per-fd termios/winsize from slicc-kernel, wasip1, clang24 exnref",
5
5
  "license": "Apache-2.0 WITH LLVM-exception",
6
6
  "repository": {
7
7
  "type": "git",
@@ -163,9 +163,7 @@ int isatty(int);
163
163
  pid_t tcgetpgrp(int);
164
164
  int tcsetpgrp(int, pid_t);
165
165
 
166
- #ifdef __wasilibc_unmodified_upstream /* WASI has no getuid etc. */
167
- int getgroups(int, gid_t []);
168
- #endif
166
+ int getgroups(int, gid_t []); /* homescoop wasix-sysroot -20 */
169
167
 
170
168
  uid_t getuid(void);
171
169
  uid_t geteuid(void);
@@ -195,10 +193,8 @@ size_t confstr(int, char *, size_t);
195
193
  #define F_LOCK 1
196
194
  #define F_TLOCK 2
197
195
  #define F_TEST 3
198
- #ifdef __wasilibc_unmodified_upstream /* WASI has no setreuid */
199
- int setreuid(uid_t, uid_t);
196
+ int setreuid(uid_t, uid_t); /* homescoop wasix-sysroot -20 */
200
197
  int setregid(gid_t, gid_t);
201
- #endif
202
198
  #ifdef __wasilibc_unmodified_upstream /* WASI has no POSIX file locking */
203
199
  int lockf(int, int, off_t);
204
200
  #endif
@@ -270,12 +266,10 @@ int getpagesize(void);
270
266
 
271
267
  #ifdef _GNU_SOURCE
272
268
  extern char **environ;
273
- #ifdef __wasilibc_unmodified_upstream /* WASI has no get/setresuid */
274
- int setresuid(uid_t, uid_t, uid_t);
269
+ int setresuid(uid_t, uid_t, uid_t); /* homescoop wasix-sysroot -20 */
275
270
  int setresgid(gid_t, gid_t, gid_t);
276
271
  int getresuid(uid_t *, uid_t *, uid_t *);
277
272
  int getresgid(gid_t *, gid_t *, gid_t *);
278
- #endif
279
273
  #ifdef __wasilibc_unmodified_upstream /* WASI has no cwd */
280
274
  char *get_current_dir_name(void);
281
275
  #endif
Binary file
@@ -163,9 +163,7 @@ int isatty(int);
163
163
  pid_t tcgetpgrp(int);
164
164
  int tcsetpgrp(int, pid_t);
165
165
 
166
- #ifdef __wasilibc_unmodified_upstream /* WASI has no getuid etc. */
167
- int getgroups(int, gid_t []);
168
- #endif
166
+ int getgroups(int, gid_t []); /* homescoop wasix-sysroot -20 */
169
167
 
170
168
  uid_t getuid(void);
171
169
  uid_t geteuid(void);
@@ -195,10 +193,8 @@ size_t confstr(int, char *, size_t);
195
193
  #define F_LOCK 1
196
194
  #define F_TLOCK 2
197
195
  #define F_TEST 3
198
- #ifdef __wasilibc_unmodified_upstream /* WASI has no setreuid */
199
- int setreuid(uid_t, uid_t);
196
+ int setreuid(uid_t, uid_t); /* homescoop wasix-sysroot -20 */
200
197
  int setregid(gid_t, gid_t);
201
- #endif
202
198
  #ifdef __wasilibc_unmodified_upstream /* WASI has no POSIX file locking */
203
199
  int lockf(int, int, off_t);
204
200
  #endif
@@ -270,12 +266,10 @@ int getpagesize(void);
270
266
 
271
267
  #ifdef _GNU_SOURCE
272
268
  extern char **environ;
273
- #ifdef __wasilibc_unmodified_upstream /* WASI has no get/setresuid */
274
- int setresuid(uid_t, uid_t, uid_t);
269
+ int setresuid(uid_t, uid_t, uid_t); /* homescoop wasix-sysroot -20 */
275
270
  int setresgid(gid_t, gid_t, gid_t);
276
271
  int getresuid(uid_t *, uid_t *, uid_t *);
277
272
  int getresgid(gid_t *, gid_t *, gid_t *);
278
- #endif
279
273
  #ifdef __wasilibc_unmodified_upstream /* WASI has no cwd */
280
274
  char *get_current_dir_name(void);
281
275
  #endif
Binary file
@@ -163,9 +163,7 @@ int isatty(int);
163
163
  pid_t tcgetpgrp(int);
164
164
  int tcsetpgrp(int, pid_t);
165
165
 
166
- #ifdef __wasilibc_unmodified_upstream /* WASI has no getuid etc. */
167
- int getgroups(int, gid_t []);
168
- #endif
166
+ int getgroups(int, gid_t []); /* homescoop wasix-sysroot -20 */
169
167
 
170
168
  uid_t getuid(void);
171
169
  uid_t geteuid(void);
@@ -195,10 +193,8 @@ size_t confstr(int, char *, size_t);
195
193
  #define F_LOCK 1
196
194
  #define F_TLOCK 2
197
195
  #define F_TEST 3
198
- #ifdef __wasilibc_unmodified_upstream /* WASI has no setreuid */
199
- int setreuid(uid_t, uid_t);
196
+ int setreuid(uid_t, uid_t); /* homescoop wasix-sysroot -20 */
200
197
  int setregid(gid_t, gid_t);
201
- #endif
202
198
  #ifdef __wasilibc_unmodified_upstream /* WASI has no POSIX file locking */
203
199
  int lockf(int, int, off_t);
204
200
  #endif
@@ -270,12 +266,10 @@ int getpagesize(void);
270
266
 
271
267
  #ifdef _GNU_SOURCE
272
268
  extern char **environ;
273
- #ifdef __wasilibc_unmodified_upstream /* WASI has no get/setresuid */
274
- int setresuid(uid_t, uid_t, uid_t);
269
+ int setresuid(uid_t, uid_t, uid_t); /* homescoop wasix-sysroot -20 */
275
270
  int setresgid(gid_t, gid_t, gid_t);
276
271
  int getresuid(uid_t *, uid_t *, uid_t *);
277
272
  int getresgid(gid_t *, gid_t *, gid_t *);
278
- #endif
279
273
  #ifdef __wasilibc_unmodified_upstream /* WASI has no cwd */
280
274
  char *get_current_dir_name(void);
281
275
  #endif
@@ -163,9 +163,7 @@ int isatty(int);
163
163
  pid_t tcgetpgrp(int);
164
164
  int tcsetpgrp(int, pid_t);
165
165
 
166
- #ifdef __wasilibc_unmodified_upstream /* WASI has no getuid etc. */
167
- int getgroups(int, gid_t []);
168
- #endif
166
+ int getgroups(int, gid_t []); /* homescoop wasix-sysroot -20 */
169
167
 
170
168
  uid_t getuid(void);
171
169
  uid_t geteuid(void);
@@ -195,10 +193,8 @@ size_t confstr(int, char *, size_t);
195
193
  #define F_LOCK 1
196
194
  #define F_TLOCK 2
197
195
  #define F_TEST 3
198
- #ifdef __wasilibc_unmodified_upstream /* WASI has no setreuid */
199
- int setreuid(uid_t, uid_t);
196
+ int setreuid(uid_t, uid_t); /* homescoop wasix-sysroot -20 */
200
197
  int setregid(gid_t, gid_t);
201
- #endif
202
198
  #ifdef __wasilibc_unmodified_upstream /* WASI has no POSIX file locking */
203
199
  int lockf(int, int, off_t);
204
200
  #endif
@@ -270,12 +266,10 @@ int getpagesize(void);
270
266
 
271
267
  #ifdef _GNU_SOURCE
272
268
  extern char **environ;
273
- #ifdef __wasilibc_unmodified_upstream /* WASI has no get/setresuid */
274
- int setresuid(uid_t, uid_t, uid_t);
269
+ int setresuid(uid_t, uid_t, uid_t); /* homescoop wasix-sysroot -20 */
275
270
  int setresgid(gid_t, gid_t, gid_t);
276
271
  int getresuid(uid_t *, uid_t *, uid_t *);
277
272
  int getresgid(gid_t *, gid_t *, gid_t *);
278
- #endif
279
273
  #ifdef __wasilibc_unmodified_upstream /* WASI has no cwd */
280
274
  char *get_current_dir_name(void);
281
275
  #endif
@@ -163,9 +163,7 @@ int isatty(int);
163
163
  pid_t tcgetpgrp(int);
164
164
  int tcsetpgrp(int, pid_t);
165
165
 
166
- #ifdef __wasilibc_unmodified_upstream /* WASI has no getuid etc. */
167
- int getgroups(int, gid_t []);
168
- #endif
166
+ int getgroups(int, gid_t []); /* homescoop wasix-sysroot -20 */
169
167
 
170
168
  uid_t getuid(void);
171
169
  uid_t geteuid(void);
@@ -195,10 +193,8 @@ size_t confstr(int, char *, size_t);
195
193
  #define F_LOCK 1
196
194
  #define F_TLOCK 2
197
195
  #define F_TEST 3
198
- #ifdef __wasilibc_unmodified_upstream /* WASI has no setreuid */
199
- int setreuid(uid_t, uid_t);
196
+ int setreuid(uid_t, uid_t); /* homescoop wasix-sysroot -20 */
200
197
  int setregid(gid_t, gid_t);
201
- #endif
202
198
  #ifdef __wasilibc_unmodified_upstream /* WASI has no POSIX file locking */
203
199
  int lockf(int, int, off_t);
204
200
  #endif
@@ -270,12 +266,10 @@ int getpagesize(void);
270
266
 
271
267
  #ifdef _GNU_SOURCE
272
268
  extern char **environ;
273
- #ifdef __wasilibc_unmodified_upstream /* WASI has no get/setresuid */
274
- int setresuid(uid_t, uid_t, uid_t);
269
+ int setresuid(uid_t, uid_t, uid_t); /* homescoop wasix-sysroot -20 */
275
270
  int setresgid(gid_t, gid_t, gid_t);
276
271
  int getresuid(uid_t *, uid_t *, uid_t *);
277
272
  int getresgid(gid_t *, gid_t *, gid_t *);
278
- #endif
279
273
  #ifdef __wasilibc_unmodified_upstream /* WASI has no cwd */
280
274
  char *get_current_dir_name(void);
281
275
  #endif