1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (C) 2004 Michael Kerrisk
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH POSIX_OPENPT 3 "2007-01-08" "PTY Control" "Linux Programmer's Manual"
27 posix_openpt \- open a pseudo-terminal device
30 .B #define _XOPEN_SOURCE 600
32 .B #include <stdlib.h>
35 .BI "int posix_openpt(int " flags ");"
40 function opens an unused pseudo-terminal master device, returning a
41 file descriptor that can be used to refer to that device.
45 argument is a bit mask that ORs together zero or more of
49 Open the device for both reading and writing.
50 It is usual to specify this flag.
53 Do not make this device the controlling terminal for the process.
57 returns a non-negative file descriptor which is the lowest
58 numbered unused descriptor.
59 On failure, \-1 is returned, and
61 is set to indicate the error.
67 is part of the Unix98 pseudo-terminal support (see
69 This function is specified in POSIX.1-2001.
71 This function is a recent invention in POSIX.
72 Some Unix implementations that support System V
73 (aka Unix 98) pseudo-terminals don't have this function, but it
79 posix_openpt(int flags)
81 return open("/dev/ptmx", flags);
92 .BR feature_test_macros (7),