]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getpt.3
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man3 / getpt.3
CommitLineData
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 9getpt \- open a new pseudoterminal master
42009080
AC
10.SH LIBRARY
11Standard 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
22opens a new pseudoterminal device and returns a file descriptor
23that refers to that device.
fac73de4 24It is equivalent to opening the pseudoterminal multiplexor device
207050fa
MK
25.PP
26.in +4n
27.EX
378e5745 28open("/dev/ptmx", O_RDWR);
207050fa
MK
29.EE
30.in
31.PP
fac73de4 32on Linux systems, though the pseudoterminal multiplexor device is located
9ea5c15a 33elsewhere on some systems that use the GNU C library.
47297adb 34.SH RETURN VALUE
63aa9df0 35.BR getpt ()
c13182ef
MK
36returns an open file descriptor upon successful completion.
37Otherwise, it
8729177b 38returns \-1 and sets
fea681da
MK
39.I errno
40to indicate the error.
7e563680
MK
41.SH ERRORS
42.BR getpt ()
43can fail with various errors described in
44.BR open (2).
c343e74c
MK
45.SH VERSIONS
46.BR getpt ()
47is provided in glibc since version 2.1.
3c768224 48.SH ATTRIBUTES
f1ea82e1
MK
49For 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
54allbox;
c466875e 55lbx lb lb
f1ea82e1
MK
56l l l.
57Interface Attribute Value
58T{
3c768224 59.BR getpt ()
f1ea82e1
MK
60T} 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
67is glibc-specific;
68use
69.BR posix_openpt (3)
70instead.
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)