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 );
- A pointer to a location where forkpty() can store the file descriptor of the master side of the pseudo-tty.
- NULL, or a pointer to a buffer where forkpty() can store the filename of the slave side of the pseudo-tty.
- NULL, or a pointer to a termios structure that describes the terminal's control attributes to apply to the slave side of the pseudo-tty.
- A pointer to a winsize structure that defines the window size to use for the slave side of the pseudo-tty.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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.