2004-11-03 13:51:07 +00:00
|
|
|
.\" Hey Emacs! This file is -*- nroff -*- source.
|
|
|
|
.\" This man page was written by Jeremy Phelps <jphelps@notreached.net>.
|
|
|
|
.\" Redistribute and modify at will.
|
|
|
|
.\"
|
accept.2, clone.2, dup.2, fallocate.2, pipe.2, readahead.2, sched_setaffinity.2, unshare.2, CPU_SET.3, endian.3, euidaccess.3, fexecve.3, getpt.3, getpw.3, getumask.3, getutmp.3, gnu_get_libc_version.3, makedev.3, matherr.3, mbsnrtowcs.3, memfrob.3, pthread_attr_setaffinity_np.3, pthread_getattr_np.3, pthread_setaffinity_np.3, pthread_tryjoin_np.3, tcgetsid.3, wcscasecmp.3, wcsncasecmp.3, wcsnlen.3, wcsnrtombs.3, wcswidth.3, rtld-audit.7: SYNOPSIS: Add reference to feature_test_macros(7)
These pages specify feature test macros in the function
prototypes. Add a reference to feature_test_macros(7),
so that readers are pointed to the information that
feature test macros must be defined before including
*any* header file.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-09-10 05:06:22 +00:00
|
|
|
.TH GETPT 3 2010-09-10 "GNU" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
open.2, poll.2, select_tut.2, getpt.3, grantpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: Global fix: s/pseudo-terminal/pseudoterminal/
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-12 04:51:51 +00:00
|
|
|
getpt \- open the psuedoterminal master (PTM)
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
accept.2, clone.2, dup.2, fallocate.2, pipe.2, readahead.2, sched_setaffinity.2, unshare.2, CPU_SET.3, endian.3, euidaccess.3, fexecve.3, getpt.3, getpw.3, getumask.3, getutmp.3, gnu_get_libc_version.3, makedev.3, matherr.3, mbsnrtowcs.3, memfrob.3, pthread_attr_setaffinity_np.3, pthread_getattr_np.3, pthread_setaffinity_np.3, pthread_tryjoin_np.3, tcgetsid.3, wcscasecmp.3, wcsncasecmp.3, wcsnlen.3, wcsnrtombs.3, wcswidth.3, rtld-audit.7: SYNOPSIS: Add reference to feature_test_macros(7)
These pages specify feature test macros in the function
prototypes. Add a reference to feature_test_macros(7),
so that readers are pointed to the information that
feature test macros must be defined before including
*any* header file.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-09-10 05:06:22 +00:00
|
|
|
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
|
2004-11-03 13:51:07 +00:00
|
|
|
.B #include <stdlib.h>
|
|
|
|
.sp
|
2007-07-07 19:06:59 +00:00
|
|
|
.B "int getpt(void);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR getpt ()
|
open.2, poll.2, select_tut.2, getpt.3, grantpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: Global fix: s/pseudo-terminal/pseudoterminal/
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-12 04:51:51 +00:00
|
|
|
opens a psuedoterminal master and returns its file descriptor.
|
2004-11-03 13:51:07 +00:00
|
|
|
It is equivalent to
|
2007-12-22 22:47:15 +00:00
|
|
|
.nf
|
|
|
|
|
|
|
|
open(/dev/ptmx, O_RDWR | O_NOCTTY);
|
|
|
|
|
|
|
|
.fi
|
open.2, poll.2, select_tut.2, getpt.3, grantpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: Global fix: s/pseudo-terminal/pseudoterminal/
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-12 04:51:51 +00:00
|
|
|
on Linux systems, though the psuedoterminal master is located
|
2004-11-03 13:51:07 +00:00
|
|
|
elsewhere on some systems that use GNU Libc.
|
|
|
|
.SH "RETURN VALUE"
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR getpt ()
|
2007-04-12 22:42:49 +00:00
|
|
|
returns an open file descriptor upon successful completion.
|
|
|
|
Otherwise, it
|
2005-06-15 14:10:23 +00:00
|
|
|
returns \-1 and sets
|
2004-11-03 13:51:07 +00:00
|
|
|
.I errno
|
|
|
|
to indicate the error.
|
2008-06-03 09:31:29 +00:00
|
|
|
.SH ERRORS
|
|
|
|
.BR getpt ()
|
|
|
|
can fail with various errors described in
|
|
|
|
.BR open (2).
|
2008-06-11 13:43:34 +00:00
|
|
|
.SH VERSIONS
|
|
|
|
.BR getpt ()
|
|
|
|
is provided in glibc since version 2.1.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH CONFORMING TO
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR getpt ()
|
2008-04-26 21:15:52 +00:00
|
|
|
is glibc-specific;
|
|
|
|
use
|
|
|
|
.BR posix_openpt (3)
|
|
|
|
instead.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR grantpt (3),
|
2004-12-17 12:46:00 +00:00
|
|
|
.BR posix_openpt (3),
|
2008-07-14 15:52:21 +00:00
|
|
|
.BR ptsname (3),
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR unlockpt (3),
|
2005-10-10 13:14:12 +00:00
|
|
|
.BR ptmx (4),
|
|
|
|
.BR pty (7)
|