Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getcompat(2) — A/UX 3.0.1

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 compatibility 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 nonblocking 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 sockets which are marked for nonblocking always return an error and set errno to EWOULDBLOCK.) COMPAT_BSDGROUPS Enables 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 created. 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 reliable signal delivery. Caught signals will be held while a signal handler is invoked and reset upon exit from the signal hander. January 1992 1



setcompat(2) setcompat(2)
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 structure. Membership in a 4.2 process group persists across exec system calls. Jobs that are 4.2 process group members are effected 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_CLRPGROUP Disables 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 invoking 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 provide 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. However, a process with effective user ID equal to the user ID of the file, but without superuser privileges, can change the group ID of the file to the effective group ID of the process or to one of the process's supplementary group IDs. COMPAT_BSDNOTRUNC 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 fork calls and are reset by exec calls (see COMPAT_EXEC earlier in this section). 2 January 1992



setcompat(2) setcompat(2)
The default process compatibility flags are COMPAT_BSDPROT and COMPAT_BSDNBIO. STATUS MESSAGES AND VALUES Upon successful completion, setcompat returns the previous compatibility mask and getcompat returns the current compatibility mask. Otherwise, a value of -1 is returned and errno is set to indicate the error. The setcompat command 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) January 1992 3

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