syssgi(2) syssgi(2)
NAME
syssgi - Silicon Graphics Inc. system call
SYNOPSIS
#include <sys/syssgi.h>
ptrdifft syssgi (int request, ...);
DESCRIPTION
syssgi is a system interface specific to Silicon Graphics systems. The
value of the request parameter determines the meaning of the remaining
arguments. In the descriptions below, arg1, arg2, and arg3 refer to
parameters following the request argument. The following requests are
currently supported:
SGISYSID Returns an identifier for the given system. This identifier
is guaranteed to be unique within the Silicon Graphics
product family. The argument arg1 for this request should be
a pointer to a character buffer of MAXSYSIDSIZE characters.
SGIRDNAME Returns the process name for the process id specified in
arg1. The arguments arg2 and arg3 give the address and
length, respectively, of the buffer which will receive the
name string. This name corresponds to the name in the
COMMAND column of ps(1) for the given process. The returned
string will be null-terminated unless the caller's buffer is
too small, in which case the string is simply truncated at
the size of the buffer. The return value gives the number of
bytes copied to the buffer, which will be the minimum of the
size of the buffer and the size of the field in the user
structure that contains the process name. Note that this
means that the returned length will typically be greater than
the actual length of the name string (in the sense of
strlen(3)).
SGIRDUBLK Was an obsolete feature and has been discontinued. Users are
directed to the process filesystem (see proc(4).) to obtain
information about a process.
SGIPROCSZ Was an obsolete feature and has been discontinued. Users are
directed to the process filesystem (see proc(4).) to obtain
information about a process.
SGITUNE This request allows the superuser to redefine tunable
variables to more accurately reflect system use. The
argument arg1 is a buffer pointer which specifies a group
name of the tunable variable. The argument arg2 is a buffer
pointer which holds the address of the tunable variable.
arg3 should be a buffer containing the tune value.
systune(1M) is the preferred way to change these variables.
This system call is only supported for 64 bit programs when
running on 64 bit kernels.
Page 1
syssgi(2) syssgi(2)
SGIIDBG Used internally for kernel debugging.
SGIINVENT Returns information about the hardware inventory of the
system. If arg1 is SGIINVSIZEOF then the size of an
individual inventory item is returned. If arg1 is
SGIINVREAD then arg3 bytes worth of inventory records are
read into the buffer specified by arg2. Applications should
use getinvent(3) to access this information; this internal
interface may change.
SGISETLED If arg1 is 1, turn on an LED on the machine. 0 turns it off.
This is only available on some SGI computers.
SGISETNVRAM
Sets nvram variable with given value. Nvram variables are
subset of IRIS PROM Monitor environment variables, which are
saved in EEPROM, and the values of which are preserved over
power cycle. arg1 is a buffer pointer which specifies a name
of nvram variable. arg2 is a buffer pointer which holds the
value of the nvram variable. Both buffers pointed by arg1
and arg2 must be at least 128 bytes long.
SGIGETNVRAM
Retrieve values of the IRIS PROM Monitor environment
variables. (see sgikopt(2)). arg1 is a buffer pointer which
specifies either name or index of a IRIS PROM Monitor
variable. Both name and index must be ASCII string. arg2 is
a buffer pointer in which the value be returned. Both
buffers pointed by arg1 and arg2 should be at least 128 bytes
long.
SGISETSID
SGISETPGID
SGISYSCONF
SGIPATHCONF
SGISETGROUPS
SGIGETGROUPS
SGISETTIMEOFDAY
SGISPROFIL
SGIRUSAGE
SGISIGSTACK
SGINETPROC
SGINFSCNVT
SGIGETPGID
SGIGETSID
SGIMPCWAROFF
SGISPIPE
SGIFDHI
SGICREATEUUID
SGIGETASH
SGISETASH
SGIGETPRID
Page 2
syssgi(2) syssgi(2)
SGIGETDFLTPRID
SGISETPRID
SGIGETSPINFO
SGISETSPINFO
SGIARSESSCTL
SGIARSESSOP
SGINEWARRAYSESS
These are all interfaces that are used to implement various
libc functions. These are all subject to change and should
not be called directly by applications.
SGIGETPLABEL
SGISETPLABEL
SGIGETLABEL
SGISETLABEL
SGISATREAD
SGISATWRITE
SGISATCTL
SGILOADATTR
SGIUNLOADATTR
SGIRECVLUMSG
SGIPLANGMOUNT
SGIGETPSOACL
SGISETPSOACL
These are all interfaces that are used to implement various
libc and libnsl (enhanced security) functions. These are all
subject to change and should not be called directly by
applications.
SGIREADB
SGIWRITEB These are used to read and write character special devices
that are greater than 2Gb. arg1 is the file descriptor
pointing to a character special device. arg2 is a buffer in
the user's space where the data will be transferred from or
to. arg3 is the block (512 bytes) offset of where to start
the transaction. arg4 is the number of blocks to transfer.
This interface is superceded in IRIX Release 5.3 by the use
of lseek64, which provides 64-bit seek offsets.
SGISSYNC Synchronously flush out all delayed write buffers.
SGIBDFLUSHCNT
Allows the calling process to delay the kernel from writing
out delayed write buffers by arg1 seconds. After that, the
normal flush delay will apply. At the end of the system
call, the kernel will return the old flush delay. This
system call is intended to be used in conjunction with the
SGISSYNC system call on a single processor machine to
provide the calling process with an environment that is free
of any unwanted disk activities for the period of arg1
seconds.
Page 3
syssgi(2) syssgi(2)
SGIQUERYFTIMER
Used by ftimer(1).
SGICYCLECNTRSIZE
Returns the size of the integer needed to read the cycle
counter. This is useful along with SGI_QUERY_CYCLECNTR to
write machine independent code to read the free running
hardware counter. On some machines the value needs to be
read into a 32 bit integer, and on others the cycle counter
needs to be read into a 64 bit integer.
SGIQUERYCYCLECNTR
It is best to use the clock_gettime(2) interface with the
CLOCK_SGI_CYCLE clock instead of mapping the counter
yourself. This is a much more portable solution. That said,
this syssgi option returns information about the free running
hardware counter on systems that support a high resolution
timer. Upon successful completion, an address for the
counter is returned. The size of the integer needed to hold
the count can be found using the SGI_CYCLECNTR_SIZE syssgi
call.
On machines with 64-bit counters it can either be read with
two separate 32-bit accesses (one at the returned address,
and the other at the returned address plus four), or with a
single 64-bit "long long" access in MIPS3 or MIPS4
applications.
The address must be mapped read-only into the user process
space via the mmap(2) system call into /dev/mmem before any
access can be made. Not all systems return page aligned
addresses, so the address must be masked to be page aligned,
and the offset added back to the returned mmap address, in
order for code to work on all systems, so typically you would
see code like this (ignoring error checking):
#include <stddef.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/syssgi.h>
#if CYCLE_COUNTER_IS_64BIT
typedef unsigned long long iotimer_t;
#else
typedef unsigned int iotimer_t;
#endif
__psunsigned_t phys_addr, raddr;
unsigned int cycleval;
volatile iotimer_t counter_value, *iotimer_addr;
int fd, poffmask;
Page 4
syssgi(2) syssgi(2)
poffmask = getpagesize() - 1;
phys_addr = syssgi(SGI_QUERY_CYCLECNTR, &cycleval);
raddr = phys_addr & ~poffmask;
fd = open("/dev/mmem", O_RDONLY);
iotimer_addr = (volatile iotimer_t *)mmap(0, poffmask, PROT_READ,
MAP_PRIVATE, fd, (off_t)raddr);
iotimer_addr = (iotimer_t *)((__psunsigned_t)iotimer_addr +
(phys_addr & poffmask));
counter_value = *iotimer_addr;
For the Challenge/ONYX and OCTANE families 64-bit counter, define
CYCLE_COUNTER_IS_64BIT. Sixty-four bit (MIPS 3, MIPS 4) applications
may simply use the example above with CYCLE_COUNTER_IS_64BIT defined.
Thirty-two bit applications need to read the halves separately and
check for wrap-around. Pass iotimer_addr and two unsigned int pointers
to the following routine:
void read_time(volatile unsigned *iotimer_addr,
unsigned *high, unsigned *low)
{
while (1) {
*high = *iotimer_addr;
*low = *(iotimer_addr + 1);
if (*high == *iotimer_addr) {
return;
}
}
}
This will put the top and bottom 32 bits of the time into the memory
pointed to by high and low, respectively. If you only need 32-bit
precision, you may use the original example but replace the
counter_value assignment with
counter_value = *(iotimer_addr + 1);
SGISETTIMETRIM
changes the value of timetrim from the initial value
configured in /var/sysgen/mtune/kernel (see lboot(1M) and
adjtime(2)). The argument arg1 is interpreted as an integer,
which gives the new value of timetrim.
SGIGETTIMETRIM
obtains the current value of timetrim. The argument arg1
must be a pointer to an integer, into which the timetrim
value is stored.
SGISETAUTOPWRON
Is used to set the time at which the system will
automatically power on (if it is powered off at that time).
Page 5
syssgi(2) syssgi(2)
If the system is not powered off at that time (hasn't yet
been shutdown and powered off), the call has no effect.
Rebooting the system clears the value. This is currently
2
implemented only on OCTANE, Indy, Indigo and Challenge M
systems. The 3rd argument is a time_t whose value is the
time in seconds from 1 Jan 1970 midnight GMT at which to turn
the system on. Also see the wakeupat(1M) man page. See the
ENOPKG description below for systems not implementing this
function.
SGIIOPROBE
SGICONFIG These are used by lboot(1M) to determine the system
configuration.
SGIMCONFIG Is used by lboot(1M) and ml(1M) to load, register, unload,
unregister and list dynamically loadable kernel modules.
This is subject to change and should not be called directly
by applications.
SGITOSSTSAVE
Used by runtime linkers to remove any saved text address
spaces.
SGIGETUST This interface is used to implement various libdmedia
functions. It is subject to change and should not be called
directly by applications.
SGISETFPPRECISE
Modifies floating point exception mode for the current
process. This is only meaningful on processors that support
multiple modes. On these processors, the default mode is
usually performance mode (also called imprecise exception
mode) and non-sequential memory (nsmm) mode. On all other
processors, the default is precise exception and sequential
(smm) mode.
arg1 should be non-zero in order to enable precise exception
mode. A value of zero will disable precise exception mode
thereby enabling peformance mode.
In precise exception mode, all floating point
exceptions/interrupts are reported on the instruction that
caused the exception, so floating point signal handlers can
clean up the FP state and continue execution. In performance
mode, floating point interrupts are asynchronous and the
reported program counter is meaningless. Precise mode is
provided as a means of debugging processes and/or backward
compatibility for programs that have knowledge of the FP
state. It causes significant performance degradation.
Page 6
syssgi(2) syssgi(2)
Currently this call only has an affect on machines with an
R8000 processor since that is the only processor which
supports this dual execution mode.
SGIGETFPPRECISE
Returns the floating point exception mode for the current
process. A zero value indicates that precise exception mode
is disabled.
SGIFPIMPRECISESUPP
Returns non-zero if the current processor supports imprecise
exceptions for floating point instructions.
SGISETCONFIGSMM
Modifies the memory model for floating point instructions for
the current process. Non-sequential memory access mode
(turned on by default on processors that support it) allows
the processor to do floating point and integer memory
operations out of order, thus possibly providing better
performance.
SGIGETCONFIGSMM
Returns non-zero if the current process is in sequential
memory mode.
SGICONFIGNSMMSUPP
Returns non-zero if the current processor supports non-
sequential memory operations.
SGISETFPPRESERVE
Forces floating point state information (precise/imprecise
exception mode as well as sequential/non-sequential memory
mode) to be preserved across exec(2) system calls.
SGIFSINUMBERS
This interface is used to extract a list of valid inode
numbers from a filesystem. It is intended to be called
iteratively, to obtain the entire set of inodes. Currently
the only filesystem type supporting this operation is the XFS
filesystem. arg1 is a file descriptor either for the block
or character device containing the filesystem of interest (it
must be mounted) or for an open file in the filesystem of
interest. arg2 is a pointer to a variable of type ino64t
containing the last inode returned, initially it should be 0.
arg3 is the size of the array of structures specified by
arg4. arg4 is the address of an array of structures, of type
xfsinogrpt (definition found in <sys/fs/xfs_itable.h>).
The structure has the following elements: xistartino
(starting inode number), xialloccount (count of bits set in
xiallocmask), and xiallocmask (mask of allocated inodes in
this group). The bitmask is 64 bits long, and the least
significant bit corresponds to inode xistartino. Each bit
Page 7
syssgi(2) syssgi(2)
is set if the corresponding inode is in use. arg5 is a
pointer to a count of returned values, filled in by the call.
A count value of 0 means that the inode table has been
exhausted.
SGIFSBULKSTAT
This interface is used to extract inode information (stat
information) "in bulk" from a filesystem. It is intended to
be called iteratively, to obtain information about the entire
set of inodes in a filesystem. Currently the only filesystem
type supporting this operation is the XFS filesystem. arg1
is a file descriptor either for the block or character device
containing the filesystem of interest (it must be mounted) or
for an open file in the filesystem of interest. arg2 is a
pointer to a variable of type ino64t containing the last
inode returned, initially it should be 0. arg3 is the size
of the array of structures specified by arg4. arg4 is the
address of an array of structures, of type xfsbstatt
(definition found in <sys/fs/xfs_itable.h>). Many of the
elements in the structure are the same as for the stat
structure. The structure has the following elements: bsino
(inode number), bsmode (type and mode), bsnlink (number of
links), bsuid (user id), bsgid (group id), bsrdev (device
value), bsblksize (block size of the filesystem), bssize
(file size in bytes), bsatime (access time), bsmtime
(modify time), bsctime (inode change time), bsblocks
(number of blocks used by the file), bsxflags (extended
flags), bsextsize (extent size), bsextents (number of
extents), bsgen (generation count), bsprojid (project id),
bsdmevmask (DMIG event mask), bsdmstate (DMIG state
information), and bsaextents (attribute extent count). arg5
is a pointer to a count of returned values, filled in by the
call. A count value of 0 means that the inode table has been
exhausted.
SGIFSBULKSTATSINGLE
This interface is a variant of the SGIFSBULKSTAT interface,
used to obtain information about a single inode. arg1 is a
file descriptor either for the block or character device
containing the filesystem of interest (it must be mounted) or
for an open file in the filesystem of interest. arg2 is a
pointer to a variable of type ino64t containing the inode
number of interest. arg3 is the address of a structure, of
type xfsbstatt (definition found in <sys/fs/xfs_itable.h>).
An error is returned if the inode number is invalid.
SGIXFSFSOPERATIONS
This interface is used to implement various filesystem
operations on XFS filesystems. There are several sub-
operations implemented. See the header file
<sys/fs/xfs_fsops.h> for further information. arg1 is a file
descriptor either for the block or character device
Page 8
syssgi(2) syssgi(2)
containing the filesystem of interest (it must be mounted) or
for an open file in the filesystem of interest. arg2 is the
operation code, one of XFSFSGEOMETRY, XFSFSCOUNTS,
XFSGROWFSDATA, XFSGROWFSLOG, or XFSGROWFSRT. arg3 is a
pointer to the input structure, of a type determined by the
operation code; it may be null. arg4 is a pointer to the
output structure, of a type determined by the operation code;
it may be null. For XFSFSGEOMETRY (get filesystem mkfs-
time information), the output structure is xfsfsopgeomt.
For XFSFSCOUNTS (get filesystem dynamic global
information), the output structure is xfsfsopcountst. The
XFSGROWFS... operations are used to implement the
xfs_growfs(1M) command, and are not described further. Only
the super-user may call functions that modify data
(XFS_GROWFS_DATA, XFS_GROWFS_LOG, XFS_GROWFS_RT, and
XFS_SET_RESBLKS).
SGIPATHTOHANDLE
SGIPATHTOFSHANDLE
SGIFDTOHANDLE
SGIOPENBYHANDLE
SGIREADLINKBYHANDLE
SGIATTRLISTBYHANDLE
SGIATTRMULTIBYHANDLE
SGIFSSETDMBYHANDLE
These are all interfaces that are used to implement various
libdm functions. The only filesystem that supports these
operations is XFS. They are all subject to change and should
not be called directly by applications.
SGIENUMASHS
SGIGETARSESS
SGIGETASMACHID
SGIPIDSINASH
SGISETASMACHID
These are all interfaces that are used to implement various
libarray functions. They are all subject to change and
should not be used directly by applications.
SGIACLGET
SGIACLSET
SGIALLOCSHARENA
SGIBTOOLGET
SGIBTOOLREINIT
SGIBTOOLSIZE
SGICACHEFSSYS
SGICAPGET
SGICAPSET
SGICKPTSYS
SGICONST
SGIDBACONFIG
SGIDYIELD
Page 9
syssgi(2) syssgi(2)
SGIELFMAP
SGIERRORFORCE
SGIEVENTCTR
SGIFODUMP
SGIFOSWITCH
SGIGETGRPPID
SGIGETSESPID
SGIGETVPID
SGIGETCONTEXTINFO
SGIGETCONTEXTNAME
SGIGETDISMISSEDEXCCNT
SGIGETEVCONF
SGIGRIO
SGIIOSHOWAUXINFO
SGIJOINARRAYSESS
SGIKAIOREAD
SGIKAIOSTATS
SGIKAIOSUSPEND
SGIKAIOUSERINIT
SGIKAIOWRITE
SGIKTHREAD
SGILOCKDSYS
SGIMACGET
SGIMACSET
SGIMEMPROFCLEARALL
SGIMEMPROFGET
SGIMEMPROFSTART
SGIMEMPROFSTOP
SGIMINRSS
SGIMODULEINFO
SGINFSNOTIFY
SGINOFPE
SGINUMASTATSGET
SGINUMATESTS
SGINUMATUNE
SGINUMMODULES
SGIOBJEVICT
SGIPARTOPERATIONS
SGIPHYSP
SGIPMOCTL
SGIPRIOQUERYBW
SGIPROCATTRGET
SGIPROCATTRSET
SGIREADDANGID
SGIRELEASENAME
SGIREVOKE
SGIRTTSTAMPADDR
SGIRTTSTAMPCREATE
SGIRTTSTAMPDELETE
SGIRTTSTAMPEOBMODE
SGIRTTSTAMPMASK
SGIRTTSTAMPSTART
Page 10
syssgi(2) syssgi(2)
SGIRTTSTAMPSTOP
SGIRTTSTAMPUPDATE
SGIRTTSTAMPWAIT
SGISBECLRINFO
SGISBEGETINFO
SGISETVPID
SGISETDISMISSEDEXCCNT
SGISIGALTSTACK
SGISPECULATIVEEXEC
SGISYMTAB
SGISYNCHCACHEHANDLER
SGITUNESET
SGIULI
SGIUSEFPBCOPY
SGIXLVATTRCURSOR
SGIXLVATTRGET
SGIXLVATTRSET
SGIXLVNEXTRQST
SGIXLVSETTAB
These are all interfaces that are used to implement various
system library functions. They are all subject to change and
should not be called directly by applications.
ERRORS
The following error codes may be returned by syssgi:
[EFAULT] A buffer is referenced which is not in a valid part of the
calling program's address space.
[ENODEV] Could not determine system ID for SGISYSID.
[ESRCH] Could not find given process for SGIRDNAME.
[EPERM] The effective user ID is not superuser. SGITUNE and
SGIIDBG require superuser privilege.
[EINVAL] For SGITUNE, the first argument was not valid, or the tune
structure contained invalid values. For SGIINVENT arg1 was
neither SGIINVREAD nor SGIINVSIZEOF. For SGISETNVRAM
arg1 is not valid nvram variable name. For SGIGETNVRAM arg1
is not valid IRIS PROM Monitor environment variable name.
For SGIFSBULKSTATSINGLE arg2 does not refer to a valid
inode number for this filesystem.
[ENXIO] SGISETNVRAM is not supported.
[ENOPKG] SGISETAUTOPWRON is not supported on this system.
[ENOMEM] The specified buffer was not large enough to hold the entire
list of process ids returned by the SGIPIDSINASH function.
SEE ALSO
ftimer(1), hinv(1), mpadmin(1), adjtime(2), clock_gettime(2),
clock_settime(2), setitimer(2), sigaction(2).
DIAGNOSTICS
Upon successful completion, a command dependent value (default of zero)
is returned. Otherwise, a value of -1 is returned and errno is set to
indicate the error.
Page 11