mlibc: implement sys_unlockpt

This commit is contained in:
Matheus
2025-12-25 20:21:08 -03:00
parent 50f934894d
commit 4a0151f6cb
+17
View File
@@ -68,3 +68,20 @@ index 1ed110d..ded9114 100644
- }
+void backtrace_symbols_fd(void *const *, int, int) {
}
diff --git mlibc-clean/sysdeps/astral/generic/generic.cpp mlibc-workdir/sysdeps/astral/generic/generic.cpp
index 939925e..5ee7fad 100644
--- mlibc-clean/sysdeps/astral/generic/generic.cpp
+++ mlibc-workdir/sysdeps/astral/generic/generic.cpp
@@ -47,6 +47,12 @@ namespace mlibc {
return 0;
}
+ int sys_unlockpt(int fd) {
+ int r;
+ // unlockpt is a no-op kernel side, so use this to check for an invalid pty
+ return sys_ioctl(fd, 0x13376167, NULL, &r);
+ }
+
int sys_readv(int fd, const struct iovec *iovs, int iovc, ssize_t *bytes_read) {
long r;
int error = syscall(SYSCALL_READV, &r, fd, (uint64_t)iovs, iovc);