openpty forkpty - auxiliary functions to obtain a pseudo-terminal
Lb libutil
If the argument
Fa name
is not
NULL
openpty ();
copies the pathname of the slave pty to this area.
The caller is
responsible for allocating the required space in this array.
If the arguments
Fa termp
or
Fa winp
are not
NULL
openpty ();
initializes the termios and window size settings from the structures
these arguments point to, respectively.
Upon return, the open file descriptors for the master and slave side of the pty are returned in the locations pointed to by Fa amaster and Fa aslave , respectively.
The
forkpty ();
function first calls
openpty ();
to obtain the next available pseudo-terminal from the system.
Upon success,
it forks off a new process.
In the child process, it closes the descriptor
for the master side of the pty, and calls
login_tty3
for the slave pty.
In the parent process, it closes the descriptor for the
slave side of the pty.
The arguments
Fa amaster ,
Fa name ,
Fa termp ,
and
Fa winp
have the same meaning as described for
openpty (.);
The
forkpty ();
function returns -1 on failure, 0 in the slave process, and the process ID of
the slave process in the parent process.
In addition to this,
forkpty ();
may set it to any value as described for
fork(2).
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |