aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/sysdeps/ironclad/generic/pty.cpp
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:52 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 18:24:51 -0500
commitf5e48e94a2f4d4bbd6e5628c7f2afafc6dbcc459 (patch)
tree93b156621dc0303816b37f60ba88051b702d92f6 /lib/mlibc/sysdeps/ironclad/generic/pty.cpp
parentbd5969fc876a10b18613302db7087ef3c40f18e1 (diff)
build: Build mlibc + add distclean target
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/sysdeps/ironclad/generic/pty.cpp')
-rw-r--r--lib/mlibc/sysdeps/ironclad/generic/pty.cpp41
1 files changed, 0 insertions, 41 deletions
diff --git a/lib/mlibc/sysdeps/ironclad/generic/pty.cpp b/lib/mlibc/sysdeps/ironclad/generic/pty.cpp
deleted file mode 100644
index 1626e4b..0000000
--- a/lib/mlibc/sysdeps/ironclad/generic/pty.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <asm/ioctls.h>
-#include <bits/ensure.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <pty.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/syscall.h>
-#include <sys/ioctl.h>
-
-int openpty(int *mfd, int *sfd, char *name, const struct termios *ios, const struct winsize *win) {
- int ret;
- int fds[2];
- SYSCALL1(SYSCALL_OPENPTY, fds);
- if (errno) {
- return -1;
- }
- *mfd = fds[0];
- *sfd = fds[1];
-
- if (name != NULL) {
- ret = ttyname_r(*mfd, name, (size_t)-1);
- if (ret) {
- return -1;
- }
- }
- if (ios != NULL) {
- ret = tcsetattr(*mfd, TCSANOW, ios);
- if (ret) {
- return -1;
- }
- }
- if (win != NULL) {
- ret = ioctl(*mfd, TIOCGWINSZ, win);
- if (ret) {
- return -1;
- }
- }
- return ret;
-}