8 int posix_openpt(int flags)
10 int r = open("/dev/ptmx", flags);
11 if (r < 0 && errno == ENOSPC) errno = EAGAIN;
23 return ioctl(fd, TIOCSPTLCK, &unlock);
26 int __ptsname_r(int fd, char *buf, size_t len)
30 if ((err = __syscall(SYS_ioctl, fd, TIOCGPTN, &pty))) return -err;
31 if (snprintf(buf, len, "/dev/pts/%d", pty) >= len) return ERANGE;
35 weak_alias(__ptsname_r, ptsname_r);