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 "GNU" "Linux Programmer's Manual"
9 getpt \- open a new pseudoterminal master
12 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
13 .B #include <stdlib.h>
19 opens a new pseudoterminal device and returns a file descriptor
20 that refers to that device.
21 It is equivalent to opening the pseudoterminal multiplexor device
25 open("/dev/ptmx", O_RDWR);
29 on Linux systems, though the pseudoterminal multiplexor device is located
30 elsewhere on some systems that use the GNU C library.
33 returns an open file descriptor upon successful completion.
37 to indicate the error.
40 can fail with various errors described in
44 is provided in glibc since version 2.1.
46 For an explanation of the terms used in this section, see
54 Interface Attribute Value
57 T} Thread safety MT-Safe