1GETPT(3) Linux Programmer's Manual GETPT(3)
2
3
4
6 getpt - open the pseudo-terminal master (PTM)
7
9 #define _GNU_SOURCE
10 #include <stdlib.h>
11
12 int getpt(void);
13
15 getpt() opens a pseudo-terminal master and returns its file descriptor.
16 It is equivalent to
17
18 open(/dev/ptmx, O_RDWR | O_NOCTTY);
19
20 on Linux systems, though the pseudo-terminal master is located else‐
21 where on some systems that use GNU Libc.
22
24 getpt() returns an open file descriptor upon successful completion.
25 Otherwise, it returns -1 and sets errno to indicate the error.
26
28 getpt() can fail with various errors described in open(2).
29
31 getpt() is provided in glibc since version 2.1.
32
34 getpt() is glibc-specific; use posix_openpt(3) instead.
35
37 grantpt(3), posix_openpt(3), ptsname(3), unlockpt(3), ptmx(4), pty(7)
38
40 This page is part of release 3.22 of the Linux man-pages project. A
41 description of the project, and information about reporting bugs, can
42 be found at http://www.kernel.org/doc/man-pages/.
43
44
45
46GNU 2008-06-14 GETPT(3)