forkpty()

Create a new process operating in a pseudo-tty

Synopsis:

#include <unix.h>

pid_t forkpty( int *amaster,
               char *name,
               struct termios *termp,
               struct winsize *winp );

Since:

BlackBerry 10.0.0

Arguments:

amaster
A pointer to a location where forkpty() can store the file descriptor of the master side of the pseudo-tty.
name
NULL, or a pointer to a buffer where forkpty() can store the filename of the slave side of the pseudo-tty.
termp
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.
winp
A pointer to a winsize structure that defines the window size to use for the slave side of the pseudo-tty.

Library:

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).

Description:

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.

Returns:

0 to the child process, the child's process ID to the parent, or -1 if an error occurred.

Classification:

Unix

Safety:  
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus