SYSI86(S) UNIX System V SYSI86(S)
Name
sysi86 - machine-specific functions
Syntax
#include <sys/sysi86.h>
long sysi86(cmd,arg)
int cmd;
Description
The sysi86 system call implements machine-specific
functions. The cmd argument determines the function to be
performed. The types of the arguments expected depend on
the function.
Command RTODC
When cmd is RTODC, the expected argument is the address of a
struct rtc_t (from the header file <sys/rtc.h>):
struct rtc_t {
char rtc_sec, rtc_asec, rtc_min, rtc_amin,
rtc_hr, rtc_ahr, rtc_dow, rtc_dom,
rtc_mon, rtc_yr, rtc_statusg,
rtc_statusb, rtc_statusc, rtc_statusd;
};
This function reads the hardware time-of-day clock and
returns the data in the structure referenced by the
argument. This command is available only to the super-user.
RDUBLK
This command reads the u-block (per process user information
as defined by structuser in the <sys/user> header file) for
a given process. When cmd is RDUBLK, sysi86 takes three
additional arguments: the process ID, the address of a
buffer, and the number of bytes to read:
sysi86(RDUBLK, pid, buf, n)
int pid;
char *buf;
ind n;
Command SI86FPHW
This command expects the address of an integer as its
argument. After successful return from the system call, the
integer specifies how floating-point computation is
supported.
The low-order byte of the integer contains the value of
``fpkind'', a variable that specifies whether an 80287 or
80387 floating-point coprocessor is present, emulated in
software, or not supported. The values are defined in the
header file <sys/fp.h>.
FP_NO no fp chip, no emulator (no fp
support)
FP_SW no fp chip, using software emulator
FP_HW chip present bit
FP_287 80287 chip present
FP_387 80387 chip present
Command SETName
This command, which is only available to the super-user,
expects an argument of type char * which points to a NULL
terminated string of at most 7 characters. The command will
change the running system's sysname and nodename (see
uname(S)) to this string.
Command STIME
When cmd is STIME, an argument of type long is expected.
This function sets the system time and date (not the
hardware clock). The argument contains the time as measured
in seconds from 00:00:00 GMT January 1, 1970. Note that this
command is only available to the super-user.
Command SI86DSCR
This command sets a segment or gate descriptor in the
kernel. The following descriptor types are accepted:
+ executable and data segments in the LDT at DPL 3
+ a call gate in the GDT at DPL 3 that points to a
segment in the LDT
The argument is a pointer to a request structure that
contains the values to be placed in the descriptor. The
request structure is declared in the <sys/sysi86.h> header
file.
Command SI86MEM
This command returns the size of available memory in bytes.
Command SI86SWPI
When cmd is SI86SWPI, individual swapping areas may be
added, deleted or the current areas determined. The address
of an appropriately primed swap buffer is passed as the only
argument. (Refer to sys/swap.h header file for details of
loading the buffer.)
The format of the swap buffer is:
struct swapint {
char si_cmd; /* command: SI_LIST, SI_ADD, SI_DEL */
char *si_buf; /* swap file path pointer */
int si_swplo; /* start block */
int si_nblks; /* swap size */
} ;
Note that the add and delete options of the command may only
be exercised by the super-user.
Typically, a swap area is added by a single call to sysi86.
First, the swap buffer is primed with appropriate entries
for the structure members. Then sysi86 is invoked.
#include <sys/sysi86.h>
#include <sys/swap.h>
struct swapint swapbuf; /*swap into buffer ptr*/
sysi86(SI86SWPI, &swapbuf);
If this command succeeds, it returns 0 to the calling
process. This command fails, returning -1, if one or more
of the following is true:
[EFAULT] swapbuf points to an invalid address
[EFAULT] swapbuf.si_buf points to an invalid address
[ENOTBLK] Swap area specified is not a block special device
[EEXIST] Swap area specified has already been added
[ENOSPC] Too many swap areas in use (if adding)
[ENOMEM] Tried to delete last remaining swap area
[EINVAL] Bad arguments
[ENOMEM] No place to put swapped pages when deleting a swap area
Return Value
Upon error, -1 is returned and errno is set to indicate the
error. When the cmd is invalid, errno is set to EINVAL.
See Also
uname(S), swap(ADM)
(printed 6/20/89)