1GETPT(3)                   Linux Programmer's Manual                  GETPT(3)
2
3
4

NAME

6       getpt - open the pseudoterminal master (PTM)
7

SYNOPSIS

9       #define _GNU_SOURCE             /* See feature_test_macros(7) */
10       #include <stdlib.h>
11
12       int getpt(void);
13

DESCRIPTION

15       getpt()  opens a pseudoterminal 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 pseudoterminal master is located elsewhere
21       on some systems that use GNU Libc.
22

RETURN VALUE

24       getpt()  returns  an  open  file descriptor upon successful completion.
25       Otherwise, it returns -1 and sets errno to indicate the error.
26

ERRORS

28       getpt() can fail with various errors described in open(2).
29

VERSIONS

31       getpt() is provided in glibc since version 2.1.
32

ATTRIBUTES

34       For  an  explanation  of  the  terms  used   in   this   section,   see
35       attributes(7).
36
37       ┌──────────┬───────────────┬─────────┐
38Interface Attribute     Value   
39       ├──────────┼───────────────┼─────────┤
40getpt()   │ Thread safety │ MT-Safe │
41       └──────────┴───────────────┴─────────┘

CONFORMING TO

43       getpt() is glibc-specific; use posix_openpt(3) instead.
44

SEE ALSO

46       grantpt(3), posix_openpt(3), ptsname(3), unlockpt(3), ptmx(4), pty(7)
47

COLOPHON

49       This  page  is  part of release 5.04 of the Linux man-pages project.  A
50       description of the project, information about reporting bugs,  and  the
51       latest     version     of     this    page,    can    be    found    at
52       https://www.kernel.org/doc/man-pages/.
53
54
55
56GNU                               2015-03-02                          GETPT(3)
Impressum