-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Issue
Currently, we stub the openat syscall with SYSCALL_CANCEL which is causing grep to fail as it uses openat with AT_FDCWD flag.
lind-wasm/src/glibc/sysdeps/unix/sysv/linux/openat.c
Lines 30 to 41 in a91b430
| __libc_openat (int fd, const char *file, int oflag, ...) | |
| { | |
| mode_t mode = 0; | |
| if (__OPEN_NEEDS_MODE (oflag)) | |
| { | |
| va_list arg; | |
| va_start (arg, oflag); | |
| mode = va_arg (arg, mode_t); | |
| va_end (arg); | |
| } | |
| return SYSCALL_CANCEL (openat, fd, file, oflag, mode); |
Proposed fix:
I already tested grep successfully by adding
if (fd == AT_FDCWD)
return __libc_openat (file, oflag, mode);
to
- src/glibc/sysdeps/unix/sysv/linux/openat.c
- src/glibc/sysdeps/unix/sysv/linux/openat64.c
- src/glibc/sysdeps/unix/sysv/linux/openat_nocancel.c
- src/glibc/sysdeps/unix/sysv/linux/openat64_nocancel.c
@rennergade and @Yaxuan-w wanted your advice on whether this is the right approach to fix this problem or should we implement openat syscall at RawPOSIX level?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels