1 .\" This man page was written by Jeremy Phelps <jphelps@notreached.net>.
3 .\" %%%LICENSE_START(FREELY_REDISTRIBUTABLE)
4 .\" Redistribute and modify at will.
7 .TH GETPT 3 2021-03-22 "Linux man-pages (unreleased)"
9 getpt \- open a new pseudoterminal master
12 .RI ( libc ", " \-lc )
15 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
16 .B #include <stdlib.h>
22 opens a new pseudoterminal device and returns a file descriptor
23 that refers to that device.
24 It is equivalent to opening the pseudoterminal multiplexor device
28 open("/dev/ptmx", O_RDWR);
32 on Linux systems, though the pseudoterminal multiplexor device is located
33 elsewhere on some systems that use the GNU C library.
36 returns an open file descriptor upon successful completion.
40 to indicate the error.
43 can fail with various errors described in
47 is provided in glibc since version 2.1.
49 For an explanation of the terms used in this section, see
57 Interface Attribute Value
60 T} Thread safety MT-Safe