posix_openpt(3) Library Functions Manual posix_openpt(3) posix_openpt - - C (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 multiplexer 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 , Darima Kogan , Max Is , Yuri Kozlov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () . Linux man-pages 6.18 8 2026 . posix_openpt(3)