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.
5 .TH GETPT 3 2008-06-14 "GNU" "Linux Programmer's Manual"
7 getpt \- open the pseudo-terminal master (PTM)
10 .B #define _GNU_SOURCE
11 .B #include <stdlib.h>
17 opens a pseudo-terminal master and returns its file descriptor.
21 open(/dev/ptmx, O_RDWR | O_NOCTTY);
24 on Linux systems, though the pseudo-terminal master is located
25 elsewhere on some systems that use GNU Libc.
28 returns an open file descriptor upon successful completion.
32 to indicate the error.
35 can fail with various errors described in
39 is provided in glibc since version 2.1.