diff options
author | Dan McDonald <danmcd@joyent.com> | 2022-02-22 13:43:04 -0500 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2022-02-22 13:43:04 -0500 |
commit | f3389cfd79d6c15fb8cfc797398159f1c8b353b9 (patch) | |
tree | afd1c5450f8e23e6fc466e5fcf9f66fdb25a1092 /usr/src/man/man3c | |
parent | ebcd0fe2a47d2edd394ec05fe4e51389205135f7 (diff) | |
parent | ca783257c986cddcc674ae22916a6766b98a2d36 (diff) | |
download | illumos-joyent-f3389cfd79d6c15fb8cfc797398159f1c8b353b9.tar.gz |
[illumos-gate merge]
commit ca783257c986cddcc674ae22916a6766b98a2d36
5513 KM_NORMALPRI should be documented in kmem_alloc(9f) and kmem_cache_create(9f) man pages
14465 Present KM_NOSLEEP_LAZY as documented interface
commit 36589d6bb0cdae89e166b57b0d64ae56d53247d9
13500 Want support for overlay networks
commit 68df0c4f60a2e57680d6d1e6dba32ffa2d035538
14513 nvmeadm list-firmware
commit 8466ab889653be2119e4a8966b6bc4e2d5ee2fb6
14507 nvmeadm shouldn't allow writing firmware to a read-only slot 1
14508 improve nvmeadm firmware reporting
14509 nvmeadm commit-firmware error reporting isn't working as intended
commit 1fa2a66491e7d8ae0be84e7da4da8e812480c710
14249 pseudo-terminal nomenclature should reflect POSIX
Conflicts:
usr/src/cmd/cmd-inet/etc/services
usr/src/cmd/dladm/Makefile
usr/src/cmd/dladm/dladm.c
usr/src/cmd/varpd/Makefile
usr/src/cmd/varpd/varpd.c
usr/src/cmd/zoneadmd/zcons.c
usr/src/lib/Makefile
usr/src/lib/libdladm/Makefile
usr/src/lib/libdladm/common/libdladm.c
usr/src/lib/libdladm/common/libdladm.h
usr/src/lib/libdladm/common/libdladm_impl.h
usr/src/lib/libdladm/common/libdloverlay.c
usr/src/lib/libdladm/common/libdlvnic.c
usr/src/lib/varpd/Makefile
usr/src/lib/varpd/direct/Makefile.com
usr/src/lib/varpd/direct/amd64/Makefile
usr/src/lib/varpd/direct/common/libvarpd_direct.c
usr/src/lib/varpd/direct/i386/Makefile
usr/src/lib/varpd/files/Makefile
usr/src/lib/varpd/files/Makefile.com
usr/src/lib/varpd/files/amd64/Makefile
usr/src/lib/varpd/files/common/libvarpd_files.c
usr/src/lib/varpd/files/i386/Makefile
usr/src/lib/varpd/libvarpd/Makefile
usr/src/lib/varpd/libvarpd/Makefile.com
usr/src/lib/varpd/libvarpd/amd64/Makefile
usr/src/lib/varpd/libvarpd/common/libvarpd.c
usr/src/lib/varpd/libvarpd/common/libvarpd_arp.c
usr/src/lib/varpd/libvarpd/common/libvarpd_client.c
usr/src/lib/varpd/libvarpd/common/libvarpd_impl.h
usr/src/lib/varpd/libvarpd/common/libvarpd_overlay.c
usr/src/lib/varpd/libvarpd/common/libvarpd_panic.c
usr/src/lib/varpd/libvarpd/common/libvarpd_plugin.c
usr/src/lib/varpd/libvarpd/common/libvarpd_provider.h
usr/src/lib/varpd/libvarpd/common/libvarpd_util.c
usr/src/lib/varpd/libvarpd/i386/Makefile
usr/src/man/man1m/dladm.1m
usr/src/man/man5/overlay.5
usr/src/man/man7p/Makefile
usr/src/man/man7p/vxlan.7p
usr/src/uts/Makefile.uts
usr/src/uts/common/Makefile.files
usr/src/uts/common/io/overlay/overlay.c
usr/src/uts/common/io/overlay/overlay_mux.c
usr/src/uts/common/io/overlay/overlay_target.c
usr/src/uts/common/sys/dls_mgmt.h
usr/src/uts/common/sys/mac_provider.h
usr/src/uts/common/sys/overlay_common.h
usr/src/uts/common/sys/overlay_impl.h
usr/src/uts/common/sys/overlay_plugin.h
usr/src/uts/common/sys/overlay_target.h
Diffstat (limited to 'usr/src/man/man3c')
-rw-r--r-- | usr/src/man/man3c/grantpt.3c | 154 | ||||
-rw-r--r-- | usr/src/man/man3c/posix_openpt.3c | 286 | ||||
-rw-r--r-- | usr/src/man/man3c/ptsname.3c | 123 | ||||
-rw-r--r-- | usr/src/man/man3c/unlockpt.3c | 139 |
4 files changed, 338 insertions, 364 deletions
diff --git a/usr/src/man/man3c/grantpt.3c b/usr/src/man/man3c/grantpt.3c index 7e523af80b..154a5a07f5 100644 --- a/usr/src/man/man3c/grantpt.3c +++ b/usr/src/man/man3c/grantpt.3c @@ -43,88 +43,76 @@ .\" Copyright 1989 AT&T .\" Portions Copyright (c) 1994, X/Open Company Limited. All Rights Reserved. .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved. +.\" Copyright 2022 Oxide Computer Company .\" -.TH GRANTPT 3C "Aug 14, 2006" -.SH NAME -grantpt \- grant access to the slave pseudo-terminal device -.SH SYNOPSIS -.LP -.nf -#include <stdlib.h> - -\fBint\fR \fBgrantpt\fR(\fBint\fR \fIfildes\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -The \fBgrantpt()\fR function changes the mode and ownership of the slave -pseudo-terminal device associated with its master pseudo-terminal counterpart. -\fIfildes\fR is the file descriptor returned from a successful open of the -master pseudo-terminal device. The user ID of the slave is set to the real UID -of the calling process and the group ID is set to a reserved group. The -permission mode of the slave pseudo-terminal is set to readable and writable by -the owner and writable by the group. -.SH RETURN VALUES -.sp -.LP -Upon successful completion, \fBgrantpt()\fR returns \fB0\fR. Otherwise, it -returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error. -.SH ERRORS -.sp -.LP -The \fBgrantpt()\fR function may fail if: -.sp -.ne 2 -.na -\fB\fBEBADF\fR\fR -.ad -.RS 10n -The \fIfildes\fR argument is not a valid open file descriptor. -.RE - -.sp -.ne 2 -.na -\fB\fBEINVAL\fR\fR -.ad -.RS 10n -The \fIfildes\fR argument is not associated with a master pseudo-terminal +.Dd February 5, 2022 +.Dt GRANTPT 3C +.Os +.Sh NAME +.Nm grantpt +.Nd grant access to the subsidiary device of a pseudo-terminal +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fo grantpt +.Fa "int fildes" +.Fc +.Sh DESCRIPTION +The +.Fn grantpt +function changes the mode and ownership of the pseudo-terminal subsidiary +device associated with its pseudo-terminal manager counterpart. +.Pp +The +.Fa fildes +argument is the file descriptor returned from a successful +.Xr open 2 +of the pseudo-terminal manager device; e.g., by calling +.Xr posix_openpt 3C +or by performing an +.Xr open 2 +of the +.Xr ptm 7D device. -.RE - -.sp -.ne 2 -.na -\fB\fBEACCES\fR\fR -.ad -.RS 10n -The corresponding slave pseudo-terminal device could not be accessed. -.RE - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability Standard -_ -MT-Level Safe -.TE - -.SH SEE ALSO -.sp -.LP -\fBopen\fR(2), \fBptsname\fR(3C), \fBunlockpt\fR(3C), \fBattributes\fR(5), -\fBstandards\fR(5) -.sp -.LP -\fISTREAMS Programming Guide\fR +.Pp +The user ID owner of the subsidiary device is set to the real user ID of the +calling process. +The group ID owner is set to a reserved group. +.Pp +The permission mode of the subsidiary device is set to be readable and writable +by the owner, and writable by the group. +.Sh RETURN VALUES +.Rv -std grantpt +.Sh EXAMPLES +See +.Xr posix_openpt 3C +for an example that includes a call to +.Fn grantpt . +.Sh ERRORS +The +.Fn grantpt +function may fail if: +.Bl -tag -width Er +.It Er EBADF +The +.Fa fildes +argument is not a valid open file descriptor. +.It Er EINVAL +The +.Fa fildes +argument is not associated with a pseudo-terminal manager device. +.It Er EACCES +The corresponding pseudo-terminal subsidiary device could not be accessed. +.El +.Sh INTERFACE STABILITY +.Sy Committed +.Sh MT LEVEL +.Sy Safe +.Sh SEE ALSO +.Xr open 2 , +.Xr posix_openpt 3C , +.Xr ptsname 3C , +.Xr unlockpt 3C , +.Xr attributes 5 , +.Xr standards 5 , +.Xr ptm 7D diff --git a/usr/src/man/man3c/posix_openpt.3c b/usr/src/man/man3c/posix_openpt.3c index 16193b89f3..b009dd6e17 100644 --- a/usr/src/man/man3c/posix_openpt.3c +++ b/usr/src/man/man3c/posix_openpt.3c @@ -42,160 +42,142 @@ .\" .\" Copyright (c) 2001, The IEEE and The Open Group. All Rights Reserved. .\" Portions Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. +.\" Copyright 2022 Oxide Computer Company .\" -.TH POSIX_OPENPT 3C "June 18, 2021" -.SH NAME -posix_openpt \- open a pseudo terminal device -.SH SYNOPSIS -.nf -#include <stdlib.h> -#include <fcntl.h> - -\fBint\fR \fBposix_openpt\fR(\fBint\fR \fIoflag\fR); -.fi - -.SH DESCRIPTION -The \fBposix_openpt()\fR function establishes a connection between a master -device for a pseudo-terminal and a file descriptor. The file descriptor is used -by other I/O functions that refer to that pseudo-terminal. -.sp -.LP +.Dd February 5, 2022 +.Dt POSIX_OPENPT 3C +.Os +.Sh NAME +.Nm posix_openpt +.Nd open a pseudo-terminal manager device +.Sh SYNOPSIS +.In stdlib.h +.In fcntl.h +.Ft int +.Fo posix_openpt +.Fa "int oflag" +.Fc +.Sh DESCRIPTION +The +.Fn posix_openpt +function establishes a connection between a manager device for a +pseudo-terminal and a file descriptor. +The file descriptor is used by other I/O functions that refer to that +pseudo-terminal. +.Pp The file status flags and file access modes of the open file description are -set according to the value of \fIoflag\fR. -.sp -.LP -Values for \fIoflag\fR are constructed by a bitwise-inclusive OR of flags from -the following list, defined in <\fBfcntl.h\fR>. -.sp -.ne 2 -.na -\fB\fBO_RDWR\fR\fR -.ad -.RS 12n +set according to the value of +.Fa oflag . +.Pp +Values for +.Fa oflag +are constructed by a bitwise-inclusive OR of flags from +the following list, defined in +.Xr fcntl.h 3HEAD : +.Bl -tag -width Ds +.It Dv O_RDWR Open for reading and writing. -.RE - -.sp -.ne 2 -.na -\fB\fBO_NOCTTY\fR\fR -.ad -.RS 12n -If set, \fBposix_openpt()\fR does not cause the terminal device to become the -controlling terminal for the process. -.RE - -.sp -.LP -The behavior of other values for the \fIoflag\fR argument is unspecified. -.SH RETURN VALUES -Upon successful completion, the \fBposix_openpt()\fR function opens a master -pseudo-terminal device and returns a non-negative integer representing the -lowest numbered unused file descriptor. Otherwise, -1 is returned and -\fBerrno\fR is set to indicate the error. -.SH ERRORS -The \fBposix_openpt()\fR function will fail if: -.sp -.ne 2 -.na -\fB\fBEMFILE\fR\fR -.ad -.RS 10n -{\fBOPEN_MAX\fR} file descriptors are currently open in the calling process. -.RE - -.sp -.ne 2 -.na -\fB\fBENFILE\fR\fR -.ad -.RS 10n -The maximum allowable number of files is currently open in the system. -.RE - -.sp -.LP -The \fBposix_openpt()\fR function may fail if: -.sp -.ne 2 -.na -\fB\fBEINVAL\fR\fR -.ad -.RS 10n -The value of \fIoflag\fR is not valid. -.RE - -.sp -.ne 2 -.na -\fB\fBEAGAIN\fR\fR -.ad -.RS 10n -Out of pseudo-terminal resources. -.RE - -.sp -.ne 2 -.na -\fB\fBENOSR\fR\fR -.ad -.RS 10n -Out of STREAMS resources. -.RE - -.SH EXAMPLES -\fBExample 1 \fROpen a pseudo-terminal. -.sp -.LP -The following example opens a pseudo-terminal and returns the name of the slave -device and a file descriptor. - -.sp -.in +2 -.nf +.It Dv O_NOCTTY +If set, +.Fn posix_openpt +does not cause the terminal device to become the controlling terminal for the +process. +.El +.Pp +The behavior of other values for the +.Fa oflag +argument is unspecified. +.Sh RETURN VALUES +The +.Fn posix_getopt +function opens a manager pseudo-terminal device and, if successful, returns a +non-negative integer representing the lowest numbered unused file descriptor ; +otherwise, the value +.Sy -1 +is returned and the global variable +.Va errno +is set to indicate the error. +.Sh EXAMPLES +.Sy Example 1 +Open a pseudo-terminal. +.Pp +The following example opens a pseudo-terminal and returns the name of the +subsidiary device and a file descriptor. +.Bd -literal -offset Ds #include <fcntl.h> #include <stdio.h> - -int masterfd, slavefd; -char *slavedevice; - -masterfd = posix_openpt(O_RDWR|O_NOCTTY); - -if (masterfd == -1 - || grantpt (masterfd) == -1 - || unlockpt (masterfd) == -1 - || (slavedevice = ptsname (masterfd)) == NULL) - return -1; - -printf("slave device is: %s\en", slavedevice); - -slavefd = open(slave, O_RDWR|O_NOCTTY); -if (slavefd < 0) - return -1; -.fi -.in -2 - -.SH USAGE -This function provides a method for portably obtaining a file descriptor of a -master terminal device for a pseudo-terminal. The \fBgrantpt\fR(3C) and -\fBptsname\fR(3C) functions can be used to manipulate mode and ownership -permissions and to obtain the name of the slave device, respectively. -.SH ATTRIBUTES -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability Standard -_ -MT-Level MT-Safe -.TE - -.SH SEE ALSO -\fBopen\fR(2), \fBgrantpt\fR(3C), \fBptsname\fR(3C), \fBunlockpt\fR(3C), -\fBattributes\fR(5), \fBstandards\fR(5) +#include <err.h> + +int managerfd, subsidiaryfd; +char *subsidiarydevice; + +if ((managerfd = posix_openpt(O_RDWR|O_NOCTTY)) < 0) { + err(1, "opening pseudo-terminal manager"); +} + +if (grantpt(managerfd) != 0 || + unlockpt(managerfd) != 0 || + (subsidiarydevice = ptsname(managerfd)) == NULL) { + (void) close(managerfd); + err(1, "locating pseudo-terminal subsidiary"); +} + +printf("subsidiary device is: %s\en", subsidiarydevice); + +if ((subsidiaryfd = open(subsidiary, O_RDWR|O_NOCTTY)) < 0) { + err(1, "opening pseudo-terminal subsidiary"); +} +.Ed +.Sh ERRORS +The +.Fn posix_openpt +function will fail if: +.Bl -tag -width Er +.It Er EMFILE +.Brq Dv OPEN_MAX +file descriptors are currently open in the calling process. +.It Er ENFILE +The maximum allowable number of files is currently open in the system. +.El +.Pp +The +.Fn posix_openpt +function may fail if: +.Bl -tag -width Er +.It Er EINVAL +The value of +.Fa oflag +is not valid. +.It Er EAGAIN +The system has run out of pseudo-terminal resources. +.It Er ENOSR +The system has run out of STREAMS resources. +.El +.Sh USAGE +This function provides a portable method for obtaining the file descriptor of a +manager terminal device for a pseudo-terminal, as opposed to using +.Xr open 2 +on the +.Xr ptm 7D +device which is system-specific. +.Pp +The +.Xr grantpt 3C +function can be used to manipulate the mode and ownership permissions +of the subsidiary device. +The +.Xr ptsname 3C +function can be used to obtain the name of the subsidiary device. +.Sh INTERFACE STABILITY +.Sy Committed +.Sh MT LEVEL +.Sy MT-Safe +.Sh SEE ALSO +.Xr open 2 , +.Xr grantpt 3C , +.Xr ptsname 3C , +.Xr unlockpt 3C , +.Xr attributes 5 , +.Xr standards 5 , +.Xr ptm 7D , +.Xr pts 7D diff --git a/usr/src/man/man3c/ptsname.3c b/usr/src/man/man3c/ptsname.3c index 8fa25e2ea6..264a3dcc90 100644 --- a/usr/src/man/man3c/ptsname.3c +++ b/usr/src/man/man3c/ptsname.3c @@ -43,59 +43,72 @@ .\" Copyright 1989 AT&T .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved .\" Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved. +.\" Copyright 2022 Oxide Computer Company .\" -.TH PTSNAME 3C "Aug 14, 2002" -.SH NAME -ptsname \- get name of the slave pseudo-terminal device -.SH SYNOPSIS -.LP -.nf -#include <stdlib.h> - -\fBchar *\fR\fBptsname\fR(\fBint\fR \fIfildes\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -The \fBptsname()\fR function returns the name of the slave pseudo-terminal -device associated with a master pseudo-terminal device. \fIfildes\fR is a file -descriptor returned from a successful open of the master device. -\fBptsname()\fR returns a pointer to a string containing the null-terminated -path name of the slave device of the form \fB/dev/pts/N\fR, where \fBN\fR is a -non-negative integer. -.SH RETURN VALUES -.sp -.LP -Upon successful completion, the function \fBptsname()\fR returns a pointer to a -string which is the name of the pseudo-terminal slave device. This value points -to a static data area that is overwritten by each call to \fBptsname()\fR. Upon -failure, \fBptsname()\fR returns \fINULL\fR. This could occur if \fIfildes\fR -is an invalid file descriptor or if the slave device name does not exist in -the file system. -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability Standard -_ -MT-Level Safe -.TE - -.SH SEE ALSO -.sp -.LP -\fBopen\fR(2), \fBgrantpt\fR(3C), \fBttyname\fR(3C), \fBunlockpt\fR(3C), -\fBattributes\fR(5), \fBstandards\fR(5) -.sp -.LP -\fISTREAMS Programming Guide\fR +.Dd February 5, 2022 +.Dt PTSNAME 3C +.Os +.Sh NAME +.Nm ptsname +.Nd get the name of the subsidiary device of a pseudo-terminal +.Sh SYNOPSIS +.In stdlib.h +.Ft char * +.Fo ptsname +.Fa "int fildes" +.Fc +.Sh DESCRIPTION +The +.Fn ptsname +function returns the name of the pseudo-terminal subsidiary device associated +with a pseudo-terminal manager device. +The +.Fa fildes +argument is a file descriptor returned from a successful open of the +pseudo-terminal manager device; e.g., by calling +.Xr posix_openpt 3C +or by performing an +.Xr open 2 +of the +.Xr ptm 7D +device. +.Pp +The +.Fn ptsname +function returns a pointer to a string containing the null-terminated +path name of the subsidiary device. +This string is of the form +.Pa /dev/pts/N , +where +.Sy N +is a non-negative integer. +.Sh RETURN VALUES +If successful, the +.Fn ptsname +function returns a pointer to a string which is the name of the pseudo-terminal +subsidiary device. +This value points to a static data area that is overwritten by each call to +.Fn ptsname . +.Pp +Upon failure, +.Fn ptsname +returns +.Dv NULL . +This could occur if +.Fa fildes +is an invalid file descriptor or if the subsidiary device name does not exist +in the file system. +.Sh INTERFACE STABILITY +.Sy Committed +.Sh MT LEVEL +.Sy Safe +.Sh SEE ALSO +.Xr open 2 , +.Xr grantpt 3C , +.Xr posix_openpt 3C , +.Xr ttyname 3C , +.Xr unlockpt 3C , +.Xr attributes 5 , +.Xr standards 5 , +.Xr ptm 7D , +.Xr pts 7D diff --git a/usr/src/man/man3c/unlockpt.3c b/usr/src/man/man3c/unlockpt.3c index 598a56717d..865c217e32 100644 --- a/usr/src/man/man3c/unlockpt.3c +++ b/usr/src/man/man3c/unlockpt.3c @@ -43,78 +43,69 @@ .\" Copyright 1989 AT&T .\" Copyright (c) 1997, The Open Group. All Rights Reserved. .\" Portions Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved. +.\" Copyright 2022 Oxide Computer Company .\" -.TH UNLOCKPT 3C "Aug 14, 2002" -.SH NAME -unlockpt \- unlock a pseudo-terminal master/slave pair -.SH SYNOPSIS -.LP -.nf -#include <stdlib.h> - -\fBint\fR \fBunlockpt\fR(\fBint\fR \fIfildes\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -The \fBunlockpt()\fR function unlocks the slave pseudo-terminal device -associated with the master to which \fIfildes\fR refers. -.sp -.LP -Portable applications must call \fBunlockpt()\fR before opening the slave side -of a pseudo-terminal device. -.SH RETURN VALUES -.sp -.LP -Upon successful completion, \fBunlockpt()\fR returns \fB0\fR. Otherwise, it -returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error. -.SH ERRORS -.sp -.LP -The \fBunlockpt()\fR function may fail if: -.sp -.ne 2 -.na -\fB\fBEBADF\fR\fR -.ad -.RS 10n -The \fIfildes\fR argument is not a file descriptor open for writing. -.RE - -.sp -.ne 2 -.na -\fB\fBEINVAL\fR\fR -.ad -.RS 10n -The \fIfildes\fR argument is not associated with a master pseudo-terminal -device. -.RE - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability Standard -_ -MT-Level Safe -.TE - -.SH SEE ALSO -.sp -.LP -\fBopen\fR(2), \fBgrantpt\fR(3C), \fBptsname\fR(3C), \fBattributes\fR(5), -\fBstandards\fR(5) -.sp -.LP -\fISTREAMS Programming Guide\fR +.Dd February 5, 2022 +.Dt UNLOCKPT 3C +.Os +.Sh NAME +.Nm unlockpt +.Nd unlock a pseudo-terminal device pair +.Sh SYNOPSIS +.In stdlib.h +.Ft int +.Fo unlockpt +.Fa "int fildes" +.Fc +.Sh DESCRIPTION +When a pseudo-terminal manager device is opened, whether through +.Xr posix_openpt 3C +or +.Xr open 2 +on a +.Xr ptm 7D +device, the subsidiary device begins operation in a locked state. +The +.Fn unlockpt +function unlocks the pseudo-terminal subsidiary device associated with the +manager device to which +.Fa fildes +refers. +.Pp +Portable applications must call +.Fn unlockpt +before opening the pseudo-terminal subsidiary device. +.Sh RETURN VALUES +.Rv -std unlockpt +.Sh EXAMPLES +See +.Xr posix_openpt 3C +for an example that includes a call to +.Fn unlockpt . +.Sh ERRORS +The +.Fn unlockpt +function may fail if: +.Bl -tag -width Er +.It Er EBADF +The +.Fa fildes +argument is not a file descriptor open for writing. +.It Er EINVAL +EINVAL +The +.Fa fildes +argument is not associated with a pseudo-terminal manager device. +.El +.Sh INTERFACE STABILITY +.Sy Committed +.Sh MT LEVEL +.Sy Safe +.Sh SEE ALSO +.Xr open 2 , +.Xr grantpt 3C , +.Xr posix_openpt 3C , +.Xr ptsname 3C , +.Xr attributes 5 , +.Xr standards 5 , +.Xr ptm 7D |