posix_openpt - Online Linux Manual PageSection : 3
Updated : 2023-02-05
Source : Linux man-pages 6.03
NAMEposix_openpt − open a pseudoterminal device
LIBRARYStandard C library (libc, −lc)
SYNOPSIS#include <stdlib.h>
#include <fcntl.h>int posix_openpt(int flags);Feature Test Macro Requirements for glibc (see feature_test_macros(7)): posix_openpt(): _XOPEN_SOURCE >= 600
DESCRIPTIONThe posix_openpt() function opens an unused pseudoterminal master device, returning a file descriptor that can be used to refer to that device. The flags argument is a bit mask that ORs together zero or more of the following flags: O_RDWR Open the device for both reading and writing. It is usual to specify this flag. O_NOCTTY Do not make this device the controlling terminal for the process.
RETURN VALUEOn success, posix_openpt() returns a file descriptor (a nonnegative integer) which is the lowest numbered unused file descriptor. On failure, −1 is returned, and errno is set to indicate the error.
ERRORSSee open(2).
VERSIONSglibc support for posix_openpt() has been provided since glibc 2.2.1.
ATTRIBUTESFor an explanation of the terms used in this section, see attributes(7). InterfaceAttributeValue posix_openpt() Thread safetyMT-Safe
STANDARDSPOSIX.1-2001, POSIX.1-2008. posix_openpt() is part of the UNIX 98 pseudoterminal support (see pts(4)).
NOTESSome older UNIX implementations that support System V (aka UNIX 98) pseudoterminals don't have this function, but it can be easily implemented by opening the pseudoterminal multiplexor device: int
posix_openpt(int flags)
{
return open("/dev/ptmx", flags);
}Calling posix_openpt() creates a pathname for the corresponding pseudoterminal slave device. The pathname of the slave device can be obtained using ptsname(3). The slave device pathname exists only as long as the master device is open.
SEE ALSOopen(2), getpt(3), grantpt(3), ptsname(3), unlockpt(3), pts(4), pty(7) 0
Johanes Gumabo
Data Size : 10,404 byte
man-posix_openpt.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 181,518
Visitor ID : :
Visitor IP : 3.137.221.252 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.