![]() |
![]() |
![]() |
Create a new process operating in a pseudo-tty
#include <unix.h> pid_t forkpty( int *amaster, char *name, struct termios *termp, struct winsize *winp );
libc
The forkpty() function combines openpty(), fork(), and login_tty() to create a new process operating in a pseudo-tty. The file descriptor of the master side of the pseudo-tty is returned in amaster, and the filename of the slave in name if it isn't NULL. The termp and winp parameters, if non-NULL, determine the terminal attributes and window size of the slave side of the pseudo-tty.
This function fails if either openpty() or fork() fails.
0 to the child process, the child's process ID to the parent, or -1 if an error occurred.
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
fork(), login_tty(), openpty()
![]() |
![]() |
![]() |