forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Base: Add man page for posix_openpt(3)
- Loading branch information
1 parent
d217d3f
commit d34ad44
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## Name | ||
|
||
posix\_openpt - open a pseudo-terminal device | ||
|
||
## Synopsis | ||
|
||
```**c++ | ||
#include <stdlib.h> | ||
#include <fcntl.h> | ||
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) |