Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getcompat(2) — A/UX 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exec(2)

fork(2)

sigvec(2)

set42sig(3)

signal(3)

setuid(3)

termio(7)




setcompat(2) setcompat(2)
NAME setcompat, getcompat - set or get process compatibility mode SYNOPSIS #include <compat.h> int setcompat(flags) int flags; int getcompat(); DESCRIPTION setcompat sets a process's compatibility mode according to the flags argument. The argument governs the type of compa- tibility enforced. flags may be COMPAT_SVID for strictest adherence to the System V interface definition, COMPAT_POSIX to enable all POSIX functionality, or the bitwise OR of one or more of the following symbolic constants. If set, other flags always take precedence over COMPAT_SVID. COMPAT_BSDNBIO Changes the error handling in 4.2 BSD non- blocking I/O code. read and write system calls on slow devices, that is, terminals, which are marked for non-blocking may return -1 with errno set to EWOULDBLOCK instead of returning 0. (Operations which may block, that is, connect, accept, and recv on sock- ets which are marked for nonblocking always return an error and set errno to EWOULD- BLOCK.) COMPAT_BSDGROUPSEnables the use of the 4.2 BSD groups code which permits users to be members of more than one group simultaneously and creates files whose group is determined by the group of the directory in which the file is creat- ed. COMPAT_BSDSETUGID When selected, changes the behavior of the setuid and setgid calls to be BSD- compatible; that is, no handling of the saved set-user (group) ID from exec. When cleared, the setreuid and setregid calls behave as setuid and setgid, respectively. COMPAT_BSDSIGNALS Allows a process to use 4.2 BSD-compatible signals. The state of this flag may not be changed unless no signals are pending, caught, or held. This option enables reli- able signal delivery. Caught signals will April, 1990 1



setcompat(2) setcompat(2)
be held while a signal handler is invoked and reset upon exit from the signal hander. COMPAT_BSDTTY Enables 4.2 BSD job control. When first set, this process and its descendants will be identified as 4.2 processes via a bit in the flag word of the kernel proc data struc- ture. Membership in a 4.2 process group persists across exec system calls. Jobs that are 4.2 process group members are ef- fected by job control signals. When COMPAT_BSDTTY is set the setpgrp system call may be used to manipulate the process group of other processes. This flag may only be used in conjunction with the COMPAT_BSDSIGNALS flag. Normally, COMPAT_BSDTTY is set by a login shell. COMPAT_CLRPGROUPDisables 4.2 BSD job control. Resets the 4.2 process group bit in the flag word of the kernel proc data structure. It may be used by a V.2 process which wants to sever any job control associations with an invok- ing shell (for itself and its descendants). This bit provides a ``one shot'' clear. When read by getcompat, this bit is always zero. COMPAT_EXEC If this flag is set, compatibility flags are inherited across exec system calls. To pro- vide child process with a System V interface environment, both the COMPAT_SVID and the COMPAT_EXEC flags must be set by ORing the flags. COMPAT_SYSCALLS If selected, read, write, ioctl, or wait calls which are interrupted by a signal handler will not return an EINTR error, but will instead resume at the point they were interrupted. This flag may only be used in conjunction with the COMPAT_BSDSIGNALS flag. COMPAT_BSDCHOWN If selected, chown(2) is restricted to processes with superuser privileges. Howev- er, a process with effective user ID equal to the user ID of the file, but without su- peruser privileges, can change the group ID of the file to the effective group ID of the process or to one of the process's supple- mentary group IDs. COMPAT_BSDNOTRUNC 2 April, 1990



setcompat(2) setcompat(2)
If selected, pathname components longer than NAME_MAX generate an error. getcompat returns the current process compatibility flags. By default, compatibility flags are preserved across forks and are reset by execs (see COMPAT_EXEC above). The default process compatibility flags are COMPAT_BSDPROT and COMPAT_BSDNBIO. RETURN VALUE Upon successful completion, setcompat returns the previous compatibility mask and getcompat returns the current compa- tibility mask. Otherwise, a value of -1 is returned and errno is set to indicate the error. ERRORS setcompat will return the following error code. [EINVAL] flag results in a change in the state of the COMPAT_BSDSIGNALS bit and a signal is currently pending, caught, or held. [EINVAL] flag is either COMPAT_BSDTTY or COMPAT_SYSCALLS and the COMPAT_BSDSIGNALS are also not set. SEE ALSO exec(2), fork(2), sigvec(2), set42sig(3), signal(3), setuid(3), termio(7). April, 1990 3

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026