TOPIC   #  NAME                     DESCRIPTION
-----  --- ------------             ------------------------------------------------
system 134 bdflush                 - start, flush, or tune buffer-dirty-flush daemon
system 127 create_module           - create a loadable module entry
system 129 delete_module           - delete a loadable module entry 
system 130 get_kernel_syms         - retrieve exported kernel and module symbols 
system 188 getpmsg                 - UNIMPLEMENTED
system  76 getrlimit               - get resource limits and usage
system  77 getrusage               - get resource limits and usage
system 101 ioperm                  - set port input/output permissions
system 110 iopl                    - iopl   - change I/O privilege level
system 123 modify_ldt              - get or set ldt
system 169 nfsservctl              - syscall interface to kernel nfs daemon
system 167 query_module            - query the kernel for bits pertaining to modules
system 131 quotactl                - manipulate disk quotas
system  88 reboot                  - reboot or enable/disable Ctrl-Alt-Del
system 159 sched_get_priority_max  - get static priority
system 160 sched_get_priority_min  - get static priority rng
system 155 sched_getparam          - get scheduling parameters
system 157 sched_getscheduler      - get scheduling algo/param
system 161 sched_rr_get_interval   - get the SCHED_RR interval for the named
system 241 sched_setaffinity       - get a process's CPU
system 154 sched_setparam          - get scheduling parameters
system 156 sched_setscheduler      - get scheduling algo-
system 158 sched_yield             - yield the processor
system 121 setdomainname           - get/set domain name
system  74 sethostname             - set host name 
system  75 setrlimit               - set resource limits and usage
system 102 socketcall              - socket system calls
system 149 sysctl                  - read/write system parameters
system 116 sysinfo                 - returns information on overall system statistics
system 103 syslog                  - read  and/or clear kernel message ring buffer; set
system  58 ulimit                  - UNIMPLEMENTED
system 122 uname                   - get name and information about current kernel
system  86 uselib                  - select shared library
system 166 vm86                    - enter virtual 8086 mode
system 113 vm86old                 - enter virtual 8086 mode


----------------------------------------------------------------------------
system 134 bdflush                 - start, flush, or tune buffer-dirty-flush daemon
----------------------------------------------------------------------------
  mov   eax,134
  mov   ebx,func
  mov   ecx,address
  int   80h

       bdflush  starts, flushes, or tunes the buffer-dirty-flush daemon.  Only
       the super-user may call bdflush.

       If func is negative or 0, and no daemon has been started, then  bdflush
       enters the daemon code and never returns.

       If func is 1, some dirty buffers are written to disk.

       If  func  is  2 or more and is even (low bit is 0), then address is the
       address of a long word, and the tuning parameter numbered (func-2)/2 is
       returned to the caller in that address.

       If  func  is  3  or more and is odd (low bit is 1), then data is a long
       word, and the kernel sets tuning parameter numbered (func-3)/2 to  that
       value.

       The set of parameters, their values, and their legal ranges are defined
       in the kernel source file fs/buffer.c.

RETURN VALUE
       If func is negative or 0 and the daemon  successfully  starts,  bdflush
       never  returns.   Otherwise, the return value is 0 on success and -1 on
       failure, with errno set to indicate the error.

ERRORS
       EPERM  Caller is not super-user.

       EFAULT address points outside your accessible address space.

       EBUSY  An attempt was made to  enter  the  daemon  code  after  another
              process has already entered.

       EINVAL An  attempt  was made to read or write an invalid parameter num-
              ber, or to write an invalid value to a parameter.

CONFORMING TO
       bdflush is Linux specific and should not be used in  programs  intended
       to be portable.

SEE ALSO
       fsync(2), sync(2), update(8), sync(8)


----------------------------------------------------------------------------
system 127 create_module           - create a loadable module entry
----------------------------------------------------------------------------
  mov  eax,127
  mov   ebx,theName
  mov   ecx,size
  int   80h

       create_module  attempts  to  create a loadable module entry and reserve
       the kernel memory that will be needed to hold the module.  This  system
       call is only open to the superuser.

RETURN VALUE
       On success, returns the kernel address at which the module will reside.
       On error -1 is returned and errno is set appropriately.

ERRORS
       EPERM  The user is not the superuser.

       EEXIST A module by that name already exists.

       EINVAL The requested size is too  small  even  for  the  module  header
              information.

       ENOMEM The kernel could not allocate a contiguous block of memory large
              enough for the module.

       EFAULT name is outside the program's accessible address space.

SEE ALSO
       init_module(2), delete_module(2), query_module(2).


----------------------------------------------------------------------------
system 129 delete_module           - delete a loadable module entry 
----------------------------------------------------------------------------
  mov  eax,129
  mov   ebx,theName
  int   80h

       delete_module  attempts  to remove an unused loadable module entry.  If
       name is NULL, all unused modules marked  auto-clean  will  be  removed.
       This system call is only open to the superuser.

RETURN VALUE
       On  success,  zero  is returned.  On error, -1 is returned and errno is
       set appropriately.

ERRORS
       EPERM  The user is not the superuser.

       ENOENT No module by that name exists.

       EINVAL name was the empty string.

       EBUSY  The module is in use.

       EFAULT name is outside the program's accessible address space.

SEE ALSO
       create_module(2), init_module(2), query_module(2).


----------------------------------------------------------------------------
system 130 get_kernel_syms         - retrieve exported kernel and module symbols 
----------------------------------------------------------------------------
  mov  eax,130
  mov  ebx,table
  int  80h

       If  table is NULL, get_kernel_syms returns the number of symbols avail-
       able for query.  Otherwise it fills in a table of structures:

              struct kernel_sym
              {
                unsigned long value;
                char name[60];
              };

       The symbols are interspersed with magic symbols of  the  form  #module-
       name with the kernel having an empty name.  The value associated with a
       symbol of this form is the address at which the module is loaded.

       The symbols exported from each module follow their magic module tag and
       the modules are returned in the reverse order they were loaded.

RETURN VALUE
       Returns  the  number  of  symbols returned.  There is no possible error
       return.

SEE ALSO
       create_module(2), init_module(2), delete_module(2), query_module(2).

BUGS
       There is no way to indicate the size of the buffer allocated for table.
       If  symbols have been added to the kernel since the program queried for
       the symbol table size, memory will be corrupted.

       The length of exported symbol names is limited to 59.

       Because of these limitations, this system call is deprecated  in  favor
       of query_module.


----------------------------------------------------------------------------
system 188 getpmsg                 - UNIMPLEMENTED
----------------------------------------------------------------------------

----------------------------------------------------------------------------
system  76 getrlimit               - get resource limits and usage
----------------------------------------------------------------------------
  mov  eax,076
  mov  ebx,resource
  mov  ecx,rlim
  int  80h

       getrlimit and setrlimit get and set resource limits respectively.  Each
       resource has an associated soft and  hard  limit,  as  defined  by  the
       rlimit  structure  (the  rlim  argument  to  both getrlimit() and setr-
       limit()):

            struct rlimit {
                rlim_t rlim_cur;   /* Soft limit */
                rlim_t rlim_max;   /* Hard limit (ceiling
                                      for rlim_cur) */
            };

       The soft limit is the value that the kernel  enforces  for  the  corre-
       sponding  resource.   The  hard  limit  acts  as a ceiling for the soft
       limit: an unprivileged process may only set its soft limit to  a  value
       in  the range from 0 up to the hard limit, and (irreversibly) lower its
       hard limit.  A privileged process may make arbitrary changes to  either
       limit value.

       The  value  RLIM_INFINITY  denotes  no limit on a resource (both in the
       structure returned by getrlimit() and in the structure passed to  setr-
       limit()).

       resource must be one of:

       RLIMIT_AS
              The maximum size of the process's virtual memory (address space)
              in bytes.  This limit  affects  calls  to  brk(2),  mmap(2)  and
              mremap(2),  which fail with the error ENOMEM upon exceeding this
              limit. Also automatic stack expansion will fail (and generate  a
              SIGSEGV  that kills the process when no alternate stack has been
              made available).  Since the value is a long, on machines with  a
              32-bit long either this limit is at most 2 GiB, or this resource
              is unlimited.

       RLIMIT_CORE
              Maximum size of core file. When 0 no core dump  files  are  cre-
              ated.  When nonzero, larger dumps are truncated to this size.

       RLIMIT_CPU
              CPU  time  limit  in seconds.  When the process reaches the soft
              limit, it is sent a SIGXCPU signal.  The default action for this
              signal  is to terminate the process.  However, the signal can be
              caught, and the handler can return control to the main  program.
              If  the  process  continues to consume CPU time, it will be sent
              SIGXCPU once per second until the  hard  limit  is  reached,  at
              which  time  it  is  sent SIGKILL.  (This latter point describes
              Linux 2.2 and 2.4 behaviour.  Implementations vary in  how  they
              treat  processes which continue to consume CPU time after reach-
              ing the soft limit.  Portable applications that  need  to  catch
              this  signal  should  perform  an orderly termination upon first
              receipt of SIGXCPU.)

       RLIMIT_DATA
              The maximum size of  the  process's  data  segment  (initialized
              data,  uninitialized  data, and heap).  This limit affects calls
              to brk() and sbrk(), which  fail  with  the  error  ENOMEM  upon
              encountering the soft limit of this resource.

       RLIMIT_FSIZE
              The maximum size of files that the process may create.  Attempts
              to extend a file beyond this  limit  result  in  delivery  of  a
              SIGXFSZ  signal.   By default, this signal terminates a process,
              but a process can catch this signal instead, in which  case  the
              relevant  system call (e.g., write(), truncate()) fails with the
              error EFBIG.

       RLIMIT_LOCKS
              A limit on the combined number  of  flock()  locks  and  fcntl()
              leases that this process may establish.  (Early Linux 2.4 only.)

       RLIMIT_MEMLOCK
              The maximum number of bytes of virtual memory that may be locked
              into RAM using mlock() and mlockall().

       RLIMIT_NOFILE
              Specifies  a  value one greater than the maximum file descriptor
              number that can be opened by this  process.   Attempts  (open(),
              pipe(),  dup(),  etc.)   to  exceed  this  limit yield the error
              EMFILE.

       RLIMIT_NPROC
              The maximum number of processes that can be created for the real
              user  ID  of the calling process.  Upon encountering this limit,
              fork() fails with the error EAGAIN.

       RLIMIT_RSS
              Specifies the limit (in pages) of  the  process's  resident  set
              (the  number of virtual pages resident in RAM).  This limit only
              has effect in Linux 2.4 onwatrds, and there only  affects  calls
              to madvise() specifying MADVISE_WILLNEED.

       RLIMIT_STACK
              The  maximum size of the process stack, in bytes.  Upon reaching
              this limit, a SIGSEGV signal is generated.  To handle this  sig-
              nal,  a  process  must employ an alternate signal stack (sigalt-
              stack(2)).

       RLIMIT_OFILE is the BSD name for RLIMIT_NOFILE.

RETURN VALUE
       On  success,  zero is returned.  On error, -1 is returned, and errno is
       set appropriately.

ERRORS
       EFAULT rlim or usage points outside the accessible address space.

       EINVAL getrlimit or  setrlimit  is  called  with  a  bad  resource,  or
              getrusage is called with a bad who.

       EPERM  A non-superuser tries to use setrlimit() to increase the soft or
              hard limit above the current hard limit, or a superuser tries to
              increase RLIMIT_NOFILE above the current kernel maximum.

CONFORMING TO
       SVr4, BSD 4.3

NOTE
       Including <sys/time.h> is not required these days, but increases porta-
       bility.  (Indeed, struct timeval is defined in <sys/time.h>.)

       On Linux, if the disposition of SIGCHLD is  set  to  SIG_IGN  then  the
       resource  usages  of  child processes are automatically included in the
       value returned by RUSAGE_CHILDREN, although POSIX  1003.1-2001  explic-
       itly prohibits this.

       The above struct was taken from BSD 4.3 Reno.  Not all fields are mean-
       ingful under Linux.   Right  now  (Linux  2.4,  2.6)  only  the  fields
       ru_utime,  ru_stime, ru_minflt, ru_majflt, and ru_nswap are maintained.

SEE ALSO
       dup(2), fcntl(2), fork(2),  mlock(2),  mlockall(2),  mmap(2),  open(2),
       quotactl(2),  sbrk(2),  wait3(2),  wait4(2), malloc(3), ulimit(3), sig-
       nal(7)


----------------------------------------------------------------------------
system  77 getrusage               - get resource limits and usage
----------------------------------------------------------------------------
  mov  eax,077
  mov  ebx,resource
  mov  ecx,rlim
  int  80h

       getrusage returns the current resource usages,  for  a  who  of  either
       RUSAGE_SELF  or RUSAGE_CHILDREN.  The former asks for resources used by
       the current process, the latter for resources  used  by  those  of  its
       children that have terminated and have been waited for.

            struct rusage {
                struct timeval ru_utime; /* user time used */
                struct timeval ru_stime; /* system time used */
                long   ru_maxrss;        /* maximum resident set size */
                long   ru_ixrss;         /* integral shared memory size */
                long   ru_idrss;         /* integral unshared data size */
                long   ru_isrss;         /* integral unshared stack size */
                long   ru_minflt;        /* page reclaims */
                long   ru_majflt;        /* page faults */
                long   ru_nswap;         /* swaps */
                long   ru_inblock;       /* block input operations */
                long   ru_oublock;       /* block output operations */
                long   ru_msgsnd;        /* messages sent */
                long   ru_msgrcv;        /* messages received */
                long   ru_nsignals;      /* signals received */
                long   ru_nvcsw;         /* voluntary context switches */
                long   ru_nivcsw;        /* involuntary context switches */
            };

RETURN VALUE
       On  success,  zero is returned.  On error, -1 is returned, and errno is
       set appropriately.

ERRORS
       EFAULT rlim or usage points outside the accessible address space.

       EINVAL getrlimit or  setrlimit  is  called  with  a  bad  resource,  or
              getrusage is called with a bad who.

       EPERM  A non-superuser tries to use setrlimit() to increase the soft or
              hard limit above the current hard limit, or a superuser tries to
              increase RLIMIT_NOFILE above the current kernel maximum.

NOTE
       Including <sys/time.h> is not required these days, but increases porta-
       bility.  (Indeed, struct timeval is defined in <sys/time.h>.)

       On Linux, if the disposition of SIGCHLD is  set  to  SIG_IGN  then  the
       resource  usages  of  child processes are automatically included in the
       value returned by RUSAGE_CHILDREN, although POSIX  1003.1-2001  explic-
       itly prohibits this.

SEE ALSO
       dup(2), fcntl(2), fork(2),  mlock(2),  mlockall(2),  mmap(2),  open(2),
       quotactl(2),  sbrk(2),  wait3(2),  wait4(2), malloc(3), ulimit(3), sig-
       nal(7)


----------------------------------------------------------------------------
system 101 ioperm                  - set port input/output permissions
----------------------------------------------------------------------------
  mov  eax,101
  mov  ebx,from
  mov  ecx,num
  mov  edx,turn_on
  int  80h

       Ioperm  sets  the  port  access permission bits for the process for num
       bytes starting from port address from to the value turn_on.  The use of
       ioperm requires root privileges.

       Only  the  first  0x3ff I/O ports can be specified in this manner.  For
       more ports, the iopl function must be used.  Permissions are not inher-
       ited  on  fork,  but  on  exec they are. This is useful for giving port
       access permissions to non-privileged tasks.

       This call is mostly for the i386 architecture.  On many other architec-
       tures it does not exist or will always return an error.

RETURN VALUE
       On  success,  zero is returned.  On error, -1 is returned, and errno is
       set appropriately.

ERRORS
       EINVAL Invalid values for from or num.

       EPERM  Caller does not have the CAP_SYS_RAWIO privileges.

       EIO    (on ppc) This call is not supported.

CONFORMING TO
       ioperm is Linux specific and should not be used in programs intended to
       be portable.

SEE ALSO
       iopl(2)


----------------------------------------------------------------------------
system 110 iopl                    - iopl   - change I/O privilege level
----------------------------------------------------------------------------
  mov  eax,110
  mov  ebx,level
  int  80h

       iopl  changes the I/O privilege level of the current process, as speci-
       fied in level.

       This call is necessary to allow 8514-compatible X servers to run  under
       Linux.   Since  these  X servers require access to all 65536 I/O ports,
       the ioperm call is not sufficient.

       In addition to granting unrestricted I/O  port  access,  running  at  a
       higher  I/O  privilege  level also allows the process to disable inter-
       rupts.  This will probably crash the system, and is not recommended.

       Permissions are inherited by fork and exec.

       The I/O privilege level for a normal process is 0.

       This call is mostly for the i386 architecture.  On many other architec-
       tures it does not exist or will always return an error.

RETURN VALUE
       On  success,  zero is returned.  On error, -1 is returned, and errno is
       set appropriately.

ERRORS
       EINVAL level is greater than 3.

       EPERM  The current user is not the super-user.

       ENOSYS This call is unimplemented.

CONFORMING TO
       iopl is Linux specific and should not be used in processes intended  to
       be portable.

NOTES
       Libc5  treats  it  as  a system call and has a prototype in <unistd.h>.
       Glibc1 does not have a  prototype.  Glibc2  has  a  prototype  both  in
       <sys/io.h>  and  in <sys/perm.h>.  Avoid the latter, it is available on
       i386 only.

SEE ALSO
       ioperm(2)


----------------------------------------------------------------------------
system 123 modify_ldt              - get or set ldt
----------------------------------------------------------------------------
  mov  eax,123
  mov  ebx,func
  mov  ecx,ptr
  mov  edx,bytecount
  int  80h

       modify_ldt reads or writes the  local  descriptor  table  (ldt)  for  a
       process.   The ldt is a per-process memory management table used by the
       i386 processor.  For more information on this table, see an  Intel  386
       processor handbook.

       When  func is 0, modify_ldt reads the ldt into the memory pointed to by
       ptr.  The number of bytes read is the  smaller  of  bytecount  and  the
       actual size of the ldt.

       When  func  is  1,  modify_ldt modifies one ldt entry.  ptr points to a
       modify_ldt_ldt_s structure and bytecount must equal the  size  of  this
       structure.

RETURN VALUE
       On  success,  modify_ldt returns either the actual number of bytes read
       (for reading) or 0 (for writing).  On failure,  modify_ldt  returns  -1
       and sets errno.

ERRORS
       ENOSYS func is neither 0 nor 1.

       EINVAL ptr is 0, or func is 1 and bytecount is not equal to the size of
              the structure modify_ldt_ldt_s, or func is 1  and  the  new  ldt
              entry has invalid values.

       EFAULT ptr points outside the address space.

CONFORMING TO
       This call in Linux-specific and should not be used in programs intended
       to be portable.

SEE ALSO
       vm86(2)


----------------------------------------------------------------------------
system 169 nfsservctl              - syscall interface to kernel nfs daemon
----------------------------------------------------------------------------
  mov  eax,169
  mov  ebx,cmd
  mov  ecx,nfsctl_arg
  mov  edx,nfsctl_res
  int  80h


       /*
        * These are the commands understood by nfsctl().
        */
       #define NFSCTL_SVC              0       /* This is a server process. */
       #define NFSCTL_ADDCLIENT        1       /* Add an NFS client. */
       #define NFSCTL_DELCLIENT        2       /* Remove an NFS client. */
       #define NFSCTL_EXPORT           3       /* export a file system. */
       #define NFSCTL_UNEXPORT         4       /* unexport a file system. */
       #define NFSCTL_UGIDUPDATE       5       /* update a client's uid/gid map. */
       #define NFSCTL_GETFH            6       /* get an fh (used by mountd) */

       struct nfsctl_arg {
               int                     ca_version;     /* safeguard */
               union {
                       struct nfsctl_svc       u_svc;
                       struct nfsctl_client    u_client;
                       struct nfsctl_export    u_export;
                       struct nfsctl_uidmap    u_umap;
                       struct nfsctl_fhparm    u_getfh;
                       unsigned int            u_debug;
               } u;
       }

       union nfsctl_res {
               struct knfs_fh          cr_getfh;
               unsigned int            cr_debug;
       };

RETURN VALUE
       On  success,  zero is returned.  On error, -1 is returned, and errno is
       set appropriately.

CONFORMING TO
       This call is Linux-specific.



----------------------------------------------------------------------------
system 167 query_module            - query the kernel for bits pertaining to modules
----------------------------------------------------------------------------
  mov  eax,167
  mov  ebx,theName
  mov  ecx,which
  mov  edx,buf
  mov  esi,bufsize
  mov  edi,retval
  int  80h

       query_module requests information related to loadable modules from  the
       kernel.   The  precise nature of the information and its format depends
       on the which sub function.  Some functions require name to name a  cur-
       rently  loaded module, some allow name to be NULL indicating the kernel
       proper.


   VALUES OF WHICH
       0      Always returns success.  Used to probe for the system call.

       QM_MODULES
              Returns the names of all loaded modules.  The output buffer for-
              mat  is adjacent null-terminated strings; ret is set to the num-
              ber of modules.

       QM_DEPS
              Returns the names of all modules used by the  indicated  module.
              The  output  buffer  format is adjacent null-terminated strings;
              ret is set to the number of modules.

       QM_REFS
              Returns the names of all modules  using  the  indicated  module.
              This  is  the  inverse  of QM_DEPS.  The output buffer format is
              adjacent null-terminated strings; ret is set to  the  number  of
              modules.

       QM_SYMBOLS
              Returns  the  symbols  and  values exported by the kernel or the
              indicated module.  The buffer format is an array of:

              struct module_symbol
              {
                unsigned long value;
                unsigned long name;
              };

              followed by null-terminated strings.  The value of name  is  the
              character offset of the string relative to the start of buf; ret
              is set to the number of symbols.

       QM_INFO
              Returns miscellaneous information about  the  indicated  module.
              The output buffer format is:

              struct module_info
              {
                unsigned long address;
                unsigned long size;
                unsigned long flags;
              };

              where address is the kernel address at which the module resides,
              size is the size of the module in bytes, and flags is a mask  of
              MOD_RUNNING,  MOD_AUTOCLEAN,  et  al  that indicates the current
              status of the module.  ret is set to the size of the module_info
              struct.

RETURN VALUE
       On  success,  zero  is returned.  On error, -1 is returned and errno is
       set appropriately.

ERRORS
       ENOENT No module by that name exists.

       EINVAL Invalid which, or name indicates the kernel for an inappropriate
              sub function.

       ENOSPC The buffer size provided was too small.  ret is set to the mini-
              mum size needed.

       EFAULT At least one of name, buf, or  ret  was  outside  the  program's
              accessible address space.

SEE ALSO
       create_module(2), init_module(2), delete_module(2).


----------------------------------------------------------------------------
system 131 quotactl                - manipulate disk quotas
----------------------------------------------------------------------------
  mov  eax,131
  mov  ebx,cmd
  mov  ecx,special
  mov  edx,id
  mov  esi,addr
  int  80h


----------------------------------------------------------------------------
system  88 reboot                  - reboot or enable/disable Ctrl-Alt-Del
----------------------------------------------------------------------------
  mov  eax,088
  mov  ebx,magic
  mov  ecx,magic2
  mov  edx,flag
  mov  esi,arg
  int  80h

       The reboot call reboots the system, or enables/disables the reboot key-
       stroke (abbreviated CAD, since the default is Ctrl-Alt-Delete;  it  can
       be changed using loadkeys(1)).

       This   system   call  will  fail  (with  EINVAL)  unless  magic  equals
       LINUX_REBOOT_MAGIC1   (that   is,   0xfee1dead)   and   magic2   equals
       LINUX_REBOOT_MAGIC2  (that  is, 672274793).  However, since 2.1.17 also
       LINUX_REBOOT_MAGIC2A  (that  is,  85072278)  and  since   2.1.97   also
       LINUX_REBOOT_MAGIC2B   (that  is,  369367448)  and  since  2.5.71  also
       LINUX_REBOOT_MAGIC2C (that is, 537993216) are permitted  as  value  for
       magic2.   (The  hexadecimal  values of these constants are meaningful.)
       The flag argument can have the following values:

       LINUX_REBOOT_CMD_RESTART
              (RB_AUTOBOOT, 0x1234567).  The message `Restarting  system.'  is
              printed, and a default restart is performed immediately.  If not
              preceded by a sync(2), data will be lost.

       LINUX_REBOOT_CMD_HALT
              (RB_HALT_SYSTEM, 0xcdef0123; since 1.1.76).  The message `System
              halted.' is printed, and the system is halted.  Control is given
              to the ROM monitor, if there is  one.   If  not  preceded  by  a
              sync(2), data will be lost.

       LINUX_REBOOT_CMD_POWER_OFF
              (0x4321fedc;  since  2.1.30).   The  message  `Power  down.'  is
              printed, the system is stopped, and all power  is  removed  from
              the  system,  if  possible.   If not preceded by a sync(2), data
              will be lost.

       LINUX_REBOOT_CMD_RESTART2
              (0xa1b2c3d4; since 2.1.30).  The message `Restarting system with
              command  '%s''  is  printed,  and  a  restart (using the command
              string given in arg) is performed immediately.  If not  preceded
              by a sync(2), data will be lost.

       LINUX_REBOOT_CMD_CAD_ON
              (RB_ENABLE_CAD,  0x89abcdef).   CAD is enabled.  This means that
              the CAD keystroke will immediately cause the  action  associated
              to LINUX_REBOOT_CMD_RESTART.

       LINUX_REBOOT_CMD_CAD_OFF
              (RB_DISABLE_CAD,  0).  CAD is disabled.  This means that the CAD
              keystroke will cause a SIGINT signal to be sent to init (process
              1),  whereupon  this  process  may  decide  upon a proper action
              (maybe: kill all processes, sync, reboot).

       Only the super-user may use this function.

       The precise effect of the above actions depends  on  the  architecture.
       For the i386 architecture, the additional argument does not do anything
       at present (2.1.122), but the type of reboot can be determined by  ker-
       nel  command  line  arguments (`reboot=...') to be either warm or cold,
       and either hard or through the BIOS.

RETURN VALUE
       On success, zero is returned.  On error, -1 is returned, and  errno  is
       set appropriately.

ERRORS
       EINVAL Bad magic numbers or flag.

       EPERM  A non-root user attempts to call reboot.

       EFAULT Problem      with      getting      userspace     data     under
              LINUX_REBOOT_CMD_RESTART2.

CONFORMING TO
       reboot is Linux specific, and should not be used in  programs  intended
       to be portable.

SEE ALSO
       sync(2), bootparam(7), ctrlaltdel(8), halt(8), reboot(8)


----------------------------------------------------------------------------
system 159 sched_get_priority_max  - get static priority
----------------------------------------------------------------------------
  mov  eax,159
  mov  ebx,policy
  int  80h

       sched_get_priority_max returns the maximum priority value that  can  be
       used    with   the   scheduling   algorithm   identified   by   policy.

       Processes with numerically higher priority values are scheduled  before
       processes  with  numerically  lower  priority  values.  Thus, the value
       returned by sched_get_priority_max  will  be  greater  than  the  value
       returned by sched_get_priority_min.

       Linux allows the static priority value range 1 to 99 for SCHED_FIFO and
       SCHED_RR and the priority 0 for SCHED_OTHER. Scheduling priority ranges
       for the various policies are not alterable.

       The  range  of  scheduling  priorities may vary on other POSIX systems,
       thus it is a good idea for portable applications to use a virtual  pri-
       ority  range and map it to the interval given by sched_get_priority_max
       and sched_get_priority_min.  POSIX.1b requires a spread of at least  32
       between the maximum and the minimum values for SCHED_FIFO and SCHED_RR.

       POSIX systems  on  which  sched_get_priority_max  and  sched_get_prior-
       ity_min  are available define _POSIX_PRIORITY_SCHEDULING in <unistd.h>.


RETURN VALUE
       On success, sched_get_priority_max  and  sched_get_priority_min  return
       the maximum/minimum priority value for the named scheduling policy.  On
       error, -1 is returned, errno is set appropriately.

ERRORS
       EINVAL The parameter policy does not identify a defined scheduling pol-
              icy.

CONFORMING TO
       POSIX.1b (formerly POSIX.4)

SEE ALSO
       sched_setaffinity(2),    sched_getaffinity(2),   sched_setscheduler(2),
       sched_getscheduler(2), sched_setparam(2), sched_getparam(2)

       sched_setscheduler(2) has a description of the Linux scheduling scheme.


----------------------------------------------------------------------------
system 160 sched_get_priority_min  - get static priority rng
----------------------------------------------------------------------------
  mov  eax,160
  mov  ebx,policy
  int  80h

       sched_get_priority_min returns the minimum priority value that  can  be
       used with the scheduling algorithm identified by policy. Supported pol-
       icy values are SCHED_FIFO, SCHED_RR, and SCHED_OTHER.

       Processes with numerically higher priority values are scheduled  before
       processes  with  numerically  lower  priority  values.  Thus, the value
       returned by sched_get_priority_max  will  be  greater  than  the  value
       returned by sched_get_priority_min.

       Linux allows the static priority value range 1 to 99 for SCHED_FIFO and
       SCHED_RR and the priority 0 for SCHED_OTHER. Scheduling priority ranges
       for the various policies are not alterable.

       The  range  of  scheduling  priorities may vary on other POSIX systems,
       thus it is a good idea for portable applications to use a virtual  pri-
       ority  range and map it to the interval given by sched_get_priority_max
       and sched_get_priority_min.  POSIX.1b requires a spread of at least  32
       between the maximum and the minimum values for SCHED_FIFO and SCHED_RR.

       POSIX systems  on  which  sched_get_priority_max  and  sched_get_prior-
       ity_min  are available define _POSIX_PRIORITY_SCHEDULING in <unistd.h>.


RETURN VALUE
       On success, sched_get_priority_max  and  sched_get_priority_min  return
       the maximum/minimum priority value for the named scheduling policy.  On
       error, -1 is returned, errno is set appropriately.

ERRORS
       EINVAL The parameter policy does not identify a defined scheduling pol-
              icy.

CONFORMING TO
       POSIX.1b (formerly POSIX.4)

SEE ALSO
       sched_setaffinity(2),    sched_getaffinity(2),   sched_setscheduler(2),
       sched_getscheduler(2), sched_setparam(2), sched_getparam(2)

       sched_setscheduler(2) has a description of the Linux scheduling scheme.

----------------------------------------------------------------------------
system 155 sched_getparam          - get scheduling parameters
----------------------------------------------------------------------------
  mov  eax,155
  mov  ebx,pid
  mov  ecx,p
  int  80h

       sched_getparam retrieves the  scheduling  parameters  for  the  process
       identified  by  pid. If pid is zero, then the parameters of the current
       process are retrieved.

RETURN VALUE
       On  success,  sched_getparam returns 0.  On error, -1
       is returned, errno is set appropriately.

ERRORS
       ESRCH  The process whose ID is pid could not be found.

       EINVAL The  parameter  p does not make sense for the current scheduling
              policy.

CONFORMING TO
       POSIX.1b (formerly POSIX.4)

SEE ALSO
       sched_setaffinity(2),   sched_getaffinity(2),    sched_setscheduler(2),
       sched_getscheduler(2),    sched_get_priority_max(2),   sched_get_prior-
       ity_min(2), nice(2), setpriority(2), getpriority(2),

       sched_setscheduler(2) has a description of the Linux scheduling scheme.


----------------------------------------------------------------------------
system 157 sched_getscheduler      - get scheduling algo/param
----------------------------------------------------------------------------
  mov  eax,157
  mov  ebx,pid
  int  80h

       sched_getscheduler  queries  the scheduling policy currently applied to
       the process identified by pid. If pid equals zero, the  policy  of  the
       calling process will be retrieved.


   Scheduling Policies
       The  scheduler  is  the kernel part that decides which runnable process
       will be executed by the CPU next. The Linux scheduler offers three dif-
       ferent  scheduling policies, one for normal processes and two for real-
       time applications. A static priority value sched_priority  is  assigned
       to  each  process  and this value can be changed only via system calls.
       Conceptually, the scheduler maintains a list of runnable processes  for
       each possible sched_priority value, and sched_priority can have a value
       in the range 0 to 99. In order to determine the process that runs next,
       the  Linux  scheduler  looks  for  the  non-empty list with the highest
       static priority and takes the process at the head  of  this  list.  The
       scheduling  policy  determines  for  each  process,  where  it  will be
       inserted into the list of processes with equal static priority and  how
       it will move inside this list.

       SCHED_OTHER is the default universal time-sharing scheduler policy used
       by most processes, SCHED_FIFO and SCHED_RR  are  intended  for  special
       time-critical  applications  that  need precise control over the way in
       which runnable processes are selected for execution.  Processes  sched-
       uled with SCHED_OTHER must be assigned the static priority 0, processes
       scheduled under SCHED_FIFO or SCHED_RR can have a  static  priority  in
       the  range  1 to 99. Only processes with superuser privileges can get a
       static priority higher than 0 and  can  therefore  be  scheduled  under
       SCHED_FIFO  or  SCHED_RR.  The  system calls sched_get_priority_min and
       sched_get_priority_max can be used to find out the valid priority range
       for  a  scheduling  policy in a portable way on all POSIX.1b conforming
       systems.

       All scheduling is preemptive: If a process with a higher static  prior-
       ity  gets  ready  to  run,  the  current  process will be preempted and
       returned into its wait list. The scheduling policy only determines  the
       ordering within the list of runnable processes with equal static prior-
       ity.


   SCHED_FIFO: First In-First Out scheduling
       SCHED_FIFO can only be used with static priorities higher than 0, which
       means that when a SCHED_FIFO processes becomes runnable, it will always
       preempt immediately any currently running normal  SCHED_OTHER  process.
       SCHED_FIFO  is  a simple scheduling algorithm without time slicing. For
       processes scheduled under the SCHED_FIFO policy,  the  following  rules
       are  applied:  A  SCHED_FIFO process that has been preempted by another
       process of higher priority will stay at the head of the  list  for  its
       priority  and  will resume execution as soon as all processes of higher
       priority are blocked again. When a SCHED_FIFO process becomes runnable,
       it  will be inserted at the end of the list for its priority. A call to
       sched_setscheduler  or  sched_setparam  will  put  the  SCHED_FIFO  (or
       SCHED_RR)  process identified by pid at the start of the list if it was
       runnable.  As a consequence,  it  may  preempt  the  currently  running
       process  if it has the same priority.  (POSIX 1003.1 specifies that the
       process should  go  to  the  end  of  the  list.)   A  process  calling
       sched_yield  will  be  put at the end of the list. No other events will
       move a process scheduled under the SCHED_FIFO policy in the  wait  list
       of  runnable processes with equal static priority. A SCHED_FIFO process
       runs until either it is blocked by an I/O request, it is preempted by a
       higher priority process, or it calls sched_yield.



   SCHED_RR: Round Robin scheduling
       SCHED_RR  is  a  simple enhancement of SCHED_FIFO. Everything described
       above for SCHED_FIFO also applies to SCHED_RR, except that each process
       is  only  allowed  to  run  for  a  maximum time quantum. If a SCHED_RR
       process has been running for a time period equal to or longer than  the
       time quantum, it will be put at the end of the list for its priority. A
       SCHED_RR process that has been preempted by a higher  priority  process
       and  subsequently  resumes execution as a running process will complete
       the unexpired portion of its round robin time quantum.  The  length  of
       the time quantum can be retrieved by sched_rr_get_interval.


   SCHED_OTHER: Default Linux time-sharing scheduling
       SCHED_OTHER  can only be used at static priority 0.  SCHED_OTHER is the
       standard Linux time-sharing scheduler that is  intended  for  all  pro-
       cesses  that  do  not  require special static priority real-time mecha-
       nisms. The process to run is chosen from the  static  priority  0  list
       based  on  a dynamic priority that is determined only inside this list.
       The dynamic priority is based on the nice level (set  by  the  nice  or
       setpriority  system  call)  and  increased  for  each  time quantum the
       process is ready to run, but denied  to  run  by  the  scheduler.  This
       ensures fair progress among all SCHED_OTHER processes.


   Response time
       A  blocked  high  priority  process  waiting  for the I/O has a certain
       response time before it is scheduled again. The  device  driver  writer
       can  greatly  reduce  this  response  time  by using a "slow interrupt"
       interrupt handler.


   Miscellaneous
       Child processes inherit the scheduling algorithm and parameters  across
       a fork.

       Memory  locking is usually needed for real-time processes to avoid pag-
       ing delays, this can be done with mlock or mlockall.

       As a non-blocking end-less loop in a process scheduled under SCHED_FIFO
       or  SCHED_RR  will  block  all processes with lower priority forever, a
       software developer should always keep available on the console a  shell
       scheduled  under  a higher static priority than the tested application.
       This will allow an emergency kill of tested real-time applications that
       do  not block or terminate as expected. As SCHED_FIFO and SCHED_RR pro-
       cesses can preempt other processes forever,  only  root  processes  are
       allowed to activate these policies under Linux.

       POSIX  systems  on  which sched_setscheduler and sched_getscheduler are
       available define _POSIX_PRIORITY_SCHEDULING in <unistd.h>.


RETURN VALUE
       On   success,   sched_setscheduler   returns   zero.     On    success,
       sched_getscheduler  returns  the policy for the process (a non-negative
       integer).  On error, -1 is returned, errno is set appropriately.

ERRORS
       ESRCH  The process whose ID is pid could not be found.

       EPERM  The calling process does not have appropriate  privileges.  Only
              root  processes  are  allowed  to  activate  the  SCHED_FIFO and
              SCHED_RR policies. The process calling sched_setscheduler  needs
              an effective uid equal to the euid or uid of the process identi-
              fied by pid, or it must be a superuser process.

       EINVAL The scheduling policy is not one of the recognized policies,  or
              the parameter p does not make sense for the policy.

BUGS
       As  of  linux-1.3.81,  SCHED_RR  has  not yet been tested carefully and
       might not behave exactly as described or required by POSIX.1b.

NOTE
       Standard Linux is a general-purpose operating  system  and  can  handle
       background  processes,  interactive  applications,  and  soft real-time
       applications (applications that need to usually meet timing deadlines).
       This man page is directed at these kinds of applications.

       Standard  Linux is not designed to support hard real-time applications,
       that is, applications in which deadlines (often  much  shorter  than  a
       second)  must  be  guaranteed or the system will fail catastrophically.
       Like all general-purpose operating systems, Linux is designed to  maxi-
       mize  average  case  performance  instead  of  worst  case performance.
       Linux's worst case performance for interrupt handling  is  much  poorer
       than  its average case, its various kernel locks (such as for SMP) pro-
       duce long maximum wait times, and many of its  performance  improvement
       techniques  decrease  average  time by increasing worst-case time.  For
       most situations, that's what you want, but if you truly are  developing
       a  hard real-time application, consider using hard real-time extensions
       to   Linux   such   as   RTLinux   (http://www.rtlinux.org)   or   RTAI
       (http://www.rtai.org)  or  use  a  different  operating system designed
       specifically for hard real-time applications.

SEE ALSO
       sched_setaffinity(2),     sched_getaffinity(2),      sched_setparam(2),
       sched_getparam(2),      sched_yield(2),      sched_get_priority_max(2),
       sched_get_priority_min(2), sched_rr_get_interval(2), nice(2), setprior-
       ity(2),    getpriority(2),    mlockall(2),   munlockall(2),   mlock(2),
       munlock(2)

       Programming for the real  world  -  POSIX.4  by  Bill  O.  Gallmeister,
       O'Reilly & Associates, Inc., ISBN 1-56592-074-0
       IEEE Std 1003.1b-1993 (POSIX.1b standard)
       ISO/IEC  9945-1:1996  -  This is the new 1996 revision of POSIX.1 which
       contains  in  one  single   standard   POSIX.1(1990),   POSIX.1b(1993),
       POSIX.1c(1995), and POSIX.1i(1995).


----------------------------------------------------------------------------
system 161 sched_rr_get_interval   - get the SCHED_RR interval for the named
----------------------------------------------------------------------------
  mov  eax,161
  mov  ebx,pid
  mov  ecx,tp
  int  80h

       sched_rr_get_interval writes into the timespec structure pointed to  by
       tp  the  round robin time quantum for the process identified by pid. If
       pid is zero, the time quantum for the calling process is  written  into
       *tp. The identified process should be running under the SCHED_RR sched-
       uling policy.

       The round robin time quantum value is not alterable under Linux 1.3.81.

       POSIX  systems  on  which  sched_rr_get_interval  is  available  define
       _POSIX_PRIORITY_SCHEDULING in <unistd.h>.


RETURN VALUE
       On success, sched_rr_get_interval returns 0.  On error, -1 is returned,
       and errno is set appropriately.

ERRORS
       ESRCH  The process whose ID is pid could not be found.

       ENOSYS The system call is not yet implemented.

       EINVAL Invalid pid.

       EFAULT Problem with copying information to userspace.

BUGS
       As  of  Linux  1.3.81  sched_rr_get_interval returns with error ENOSYS,
       because SCHED_RR has not yet been fully implemented  and  tested  prop-
       erly.

SEE ALSO
       sched_setscheduler(2) has a description of the Linux scheduling scheme.

----------------------------------------------------------------------------
system 241 sched_setaffinity       - get a process's CPU
----------------------------------------------------------------------------
  mov  eax,241
  mov  ebx,pid
  mov  ecx,len
  mov  edx,mask
  int  80h

       sched_setaffinity sets the CPU affinity mask of the process denoted  by
       pid.  If pid is zero, then the current process is used.

       The  affinity  mask  is represented by the bitmask stored in mask.  The
       least significant bit corresponds to the first logical processor number
       on  the  system, while the most significant bit corresponds to the last
       logical processor number on the system.  A set  bit  corresponds  to  a
       legally  schedulable CPU while an unset bit corresponds to an illegally
       schedulable CPU.  In other words, a process is bound to and  will  only
       run on processors whose corresponding bit is set.  Usually, all bits in
       the mask are set.

       The argument len is the length of the data pointed to  by  mask.   Nor-
       mally this is the size of a word on the system.  For compatibility with
       future versions of the Linux kernel, since this size  can  change,  the
       bitmask  supplied must be at least as large as the affinity mask stored
       in the kernel.

       The function sched_getaffinity writes into the pointer supplied by mask
       that  is  size  len  the affinity mask of process pid.  If pid is zero,
       then the mask of the current process is returned.


RETURN VALUE
       On success, sched_setaffinity and sched_getaffinity both return 0.   On
       error, -1 is returned, and errno is set appropriately.


ERRORS
       EFAULT A supplied memory address was invalid.

       ESRCH  The process whose ID is pid could not be found.

       EPERM  The  calling  process  does not have appropriate privileges. The
              process calling sched_setaffinity needs an effective  uid  equal
              to  the euid or uid of the process identified by pid, or it must
              possess the CAP_SYS_NICE capability.

       EINVAL The affinity bitmask mask contains no processors that are physi-
              cally  on  the system or the length len is smaller than the size
              of the affinity mask used by the kernel.

HISTORY
       The affinity syscalls were  introduced  in  Linux  kernel  2.5.8.   The
       library  calls  were  introduced  in  glibc 2.3, and are still in glibc
       2.3.2. Later glibc 2.3.2 development versions changed this interface to
       one without the len field, and still later versions reverted again. The
       glibc prototype is now

       /* Set the CPU affinity for a task */
       extern int sched_setaffinity (pid_t pid, size_t cpusetsize,
                                     const cpu_set_t *cpuset);

       /* Get the CPU affinity for a task */
       extern int sched_getaffinity (pid_t pid, size_t cpusetsize,
                                     cpu_set_t *cpuset);

SEE ALSO
       sched_setscheduler(2),     sched_getscheduler(2),      sched_get_prior-
       ity_max(2), sched_get_priority_min(2), nice(2), setpriority(2), getpri-
       ority(2),

       sched_setscheduler(2) has a description of the Linux scheduling scheme.


----------------------------------------------------------------------------
system 154 sched_setparam          - get scheduling parameters
----------------------------------------------------------------------------
  mov  eax,154
  mov  ebx,pid
  mov  ecx,p
  int  80h

       sched_setparam  sets  the  scheduling  parameters  associated  with the
       scheduling policy for the process identified by pid. If  pid  is  zero,
       then  the parameters of the current process are set. The interpretation
       of the parameter p depends on the selected policy. Currently, the  fol-
       lowing three scheduling policies are supported under Linux: SCHED_FIFO,
       SCHED_RR, and SCHED_OTHER.

       sched_setparam checks the validity of p for the  scheduling  policy  of
       the  process. The parameter p->sched_priority must lie within the range
       given by sched_get_priority_min and sched_get_priority_max.


RETURN VALUE
       On  success,  sched_setparam and sched_getparam return 0.  On error, -1
       is returned, errno is set appropriately.

ERRORS
       ESRCH  The process whose ID is pid could not be found.

       EPERM  The calling process does not have  appropriate  privileges.  The
              process  calling  sched_setparam needs an effective uid equal to
              the euid or uid of the process identified by pid, or it must  be
              a superuser process.

       EINVAL The  parameter  p does not make sense for the current scheduling
              policy.

CONFORMING TO
       POSIX.1b (formerly POSIX.4)

SEE ALSO
       sched_setaffinity(2),   sched_getaffinity(2),    sched_setscheduler(2),
       sched_getscheduler(2),    sched_get_priority_max(2),   sched_get_prior-
       ity_min(2), nice(2), setpriority(2), getpriority(2),

       sched_setscheduler(2) has a description of the Linux scheduling scheme.

----------------------------------------------------------------------------
system 156 sched_setscheduler      - get scheduling algo-
----------------------------------------------------------------------------
  mov  eax,156
  mov  ebx,pid
  mov  ecx,policy
  mov  edx,p
  int  80h

       sched_setscheduler  sets  both the scheduling policy and the associated
       parameters for the process identified by pid. If pid equals  zero,  the
       scheduler of the calling process will be set. The interpretation of the
       parameter p depends on the selected policy.  Currently,  the  following
       three  scheduling  policies  are  supported  under  Linux:  SCHED_FIFO,
       SCHED_RR, and SCHED_OTHER; their  respective  semantics  are  described
       below.


   Scheduling Policies
       The  scheduler  is  the kernel part that decides which runnable process
       will be executed by the CPU next. The Linux scheduler offers three dif-
       ferent  scheduling policies, one for normal processes and two for real-
       time applications. A static priority value sched_priority  is  assigned
       to  each  process  and this value can be changed only via system calls.
       Conceptually, the scheduler maintains a list of runnable processes  for
       each possible sched_priority value, and sched_priority can have a value
       in the range 0 to 99. In order to determine the process that runs next,
       the  Linux  scheduler  looks  for  the  non-empty list with the highest
       static priority and takes the process at the head  of  this  list.  The
       scheduling  policy  determines  for  each  process,  where  it  will be
       inserted into the list of processes with equal static priority and  how
       it will move inside this list.

       SCHED_OTHER is the default universal time-sharing scheduler policy used
       by most processes, SCHED_FIFO and SCHED_RR  are  intended  for  special
       time-critical  applications  that  need precise control over the way in
       which runnable processes are selected for execution.  Processes  sched-
       uled with SCHED_OTHER must be assigned the static priority 0, processes
       scheduled under SCHED_FIFO or SCHED_RR can have a  static  priority  in
       the  range  1 to 99. Only processes with superuser privileges can get a
       static priority higher than 0 and  can  therefore  be  scheduled  under
       SCHED_FIFO  or  SCHED_RR.  The  system calls sched_get_priority_min and
       sched_get_priority_max can be used to find out the valid priority range
       for  a  scheduling  policy in a portable way on all POSIX.1b conforming
       systems.

       All scheduling is preemptive: If a process with a higher static  prior-
       ity  gets  ready  to  run,  the  current  process will be preempted and
       returned into its wait list. The scheduling policy only determines  the
       ordering within the list of runnable processes with equal static prior-
       ity.


   SCHED_FIFO: First In-First Out scheduling
       SCHED_FIFO can only be used with static priorities higher than 0, which
       means that when a SCHED_FIFO processes becomes runnable, it will always
       preempt immediately any currently running normal  SCHED_OTHER  process.
       SCHED_FIFO  is  a simple scheduling algorithm without time slicing. For
       processes scheduled under the SCHED_FIFO policy,  the  following  rules
       are  applied:  A  SCHED_FIFO process that has been preempted by another
       process of higher priority will stay at the head of the  list  for  its
       priority  and  will resume execution as soon as all processes of higher
       priority are blocked again. When a SCHED_FIFO process becomes runnable,
       it  will be inserted at the end of the list for its priority. A call to
       sched_setscheduler  or  sched_setparam  will  put  the  SCHED_FIFO  (or
       SCHED_RR)  process identified by pid at the start of the list if it was
       runnable.  As a consequence,  it  may  preempt  the  currently  running
       process  if it has the same priority.  (POSIX 1003.1 specifies that the
       process should  go  to  the  end  of  the  list.)   A  process  calling
       sched_yield  will  be  put at the end of the list. No other events will
       move a process scheduled under the SCHED_FIFO policy in the  wait  list
       of  runnable processes with equal static priority. A SCHED_FIFO process
       runs until either it is blocked by an I/O request, it is preempted by a
       higher priority process, or it calls sched_yield.



   SCHED_RR: Round Robin scheduling
       SCHED_RR  is  a  simple enhancement of SCHED_FIFO. Everything described
       above for SCHED_FIFO also applies to SCHED_RR, except that each process
       is  only  allowed  to  run  for  a  maximum time quantum. If a SCHED_RR
       process has been running for a time period equal to or longer than  the
       time quantum, it will be put at the end of the list for its priority. A
       SCHED_RR process that has been preempted by a higher  priority  process
       and  subsequently  resumes execution as a running process will complete
       the unexpired portion of its round robin time quantum.  The  length  of
       the time quantum can be retrieved by sched_rr_get_interval.


   SCHED_OTHER: Default Linux time-sharing scheduling
       SCHED_OTHER  can only be used at static priority 0.  SCHED_OTHER is the
       standard Linux time-sharing scheduler that is  intended  for  all  pro-
       cesses  that  do  not  require special static priority real-time mecha-
       nisms. The process to run is chosen from the  static  priority  0  list
       based  on  a dynamic priority that is determined only inside this list.
       The dynamic priority is based on the nice level (set  by  the  nice  or
       setpriority  system  call)  and  increased  for  each  time quantum the
       process is ready to run, but denied  to  run  by  the  scheduler.  This
       ensures fair progress among all SCHED_OTHER processes.


   Response time
       A  blocked  high  priority  process  waiting  for the I/O has a certain
       response time before it is scheduled again. The  device  driver  writer
       can  greatly  reduce  this  response  time  by using a "slow interrupt"
       interrupt handler.


   Miscellaneous
       Child processes inherit the scheduling algorithm and parameters  across
       a fork.

       Memory  locking is usually needed for real-time processes to avoid pag-
       ing delays, this can be done with mlock or mlockall.

       As a non-blocking end-less loop in a process scheduled under SCHED_FIFO
       or  SCHED_RR  will  block  all processes with lower priority forever, a
       software developer should always keep available on the console a  shell
       scheduled  under  a higher static priority than the tested application.
       This will allow an emergency kill of tested real-time applications that
       do  not block or terminate as expected. As SCHED_FIFO and SCHED_RR pro-
       cesses can preempt other processes forever,  only  root  processes  are
       allowed to activate these policies under Linux.

       POSIX  systems  on  which sched_setscheduler and sched_getscheduler are
       available define _POSIX_PRIORITY_SCHEDULING in <unistd.h>.


RETURN VALUE
       On   success,   sched_setscheduler   returns   zero.     On    success,
       sched_getscheduler  returns  the policy for the process (a non-negative
       integer).  On error, -1 is returned, errno is set appropriately.

ERRORS
       ESRCH  The process whose ID is pid could not be found.

       EPERM  The calling process does not have appropriate  privileges.  Only
              root  processes  are  allowed  to  activate  the  SCHED_FIFO and
              SCHED_RR policies. The process calling sched_setscheduler  needs
              an effective uid equal to the euid or uid of the process identi-
              fied by pid, or it must be a superuser process.

       EINVAL The scheduling policy is not one of the recognized policies,  or
              the parameter p does not make sense for the policy.

NOTE
       Standard Linux is a general-purpose operating  system  and  can  handle
       background  processes,  interactive  applications,  and  soft real-time
       applications (applications that need to usually meet timing deadlines).
       This man page is directed at these kinds of applications.

       Standard  Linux is not designed to support hard real-time applications,
       that is, applications in which deadlines (often  much  shorter  than  a
       second)  must  be  guaranteed or the system will fail catastrophically.
       Like all general-purpose operating systems, Linux is designed to  maxi-
       mize  average  case  performance  instead  of  worst  case performance.
       Linux's worst case performance for interrupt handling  is  much  poorer
       than  its average case, its various kernel locks (such as for SMP) pro-
       duce long maximum wait times, and many of its  performance  improvement
       techniques  decrease  average  time by increasing worst-case time.  For
       most situations, that's what you want, but if you truly are  developing
       a  hard real-time application, consider using hard real-time extensions
       to   Linux   such   as   RTLinux   (http://www.rtlinux.org)   or   RTAI
       (http://www.rtai.org)  or  use  a  different  operating system designed
       specifically for hard real-time applications.

SEE ALSO
       sched_setaffinity(2),     sched_getaffinity(2),      sched_setparam(2),
       sched_getparam(2),      sched_yield(2),      sched_get_priority_max(2),
       sched_get_priority_min(2), sched_rr_get_interval(2), nice(2), setprior-
       ity(2),    getpriority(2),    mlockall(2),   munlockall(2),   mlock(2),
       munlock(2)

----------------------------------------------------------------------------
system 158 sched_yield             - yield the processor
----------------------------------------------------------------------------
  mov  eax,158
  int  80h

       A  process can relinquish the processor voluntarily without blocking by
       calling sched_yield.  The process will then be moved to the end of  the
       queue for its static priority and a new process gets to run.

       Note:  If the current process is the only process in the highest prior-
       ity list at that time, this process will continue to run after  a  call
       to sched_yield.

       POSIX  systems  on  which sched_yield is available define _POSIX_PRIOR-
       ITY_SCHEDULING in <unistd.h>.


RETURN VALUE
       On success, sched_yield returns 0.  On error, -1 is returned, and errno
       is set appropriately.


SEE ALSO
       sched_setscheduler(2) for a description of Linux scheduling.

----------------------------------------------------------------------------
system 121 setdomainname           - get/set domain name
----------------------------------------------------------------------------
  mov  eax,121
  mov  ebx,domainName
  mov  ecx,len
  int  80h

       This function is used to access the domain name of the
       current processor.

RETURN VALUE
       On success, zero is returned.  On error, -1 is returned, and  errno  is
       set appropriately.

ERRORS
       EINVAL For  getdomainname  under  libc:  name is NULL or name is longer
              than len bytes.

       EINVAL For setdomainname: len was negative or too large.

       EPERM  For setdomainname: the caller was not the superuser.

       EFAULT For setdomainname: name pointed outside of user address space.

SEE ALSO
       gethostname(2), sethostname(2), uname(2)


----------------------------------------------------------------------------
system  74 sethostname             - set host name 
----------------------------------------------------------------------------
  mov  eax,074
  mov  ebx,theName
  mov  ecx,len
  int  80h

       This  function changes the domain name of the
       current processor.

RETURN VALUE
       On success, zero is returned.  On error, -1 is returned, and  errno  is
       set appropriately.

ERRORS
       EINVAL For  getdomainname  under  libc:  name is NULL or name is longer
              than len bytes.

       EINVAL For setdomainname: len was negative or too large.

       EPERM  For setdomainname: the caller was not the superuser.

       EFAULT For setdomainname: name pointed outside of user address space.

CONFORMING TO
       POSIX does not specify these calls.

SEE ALSO
       gethostname(2), sethostname(2), uname(2)


----------------------------------------------------------------------------
system  75 setrlimit               - set resource limits and usage
----------------------------------------------------------------------------
  mov  eax,075
  mov  ebx,resource
  mov  ecx,rlim
  int  80h

       setrlimit sets resource limits.  Each
       resource has an associated soft and  hard  limit,  as  defined  by  the
       rlimit  structure  (the  rlim  argument)

            struct rlimit {
                rlim_t rlim_cur;   /* Soft limit */
                rlim_t rlim_max;   /* Hard limit (ceiling
                                      for rlim_cur) */
            };

       The soft limit is the value that the kernel  enforces  for  the  corre-
       sponding  resource.   The  hard  limit  acts  as a ceiling for the soft
       limit: an unprivileged process may only set its soft limit to  a  value
       in  the range from 0 up to the hard limit, and (irreversibly) lower its
       hard limit.  A privileged process may make arbitrary changes to  either
       limit value.

       The  value  RLIM_INFINITY  denotes  no limit on a resource (both in the
       structure returned by getrlimit() and in the structure passed to  setr-
       limit()).

       resource must be one of:

       RLIMIT_AS
              The maximum size of the process's virtual memory (address space)
              in bytes.  This limit  affects  calls  to  brk(2),  mmap(2)  and
              mremap(2),  which fail with the error ENOMEM upon exceeding this
              limit. Also automatic stack expansion will fail (and generate  a
              SIGSEGV  that kills the process when no alternate stack has been
              made available).  Since the value is a long, on machines with  a
              32-bit long either this limit is at most 2 GiB, or this resource
              is unlimited.

       RLIMIT_CORE
              Maximum size of core file. When 0 no core dump  files  are  cre-
              ated.  When nonzero, larger dumps are truncated to this size.

       RLIMIT_CPU
              CPU  time  limit  in seconds.  When the process reaches the soft
              limit, it is sent a SIGXCPU signal.  The default action for this
              signal  is to terminate the process.  However, the signal can be
              caught, and the handler can return control to the main  program.
              If  the  process  continues to consume CPU time, it will be sent
              SIGXCPU once per second until the  hard  limit  is  reached,  at
              which  time  it  is  sent SIGKILL.  (This latter point describes
              Linux 2.2 and 2.4 behaviour.  Implementations vary in  how  they
              treat  processes which continue to consume CPU time after reach-
              ing the soft limit.  Portable applications that  need  to  catch
              this  signal  should  perform  an orderly termination upon first
              receipt of SIGXCPU.)

       RLIMIT_DATA
              The maximum size of  the  process's  data  segment  (initialized
              data,  uninitialized  data, and heap).  This limit affects calls
              to brk() and sbrk(), which  fail  with  the  error  ENOMEM  upon
              encountering the soft limit of this resource.

       RLIMIT_FSIZE
              The maximum size of files that the process may create.  Attempts
              to extend a file beyond this  limit  result  in  delivery  of  a
              SIGXFSZ  signal.   By default, this signal terminates a process,
              but a process can catch this signal instead, in which  case  the
              relevant  system call (e.g., write(), truncate()) fails with the
              error EFBIG.

       RLIMIT_LOCKS
              A limit on the combined number  of  flock()  locks  and  fcntl()
              leases that this process may establish.  (Early Linux 2.4 only.)

       RLIMIT_MEMLOCK
              The maximum number of bytes of virtual memory that may be locked
              into RAM using mlock() and mlockall().

       RLIMIT_NOFILE
              Specifies  a  value one greater than the maximum file descriptor
              number that can be opened by this  process.   Attempts  (open(),
              pipe(),  dup(),  etc.)   to  exceed  this  limit yield the error
              EMFILE.

       RLIMIT_NPROC
              The maximum number of processes that can be created for the real
              user  ID  of the calling process.  Upon encountering this limit,
              fork() fails with the error EAGAIN.

       RLIMIT_RSS
              Specifies the limit (in pages) of  the  process's  resident  set
              (the  number of virtual pages resident in RAM).  This limit only
              has effect in Linux 2.4 onwatrds, and there only  affects  calls
              to madvise() specifying MADVISE_WILLNEED.

       RLIMIT_STACK
              The  maximum size of the process stack, in bytes.  Upon reaching
              this limit, a SIGSEGV signal is generated.  To handle this  sig-
              nal,  a  process  must employ an alternate signal stack (sigalt-
              stack(2)).

       RLIMIT_OFILE is the BSD name for RLIMIT_NOFILE.

RETURN VALUE
       On  success,  zero is returned.  On error, -1 is returned, and errno is
       set appropriately.

ERRORS
       EFAULT rlim or usage points outside the accessible address space.

       EINVAL getrlimit or  setrlimit  is  called  with  a  bad  resource,  or
              getrusage is called with a bad who.

       EPERM  A non-superuser tries to use setrlimit() to increase the soft or
              hard limit above the current hard limit, or a superuser tries to
              increase RLIMIT_NOFILE above the current kernel maximum.

NOTE
       Including <sys/time.h> is not required these days, but increases porta-
       bility.  (Indeed, struct timeval is defined in <sys/time.h>.)

       On Linux, if the disposition of SIGCHLD is  set  to  SIG_IGN  then  the
       resource  usages  of  child processes are automatically included in the
       value returned by RUSAGE_CHILDREN, although POSIX  1003.1-2001  explic-
       itly prohibits this.

       The above struct was taken from BSD 4.3 Reno.  Not all fields are mean-
       ingful under Linux.   Right  now  (Linux  2.4,  2.6)  only  the  fields
       ru_utime,  ru_stime, ru_minflt, ru_majflt, and ru_nswap are maintained.

SEE ALSO
       dup(2), fcntl(2), fork(2),  mlock(2),  mlockall(2),  mmap(2),  open(2),
       quotactl(2),  sbrk(2),  wait3(2),  wait4(2), malloc(3), ulimit(3), sig-
       nal(7)


----------------------------------------------------------------------------
system 102 socketcall              - socket system calls
----------------------------------------------------------------------------
  mov  eax,102
  mov  ebx,callop
  mov  ecx,args
  int  80h

       socketcall  is a common kernel entry point for the socket system calls.
       call determines which socket function to  invoke.   args  points  to  a
       block  containing the actual arguments, which are passed through to the
       appropriate call.

       User programs should call the  appropriate  functions  by  their  usual
       names.   Only  standard library implementors and kernel hackers need to
       know about socketcall.

CONFORMING TO
       This call is specific to Linux, and should  not  be  used  in  programs
       intended to be portable.

SEE ALSO
       accept(2),  bind(2),  connect(2),  getpeername(2), getsockname(2), get-
       sockopt(2), listen(2), recv(2), recvfrom(2), send(2),  sendto(2),  set-
       sockopt(2), shutdown(2), socket(2), socketpair(2)


----------------------------------------------------------------------------
system 149 sysctl                  - read/write system parameters
----------------------------------------------------------------------------
  mov  eax,149
  mov  ebx,args
  int  80h

       The  _sysctl  call  reads and/or writes kernel parameters. For example,
       the hostname, or the maximum number of open files. The argument has the
       form

       struct __sysctl_args {
               int *name;        /* integer vector describing variable */
               int nlen;         /* length of this vector */
               void *oldval;     /* 0 or address where to store old value */
               size_t *oldlenp;  /* available room for old value,
                                    overwritten by actual size of old value */
               void *newval;     /* 0 or address of new value */
               size_t newlen;    /* size of new value */
       };

       This  call  does  a  search  in a tree structure, possibly resembling a
       directory tree under /proc/sys, and if  the  requested  item  is  found
       calls some appropriate routine to read or modify the value.


EXAMPLE
       #include <linux/unistd.h>
       #include <linux/types.h>
       #include <linux/sysctl.h>

       _syscall1(int, _sysctl, struct __sysctl_args *, args);
       int sysctl(int *name, int nlen, void *oldval, size_t *oldlenp,
                  void *newval, size_t newlen)
       {
               struct __sysctl_args args={name,nlen,oldval,oldlenp,newval,newlen};
               return _sysctl(&args);
       }

       #define SIZE(x) sizeof(x)/sizeof(x[0])
       #define OSNAMESZ 100

       char osname[OSNAMESZ];
       int osnamelth;
       int name[] = { CTL_KERN, KERN_OSTYPE };

       main(){
               osnamelth = sizeof(osname);
               if (sysctl(name, SIZE(name), osname, &osnamelth, 0, 0))
                       perror("sysctl");
               else
                       printf("This machine is running %*s\n", osnamelth, osname);
               return 0;
       }


RETURN VALUE
       Upon successful completion, _sysctl returns 0. Otherwise, a value of -1
       is returned and errno is set to indicate the error.

ERRORS
       ENOTDIR
              name was not found.

       EPERM  No search permission for one of the  encountered  `directories',
              or no read permission where oldval was nonzero, or no write per-
              mission where newval was nonzero.

       EFAULT The invocation asked for the previous value  by  setting  oldval
              non-NULL, but allowed zero room in oldlenp.

CONFORMING TO
       This  call  is  Linux-specific,  and  should  not  be  used in programs
       intended to be portable.  A sysctl call has been present in Linux since
       version  1.3.57.  It originated in 4.4BSD. Only Linux has the /proc/sys
       mirror, and the object naming schemes differ between Linux and BSD 4.4,
       but the declaration of the sysctl(2) function is the same in both.

BUGS
       The  object names vary between kernel versions.  THIS MAKES THIS SYSTEM
       CALL WORTHLESS FOR APPLICATIONS.  Use the /proc/sys interface  instead.
       Not all available objects are properly documented.
       It  is  not  yet  possible  to  change  operating  system by writing to
       /proc/sys/kernel/ostype.

SEE ALSO
       proc(5)



----------------------------------------------------------------------------
system 116 sysinfo                 - returns information on overall system statistics
----------------------------------------------------------------------------
  mov  eax,116
  mov  ebx,info
  int  80h

  linux.sysinfo used to return information in the following structure:
  struc sysinfo_t:
  uptime dword
  loads dword
  totalram dword
  freeram dword
  shardram dword
  bufferram dword
  totalswap dword
  freeswap dword
  procs dw
  endstruc

       Until Linux 2.3.16, sysinfo used to return information in the following
       structure:

              struct sysinfo {
                   long uptime;             /* Seconds since boot */
                   unsigned long loads[3];  /* 1, 5, and 15 minute load averages */
                   unsigned long totalram;  /* Total usable main memory size */
                   unsigned long freeram;   /* Available memory size */
                   unsigned long sharedram; /* Amount of shared memory */
                   unsigned long bufferram; /* Memory used by buffers */
                   unsigned long totalswap; /* Total swap space size */
                   unsigned long freeswap;  /* swap space still available */
                   unsigned short procs;    /* Number of current processes */
                   char _f[22];             /* Pads structure to 64 bytes */
              };

       and the sizes were given in bytes. Since Linux  2.3.23  (i386),  2.3.48
       (all architectures) the structure is

              struct sysinfo {
                   long uptime;             /* Seconds since boot */
                   unsigned long loads[3];  /* 1, 5, and 15 minute load averages */
                   unsigned long totalram;  /* Total usable main memory size */
                   unsigned long freeram;   /* Available memory size */
                   unsigned long sharedram; /* Amount of shared memory */
                   unsigned long bufferram; /* Memory used by buffers */
                   unsigned long totalswap; /* Total swap space size */
                   unsigned long freeswap;  /* swap space still available */
                   unsigned short procs;    /* Number of current processes */
                   unsigned long totalhigh; /* Total high memory size */
                   unsigned long freehigh;  /* Available high memory size */
                   unsigned int mem_unit;   /* Memory unit size in bytes */
                   char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding for libc5 */
              };

       and the sizes are given as multiples of mem_unit bytes.

       sysinfo  provides  a  simple  way of getting overall system statistics.
       This is more portable than reading /dev/kmem.  For an  example  of  its
       use, see intro(2).

RETURN VALUE
       On  success,  zero is returned.  On error, -1 is returned, and errno is
       set appropriately.

ERRORS
       EFAULT pointer to struct sysinfo is invalid

CONFORMING TO
       This function is Linux-specific, and should not  be  used  in  programs
       intended to be portable.

       The  Linux kernel has a sysinfo system call since 0.98.pl6.  Linux libc
       contains a sysinfo() routine since 5.3.5, and glibc has one since 1.90.

SEE ALSO
       proc(5)


----------------------------------------------------------------------------
system 103 syslog                  - read  and/or clear kernel message ring buffer; set
----------------------------------------------------------------------------
  mov  eax,103
  mov  ebx,theType
  mov  ecx,bufp
  mov  edx,len
  int  80h

       The type argument determines the action taken by this function.

       Quoting from kernel/printk.c:
       /*
        * Commands to sys_syslog:
        *
        *      0 -- Close the log.  Currently a NOP.
        *      1 -- Open the log. Currently a NOP.
        *      2 -- Read from the log.
        *      3 -- Read up to the last 4k of messages in the ring buffer.
        *      4 -- Read and clear last 4k of messages in the ring buffer
        *      5 -- Clear ring buffer.
        *      6 -- Disable printk's to console
        *      7 -- Enable printk's to console
        *      8 -- Set level of messages printed to console
        *      9 -- Return number of unread characters in the log buffer
        */

       Only  function  3  is  allowed  to non-root processes.  (Function 9 was
       added in 2.4.10.)

       The kernel log buffer
       The kernel has a cyclic  buffer  of  length  LOG_BUF_LEN  (4096,  since
       1.3.54:  8192,  since 2.1.113: 16384; in recent kernels the size can be
       set at compile time) in which messages given as argument to the  kernel
       function printk() are stored (regardless of their loglevel).

       The  call  syslog  (2,buf,len)  waits  until  this kernel log buffer is
       nonempty, and then reads at most len bytes  into  the  buffer  buf.  It
       returns  the  number  of  bytes read. Bytes read from the log disappear
       from the log buffer: the information can only be read  once.   This  is
       the  function  executed  by  the  kernel  when  a  user  program  reads
       /proc/kmsg.

       The call syslog (3,buf,len) will read the last len bytes from  the  log
       buffer (nondestructively), but will not read more than was written into
       the buffer since the last `clear ring buffer' command (which  does  not
       clear the buffer at all).  It returns the number of bytes read.

       The  call syslog (4,buf,len) does precisely the same, but also executes
       the `clear ring buffer' command.

       The call syslog (5,dummy,idummy) only executes the `clear ring  buffer'
       command.

       The loglevel
       The  kernel  routine printk() will only print a message on the console,
       if it has  a  loglevel  less  than  the  value  of  the  variable  con-
       sole_loglevel (initially DEFAULT_CONSOLE_LOGLEVEL (7), but set to 10 if
       the kernel commandline contains the word `debug', and to 15 in case  of
       a  kernel  fault  - the 10 and 15 are just silly, and equivalent to 8).
       This variable is set (to a value in the range 1-8) by the  call  syslog
       (8,dummy,value).   The calls syslog (type,dummy,idummy) with type equal
       to 6 or 7, set it to 1 (kernel panics only) or 7 (all except  debugging
       messages), respectively.

       Every  text  line  in  a  message  has  its own loglevel. This level is
       DEFAULT_MESSAGE_LOGLEVEL - 1 (6) unless the line starts with <d>  where
       d  is  a digit in the range 1-7, in which case the level is d. The con-
       ventional meaning of the loglevel is  defined  in  <linux/kernel.h>  as
       follows:

       #define KERN_EMERG    "<0>"  /* system is unusable               */
       #define KERN_ALERT    "<1>"  /* action must be taken immediately */
       #define KERN_CRIT     "<2>"  /* critical conditions              */
       #define KERN_ERR      "<3>"  /* error conditions                 */
       #define KERN_WARNING  "<4>"  /* warning conditions               */
       #define KERN_NOTICE   "<5>"  /* normal but significant condition */
       #define KERN_INFO     "<6>"  /* informational                    */
       #define KERN_DEBUG    "<7>"  /* debug-level messages             */


RETURN VALUE
       In case of error, -1 is returned, and errno is set. Otherwise, for type
       equal to 2, 3 or 4, syslog() returns the number of bytes read, and oth-
       erwise 0.

ERRORS
       EPERM  An attempt was made to change console_loglevel or clear the ker-
              nel message ring buffer by a process without root permissions.

       EINVAL Bad parameters.

       ERESTARTSYS
              System call was interrupted by a  signal  -  nothing  was  read.
              (This can be seen only during a trace.)

CONFORMING TO
       This  system  call is Linux specific and should not be used in programs
       intended to be portable.

NOTES
       From the very start people noted that it  is  unfortunate  that  kernel
       call  and  library routine of the same name are entirely different ani-
       mals.  In libc4 and libc5 the  number  of  this  call  was  defined  by
       SYS_klog.  In glibc 2.0 the syscall is baptised klogctl.


SEE ALSO
       syslog(3)

----------------------------------------------------------------------------
system  58 ulimit                  - UNIMPLEMENTED
----------------------------------------------------------------------------

----------------------------------------------------------------------------
system 122 uname                   - get name and information about current kernel
----------------------------------------------------------------------------
???
  mov  eax,109
  mov  ebx,buf
  int  80h

  linux.uname returns system information in the structure pointed to by
  buf.

  struc utsname:
  sysname :char[65];
  nodename :char[65];
  release :char[65];
  version :char[65];
  machine :char[65];
  domainname :char[65];
  endstruc

  mov  eax,122
  mov  ebx,name
  int  80h

       uname  returns  system  information in the structure pointed to by buf.
       The utsname struct is defined in <sys/utsname.h>:
              struct utsname {
                      char sysname[];
                      char nodename[];
                      char release[];
                      char version[];
                      char machine[];
              #ifdef _GNU_SOURCE
                      char domainname[];
              #endif
              };
       The length of the arrays in a struct utsname is unspecified; the fields
       are NUL-terminated.

RETURN VALUE
       On  success,  zero is returned.  On error, -1 is returned, and errno is
       set appropriately.

ERRORS
       EFAULT buf is not valid.

CONFORMING TO
       SVr4, SVID, POSIX, X/OPEN.  There is no uname call in BSD 4.3.

       The domainname member (the NIS or YP domain name) is a GNU extension.

NOTES
       This is a system call, and the operating system  presumably  knows  its
       name, release and version. It also knows what hardware it runs on.  So,
       four of the fields of the struct are meaningful.  On  the  other  hand,
       the  field  nodename  is  meaningless: it gives the name of the present
       machine in some undefined network, but typically machines are  in  more
       than  one  network  and have several names. Moreover, the kernel has no
       way of knowing about such things, so it has to be told what  to  answer
       here.  The same holds for the additional domainname field.

       To  this  end Linux uses the system calls sethostname(2) and setdomain-
       name(2).  Note that there is no standard that says  that  the  hostname
       set  by  sethostname(2) is the same string as the nodename field of the
       struct returned by uname (indeed, some systems allow a  256-byte  host-
       name and an 8-byte nodename), but this is true on Linux. The same holds
       for setdomainname(2) and the domainname field.

       The length of the fields in the struct varies. Some  operating  systems
       or  libraries  use  a hardcoded 9 or 33 or 65 or 257. Other systems use
       SYS_NMLN or _SYS_NMLN or UTSLEN or _UTSNAME_LENGTH. Clearly,  it  is  a
       bad  idea  to use any of these constants - just use sizeof(...).  Often
       257 is chosen in order to have room for an internet hostname.

       There have been three Linux system calls uname(). The  first  one  used
       length  9,  the second one used 65, the third one also uses 65 but adds
       the domainname field.

       Part of the utsname information is also accessible via sysctl  and  via
       /proc/sys/kernel/{ostype, hostname, osrelease, version, domainname}.

SEE ALSO
       uname(1), getdomainname(2), gethostname(2)


----------------------------------------------------------------------------
system  86 uselib                  - select shared library
----------------------------------------------------------------------------
  mov  eax,086
  mov  ebx,library
  int  80h

       uselib selects the shared library binary that will be used by the call-
       ing process.

RETURN VALUE
       On success, zero is returned.  On error, -1 is returned, and  errno  is
       set appropriately.

ERRORS
       In  addition to all of the error codes returned by open(2) and mmap(2),
       the following may also be returned:


       ENOEXEC
              The file specified by library is not  executable,  or  does  not
              have the correct magic numbers.

       EACCES The library specified by library is not readable.

CONFORMING TO
       uselib() is Linux specific, and should not be used in programs intended
       to be portable.

SEE ALSO
       ar(1), gcc(1), ld(1), ldd(1), mmap(2), open(2), ld.so(8)


----------------------------------------------------------------------------
system 166 vm86                    - enter virtual 8086 mode
----------------------------------------------------------------------------
  // vm86 - vm86 call for DOS emu.

       The  system  call  vm86 was introduced in Linux 0.97p2. In Linux 2.1.15
       and 2.0.28 it was renamed to vm86old, and a new  vm86  was  introduced.
       The  definition of `struct vm86_struct' was changed in 1.1.8 and 1.1.9.

       These calls cause the process to enter VM86 mode (virtual-8086 in Intel
       literature), and are used by dosemu.

       VM86 mode is an emulation of real mode within a protected mode task.

RETURN VALUE
       On  success,  zero is returned.  On error, -1 is returned, and errno is
       set appropriately.

ERRORS
       EPERM  Saved kernel stack exists. (This is a kernel sanity  check;  the
              saved stack should only exist within vm86 mode itself.)

       EFAULT This  return  value  is specific to i386 and indicates a problem
              with getting userspace data.

       ENOSYS This return value indicates the call is not implemented  on  the
              present architecture.

CONFORMING TO
       This  call  is specific to Linux on Intel processors, and should not be
       used in programs intended to be portable.


----------------------------------------------------------------------------
system 113 vm86old                 - enter virtual 8086 mode
----------------------------------------------------------------------------
