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 2015-03-02 "GNU" "Linux Programmer's Manual"
9 getpt \- open the pseudoterminal master (PTM)
12 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
13 .B #include <stdlib.h>
19 opens a pseudoterminal master and returns its file descriptor.
24 open(/dev/ptmx, O_RDWR | O_NOCTTY);
28 on Linux systems, though the pseudoterminal master is located
29 elsewhere on some systems that use GNU Libc.
32 returns an open file descriptor upon successful completion.
36 to indicate the error.
39 can fail with various errors described in
43 is provided in glibc since version 2.1.
45 For an explanation of the terms used in this section, see
51 Interface Attribute Value
54 T} Thread safety MT-Safe