1tcsetpgrp(3C)            Standard C Library Functions            tcsetpgrp(3C)
2
3
4

NAME

6       tcsetpgrp - set foreground process group ID
7

SYNOPSIS

9       #include <sys/types.h>
10       #include <unistd.h>
11
12       int tcsetpgrp(int fildes, pid_t pgid_id);
13
14

DESCRIPTION

16       If  the  process  has  a controlling terminal, tcsetpgrp() will set the
17       foreground process group ID associated with the  terminal  to  pgid_id.
18       The file associated with fildes must be the controlling terminal of the
19       calling process and the controlling terminal must be currently  associ‐
20       ated with the session of the calling process. The value of pgid_id must
21       match a process group ID of a process in the same session as the  call‐
22       ing process.
23

RETURN VALUES

25       Upon  successful  completion,  0 is returned. Otherwise, −1 is returned
26       and errno is set to indicate the error.
27

ERRORS

29       The tcsetpgrp() function will fail if:
30
31       EBADF     The fildes argument is not a valid file descriptor.
32
33
34       EINVAL    This implementation does not support the value in the pgid_id
35                 argument.
36
37
38       ENOTTY    The  calling process does not have a controlling terminal, or
39                 the file is not the controlling terminal, or the  controlling
40                 terminal  is  no  longer  associated  with the session of the
41                 calling process.
42
43
44       EIO       The process is not ignoring or holding SIGTTOU and is a  mem‐
45                 ber of an orphaned process group.
46
47
48       EPERM     The value of pgid_id does not match the process group ID of a
49                 process in the same session as the calling process.
50
51

ATTRIBUTES

53       See attributes(5) for descriptions of the following attributes:
54
55
56
57
58       ┌─────────────────────────────┬───────────────────────────────┐
59       │      ATTRIBUTE TYPE         │       ATTRIBUTE VALUE         │
60       ├─────────────────────────────┼───────────────────────────────┤
61       │Interface Stability          │Standard                       │
62       ├─────────────────────────────┼───────────────────────────────┤
63       │MT-Level                     │MT-Safe, and Async-Signal-Safe │
64       └─────────────────────────────┴───────────────────────────────┘
65

SEE ALSO

67       tcgetpgrp(3C), attributes(5), standards(5), termio(7I)
68
69
70
71SunOS 5.11                        14 Aug 2002                    tcsetpgrp(3C)
Impressum