The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
pty.h
Go to the documentation of this file.
1#pragma once
2
3#include <sys/ioctl.h>
4#include <termios.h>
5
6/**
7 * @file pty.h
8 * @brief open a pseudo-terminal pair, and make one a process's terminal.
9 */
10
11/**
12 * open a new pseudo-terminal pair.
13 * @param master receives the master fd.
14 * @param slave receives the slave fd.
15 * @param name receives the slave's path, if not NULL (at least 16 bytes).
16 * @param settings the slave's termios, if not NULL.
17 * @param size the window size, if not NULL.
18 * @return 0, or -1 with errno set.
19 */
20int openpty(int *master, int *slave, char *name, const struct termios *settings,
21 const struct winsize *size);
22
23/**
24 * make fd the terminal of the calling process: start a new session, make
25 * fd its controlling terminal, put fd on stdin, stdout and stderr, and
26 * close fd. for the child of a terminal app, before execve.
27 * @return 0, or -1 with errno set.
28 */
29int login_tty(int fd);
device control requests.
int login_tty(int fd)
make fd the terminal of the calling process: start a new session, make fd its controlling terminal,...
int openpty(int *master, int *slave, char *name, const struct termios *settings, const struct winsize *size)
open a new pseudo-terminal pair.
terminal settings.
Definition termios.h:19
Definition ioctl.h:39