Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

tcsetpgrp - set foreground process group ID

&pagelevel(4)&pagelevel

Syntax

#include <unistd.h>

Optional
#include <sys/types.h> (End)

int tcsetpgrp(int fildes, pid_t pgid_id); 

Description

If the process has a controlling terminal, tcsetpgrp() will set the foreground process group ID associated with the terminal to the value pgid_id. The file of the terminal specified by fildes must be the controlling terminal of the calling process, and the controlling terminal must be currently associated with the session of the calling process. The value of pgid_id must match a process group ID of a process in the same session as the calling process.

Return val.

0

-1

if successful.

if an error occurs. errno is set to indicate the error.

Errors

tcsetpgrp() will fail if:

 

EBADF

fildes is not a valid file descriptor.

 

EINVAL

pgid_id is not a valid process group ID.

 

Extension

 

EINVAL

An attempt was made to access a BS2000 file. (End)

 

ENOTTY

The calling process does not have a controlling terminal, or the controlling terminal is no longer associated with the session of the calling process.

 

EPERM

The value of pgid_id does not match the process group ID of a process in the same session as the calling process. 

See also

tcgetpgrp(), sys/types.h, unistd.h.