OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / original / man3 / getpt.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\" This man page was written by Jeremy Phelps <jphelps@notreached.net>.
3 .\" Redistribute and modify at will.
4 .\"
5 .TH GETPT 3 2008-06-14 "GNU" "Linux Programmer's Manual"
6 .SH NAME
7 getpt \- open the pseudo-terminal master (PTM)
8 .SH SYNOPSIS
9 .nf
10 .B #define _GNU_SOURCE
11 .B #include <stdlib.h>
12 .sp
13 .B "int getpt(void);"
14 .fi
15 .SH DESCRIPTION
16 .BR getpt ()
17 opens a pseudo-terminal master and returns its file descriptor.
18 It is equivalent to
19 .nf
20
21     open(/dev/ptmx, O_RDWR | O_NOCTTY);
22
23 .fi
24 on Linux systems, though the pseudo-terminal master is located
25 elsewhere on some systems that use GNU Libc.
26 .SH "RETURN VALUE"
27 .BR getpt ()
28 returns an open file descriptor upon successful completion.
29 Otherwise, it
30 returns \-1 and sets
31 .I errno
32 to indicate the error.
33 .SH ERRORS
34 .BR getpt ()
35 can fail with various errors described in
36 .BR open (2).
37 .SH VERSIONS
38 .BR getpt ()
39 is provided in glibc since version 2.1.
40 .SH CONFORMING TO
41 .BR getpt ()
42 is glibc-specific;
43 use
44 .BR posix_openpt (3)
45 instead.
46 .SH "SEE ALSO"
47 .BR grantpt (3),
48 .BR posix_openpt (3),
49 .BR ptsname (3),
50 .BR unlockpt (3),
51 .BR ptmx (4),
52 .BR pty (7)