posix_openpt(3) Library Functions Manual posix_openpt(3) posix_openpt - - LIBRARY Standard C library (libc, -lc) #include #include int posix_openpt(int flags); glibc (. feature_test_macros(7)): posix_openpt(): _XOPEN_SOURCE >= 600 posix_openpt() - , , . flags (OR) : O_RDWR . , . O_NOCTTY . On success, posix_openpt() returns a file descriptor (a nonnegative integer) which is the lowest numbered unused file descriptor. On failure, -1 is returned, and errno is set to indicate the error. open(2). attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |posix_openpt() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ POSIX.1-2008. glibc 2.2.1. POSIX.1-2001. It is part of the UNIX 98 pseudoterminal support (see pts(4)). Some older UNIX implementations that support System V (aka UNIX 98) pseudoterminals don't have this function, but it can be easily implemented by opening the pseudoterminal multiplexor device: int posix_openpt(int flags) { return open("/dev/ptmx", flags); } posix_openpt() - . ptsname(3). . . open(2), getpt(3), grantpt(3), ptsname(3), unlockpt(3), pts(4), pty(7) Alexey, Azamat Hackimov , kogamatranslator49 , Kogan, Max Is , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . posix_openpt(3)