[Previous]
[Contents]
[Next]

tcsetct()

make a terminal device a controlling terminal

Synopsis:

#include <sys/types.h>
#include <unistd.h>
int tcsetct( int fd, pid_t pid );

Description:

The tcsetct() function makes the terminal device associated with fd a controlling terminal that's associated with the process pid.

If successful, this call will cause subsequent hangup conditions on the indicated terminal device to generate a SIGHUP signal on the given process.

Returns:

0
Success
-1
An error occurred. errno is set to indicate the error.

Errors:

EBADF
The argument fd is invalid.
EINVAL
The argument pid is invalid.
ENOTTY
The argument fd isn't associated with a terminal device.

Examples:

#include <sys/types.h>
#include <unistd.h>

void main()
  {
    /*
     * Direct hangups on stdin to me
     */
    tcsetct( 0, getpid() );
  }

Classification:

QNX

Safety:
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

errno, signal(), tcsetpgrp()


[Previous]
[Contents]
[Next]