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
Use the -l c option to qcc to link against this library. This library is usually included automatically.
This function is in libc.a, but not in libc.so (in order to save space). |
The forkpty() function combines openpty(), fork(), and login_tty() to create a new process operating in a 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(), termios