]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" This man page was written by Jeremy Phelps <jphelps@notreached.net>. |
2297bf0e | 2 | .\" |
a62be572 | 3 | .\" %%%LICENSE_START(FREELY_REDISTRIBUTABLE) |
fea681da | 4 | .\" Redistribute and modify at will. |
8ff7380d | 5 | .\" %%%LICENSE_END |
fea681da | 6 | .\" |
4c1c5274 | 7 | .TH getpt 3 (date) "Linux man-pages (unreleased)" |
fea681da | 8 | .SH NAME |
9ea5c15a | 9 | getpt \- open a new pseudoterminal master |
42009080 AC |
10 | .SH LIBRARY |
11 | Standard C library | |
12 | .RI ( libc ", " \-lc ) | |
fea681da MK |
13 | .SH SYNOPSIS |
14 | .nf | |
86b91fdf | 15 | .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" |
fea681da | 16 | .B #include <stdlib.h> |
68e4db0a | 17 | .PP |
5ed9e72d | 18 | .B "int getpt(void);" |
fea681da MK |
19 | .fi |
20 | .SH DESCRIPTION | |
63aa9df0 | 21 | .BR getpt () |
9ea5c15a MK |
22 | opens a new pseudoterminal device and returns a file descriptor |
23 | that refers to that device. | |
fac73de4 | 24 | It is equivalent to opening the pseudoterminal multiplexor device |
207050fa MK |
25 | .PP |
26 | .in +4n | |
27 | .EX | |
378e5745 | 28 | open("/dev/ptmx", O_RDWR); |
207050fa MK |
29 | .EE |
30 | .in | |
31 | .PP | |
fac73de4 | 32 | on Linux systems, though the pseudoterminal multiplexor device is located |
9ea5c15a | 33 | elsewhere on some systems that use the GNU C library. |
47297adb | 34 | .SH RETURN VALUE |
63aa9df0 | 35 | .BR getpt () |
c13182ef MK |
36 | returns an open file descriptor upon successful completion. |
37 | Otherwise, it | |
8729177b | 38 | returns \-1 and sets |
fea681da MK |
39 | .I errno |
40 | to indicate the error. | |
7e563680 MK |
41 | .SH ERRORS |
42 | .BR getpt () | |
43 | can fail with various errors described in | |
44 | .BR open (2). | |
c343e74c MK |
45 | .SH VERSIONS |
46 | .BR getpt () | |
47 | is provided in glibc since version 2.1. | |
3c768224 | 48 | .SH ATTRIBUTES |
f1ea82e1 MK |
49 | For an explanation of the terms used in this section, see |
50 | .BR attributes (7). | |
c466875e MK |
51 | .ad l |
52 | .nh | |
f1ea82e1 MK |
53 | .TS |
54 | allbox; | |
c466875e | 55 | lbx lb lb |
f1ea82e1 MK |
56 | l l l. |
57 | Interface Attribute Value | |
58 | T{ | |
3c768224 | 59 | .BR getpt () |
f1ea82e1 MK |
60 | T} Thread safety MT-Safe |
61 | .TE | |
c466875e MK |
62 | .hy |
63 | .ad | |
64 | .sp 1 | |
3113c7f3 | 65 | .SH STANDARDS |
63aa9df0 | 66 | .BR getpt () |
f5f6fdda MK |
67 | is glibc-specific; |
68 | use | |
69 | .BR posix_openpt (3) | |
70 | instead. | |
47297adb | 71 | .SH SEE ALSO |
fea681da | 72 | .BR grantpt (3), |
a856c2ea | 73 | .BR posix_openpt (3), |
f0c34053 | 74 | .BR ptsname (3), |
fea681da | 75 | .BR unlockpt (3), |
88ab292b MK |
76 | .BR ptmx (4), |
77 | .BR pty (7) |