From d34ad44f90fbfc9f4166d8326994aa86458a18d5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 7 Feb 2020 22:37:27 +0100 Subject: [PATCH] Base: Add man page for posix_openpt(3) --- Base/usr/share/man/man3/posix_openpt.md | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Base/usr/share/man/man3/posix_openpt.md diff --git a/Base/usr/share/man/man3/posix_openpt.md b/Base/usr/share/man/man3/posix_openpt.md new file mode 100644 index 0000000000..66795aa262 --- /dev/null +++ b/Base/usr/share/man/man3/posix_openpt.md @@ -0,0 +1,34 @@ +## Name + +posix\_openpt - open a pseudo-terminal device + +## Synopsis + +```**c++ +#include +#include + +int posix_openpt(int flags); +``` + +## Description + +Open a pseudo-terminal master using the given *flags*. + +The *flags* argument accepts a bitmask of the following flags: + +* `O_RDWR`: Open for both reading and writing. +* `O_NOCTTY`: The opened pseudo-terminal will not be made the controlling TTY for the process. +* `O_CLOEXEC`: The opened fd shall be closed on [`exec`(2)](../man2/exec.md). + +## Return value + +On success, a pseudo-terminal device is allocated and `posix_openpt()` returns a file descriptor for it. Otherwise, it returns -1 and sets `errno` to describe the error. + +## Errors + +Returns the same errors as [`open`(2)](../man2/open.md). + +## See also + +* [`open`(2)](../man2/open.md)