termio.7 (2010 09)

t
termio(7) termio(7)
TIOCGPGRP Returns in the integer referenced by arg the foreground process group associated
with the terminal. This command is allowed from a background process. However,
the information may be subsequently changed by a foreground process. This
feature is easily implemented using the tcgetpgrp() function (see
tcgetpgrp (3C)).
If the
ioctl() call fails, it returns 1 and sets
errno to one of the following
values:
[EBADF] fildes is not a valid file descriptor.
[ENOTTY] The file associated with fildes is not the controlling terminal, or the
calling process does not have a controlling terminal.
[EACCES] The file associated with fildes is the controlling terminal of the cal-
ling process, however, there is no foreground process group defined
for the controlling terminal.
Note: [EACCES] may not be returned in future releases. Behavior
in cases where no foreground process group is defined for the con-
trolling terminal may change in future versions of the POSIX stan-
dard. Portable applications, therefore, should not rely on this error
condition.
TIOCSPGRP Sets the foreground process group associated with the terminal to the value refer-
enced by arg. This feature is easily implemented using the tcsetpgrp() func-
tion (see tcsetpgrp (3C)).
If the
ioctl() call fails, it returns 1 and sets errno to one of the following
values:
[EBADF] fildes is not a valid file descriptor.
[EINVAL] The process ID referenced by arg is not a supported value.
[ENOTTY] The calling process does not have a controlling terminal, or the
fildes is not the controlling terminal, or the controlling terminal is
no longer associated with the session of the calling process.
[EPERM] The process ID referenced by arg is a supported value but does not
match the process group ID of a process in the same session as the
calling process.
TIOCGSID Returns in the integer referenced by arg the session ID of the terminal specified by
fildes. This feature is easily implemented using the tcgetsid() function (see
tcgetsid (3C)).
If the
ioctl() call fails, it returns 1 and sets errno to one of the following
values:
[EBADF] fildes is not a valid file descriptor.
[ENOTTY] The device associated with fildes is not a terminal.
[EACCES] The fildes is a terminal that is not allocated to a session.
TIOCLGET Get the process group control mode word and store it in the int referenced by arg.
This command is allowed from a background process; however, the information may
be subsequently changed by a foreground process.
TIOCLSET Set the process group control mode word to the value of the int referenced by arg.
TIOCLBIS Use the int referenced by arg as a mask of bits to set in the process group control
mode word.
TIOCLBIC Use the int referenced by arg as a mask of bits to clear in the process group control
mode word.
The following bit is defined in the process group control mode word:
LTOSTOP Send SIGTTOU for background writes.
Setting or clearing
LTOSTOP is equivalent to setting or clearing the TOSTOP flag (see Local Modes). If
LTOSTOP is set and a process is not in the foreground process group of its controlling terminal, a write by
HP-UX 11i Version 3: September 2010 17 Hewlett-Packard Company 17