|                                                                                                        |

Copyright © h-peter recktenwald, berlin, 2000 - free for any related work and, non-commercial distribution.
text mode (Lynx, Printer) tables arranged to 110 chars/line.


 

[intro] [a:index] [s:index] [#:index] [sys_fcntl]
[1..64] [65..128] [129..192] [193..256] [257..] [ref] [struc] [fcntl] [ioctl] [pguide] [man2]
[next] [back] [linux] [main] [bot] [top]
Syscalls pages archive (110K->1M), updated (2.3.0, ver. 1.66) man 2 pages (170K->1,2M)

 







 

  1.   delete_module const char *name           129  
      remove a loadable module entry
      arg eax 129
        ebx ptr to <nul>-terminated module name
      return eax -/-
      errors eax busy, fault, inval, noent, perm
      ref linux/module.h
  2.  



  3.   get_kernel_syms 130  
      retrieve exported kernel & modules symbols
      arg eax130 
      ebx ptr to struct kernel_sym or,
      ebx NULL to receiving the no. of entries w/o retrieving any data
      return eax int no. of sysmbols received
      errors eax -none-
      ref linux/module.h  
  4.  



  5.   quotactl int cmd c ch *special int id caddr_t addr     131  
      manipulate disk quota
      return -/-
      errors  
      ref sys/types.h, sys/quota.h, linux/quota.h
  6.  


  7.   getpgid pid_t pid           132  
      get process group id
      return pid_t id
      errors inval, perm, srch
         
  8.  


  9.   fchdir int fd           133  
      change working directory
      return -/-
      errors (fs & permissions)
         
  10.  


  11.   bdflush int func long *address / data         134  
      start, flush, or tune buffer-dirty-flush daemon
      return (dependent on func)
      errors busy, fault, inval, perm
      src fs/buffer.c  
         
  12.  


  13.   sysfs int option,  ulong arg1,  ulong arg2       135  
      get filing system type information
      arg eax135 
      ebx  option  1: fstype index by fs-name @arg1
    2: fs-name @arg2 by fstype-index arg1
    3: no. of known file system types
      ecx  opt 1: ptr to string;
    opt 2: fstype index
      edx  opt 2: ptr to string buffer
      return eax  according to 'option':

    1: fstype index
    2: 0, see below note!
    3: number of known file system types
      errors  fault, inval
      ref  include/linux/fs.h
      src  fs/super.c
      note  due to the utter brillancy of those kernel 'developers'
    there is no means to predicting the buffer size requirements...
  14.  


  15.   personality unsigned long persona           136  
      set process execution domain
      return int previous persona
      errors inval
      ref linux/personality.h
  16.  


  17.   afs_syscall             137  
         n.i.
  18.  


  19.   setfsuid uid_t fsuid           138  
      set user id for f.s. checks
      return int previous fsuid
      errors perm
         
  20.  


  21.   setfsgid uid_t fsgid           139  
      set group id for f.s. checks
      return int previous fsgid
      errors -/-
         
  22.  



  23.   llseek 140  
      reposition r/w file-ptr by offset (lseek for large files)
      arg eax140 
      ebx uint fd  
      ecxulong disp.hi 
      edx ulong disp.lo  
      esi loff_t *res,  ptr to double dword new fpos
      ediuint wh,  file pointer reference type
      return esi ptr to big endian ordered double dword file-ptr position
      errors eax badf, inval
      ref fs/read_write.c
    max. file size in ext2 fs, pre-2.4.-kernel, is 2G bytes, i.e. disp-hi := 0.
      note passed disp such that filepointer would become -ve is an error, 'inval'.
  24.  



  25.   getdents 141  
      get directory entries
      arg eax 141  
      ebx uint fd  
      ecx struct dirent *dirp  
      edx uint count  
      return eax no. of bytes read
      errors   badf, fault, inval, noent, notdir
      ref unistd.h, linux/dirent.h, linux/unistd.h
    NOTE: False description of <struct dirent> in man 2 de getdents:
    2nd item, "d_off", is offset from beginning of directory file to concerning entry.
  26.  



  27.   newselect K4:select 142  
      watch i/o events and exceptions at selected filedescriptors w. timeout
      arg eax142 
      ebxuint top fd number + 1,up to FILE_MAX
      ecxzero or, ptr to fd bitfield for input;  
      edxzero or, ptr to fd bitfield for output;  
      esizero or, ptr to fd bitfield for exceptions;  
      edizero or, ptr to timeout values by timeval array;  
      return eax no. of set fd-s or, zero after timeout.
          bitfield and timeval data may unpredictably be modified by syscall.
      errors eax badf: false fd bit set in a bitmask, intr: un-blocked signal received,
    inval: false top fd no., nomem: no memory for internal workspace
      ref arch/i386/kernel/sys_i386.c
    fdset files bitmask, timeval timeout data array; oldselect
    a simple example, man 2 select_tut  
    NOTE:
    • ptr to an fdset bitfield
      • bit-position of fd number wrt the bitfields base address, set for being watched,
      • rsp mode will be ignored if ptr = zero.
      • read the FILE_MAX kernel constant, max. of open files, from "/proc/sys/fs/file-max"
    • ptr to timeval
      • zero timeout returns immediately,
      • infinite blocking if ptr to timeval array = zero,
      • -ve timeout returns INVAL.
  28.  



  29.   flock int fd int operation         143  
      change file (advisory) locking
      return -/-
      errors wouldnoblock
      ref linux/Documentation/.../locks.txt & mandatory.txt
  30.  


  31.   msync 144  
      synchronize mapped file with memory
      arg eax144 
      ebxrange base address 
      ecxsize of range to synchronize  
      edxzero or flag MS_ASYNC, MS_SYNC, MS_INVALIDATE  
      return eax -/-
      errors eax fault (mem not mapped), inval (ptr un-aligned or, false flag-bits)
      ref unistd.h, sys/mman.h, asm/mman.h, linux/mman.h, mm/filemap.c
  32.  



  33.   readv int fd const struct iovec *vector int count       145  
      read a vector
      return -/-
      errors (file access)
      ref sys/uio.h, linux/uio.h
  34.  


  35.   writev int fd const struct iovec *vector int count       146  
      write a vector
      return -/-
      errors (file access)
      ref sys/uio.h, linux/uio.h
  36.  


  37.   getsid pid_t pid           147  
      get session id of calling process
      return int p
      errors srch
         
  38.  


  39.   fdatasync int fd           148  
      flush file's data buffers to disk (meta data not syncronized)
      return -/-
      source /usr/src/linux/fs/buffer.c
      errors badf, inval, io, rofs
  40.  


  41.   sysctl struct sysctl_args *args           149  
      read/write system parameters, device control
      return  data returned to args struc
      errors  notdir, perm, fault
      ref linux/sysctl.h, kernel/sysctl.c
        should be, rarely is,
    further be documented in man 4 sections concerned
  42.  


  43.   mlock const void *addr size_t len         150  
      disable locking for selected memory areae
      return -/-
      errors inval, nomem, perm; no changes to memory locks
      ref sys/mman.h, asm/mman.h, linux/mman.h
  44.  


  45.   munlock const void *addr size_t len         151  
      re-enable paging for selected memory areae
      return -/-
      errors inval, nomem; no changes to memory locks
      ref sys/mman.h, asm/mman.h, linux/mman.h
  46.  


  47.   mlockall int flags           152  
      disable paging for calling process
      return -/-
      errors inval, nomem, perm
      ref sys/mman.h, asm/mman.h, linux/mman.h
  48.  


  49.   munlockall void           153  
      re-enable paging for calling process
      return -/-
      errors -/-
      ref sys/mman.h, asm/mman.h, linux/mman.h
  50.  


  51.   sched_setparam pid_t pid const struct sched_param *p         154  
      set scheduling parameters
      return -/-
      errors perm, srch
      ref linux/sched.h
      note 'root' access rights or, equal to the specified process' (e)uid of calling process required.
  52.  


  53.   sched_getparam pid_t pid struct sched_param *p         155  
      get scheduling parameters
      return -/-
      errors perm, srch
      ref linux/sched.h
  54.  


  55.   sched_setscheduler pid_t pid int policy c struct sched_param *p       156  
      set scheduling algorithm/parameters
      return -/-
      errors perm, srch
      ref linux/sched.h
      note only a 'root' process can modify scheduling 'policy' to a more demanding
    mode, other than default time sharing (SHED_OTHER).
  56.  


  57.   sched_getscheduler pid_t pid         157  
      get scheduling algorithm/parameters
      return uint policy
      errors perm, srch
      ref linux/sched.h
  58.  


  59.   sched_yield void           158  
      relinquish (yield) processor without blocking
      return -/-
      errors -/-
      ref linux/sched.h
  60.  


  61.   sched_get_priority_max int policy           159  
      get static priority range
      return int max priority for specified policy
      errors inval
      ref linux/sched.h
  62.  


  63.   sched_get_priority_min int policy           160  
      get static priority range
      return int min priority for specified policy
      errors inval
      ref linux/sched.h
  64.  


  65.   sched_rr_get_interval pid_t pid struct timespec *tp         161  
      get round robin time quantum for specified process or caller (pid=0)
      return -/-
      errors nosys, srch
      ref linux/sched.h
  66.  


  67. nanosleep 162  
      suspend caller's execution for a specified time, w/ nanoseconds resolution.
      arg eax 162  
      ebx ptr to struct timespec w/ delay timing values.
      ecx ptr to alterable struct timespec.  
      return eax zero or error code: intr, inval.
        ecx data-field in case of early termination receives remaining time
      ref linux/time.h
  68.  



  69.   mremap 163  
      remap virtual memory address
      arg  eax  163  
      ebx  old address, base address of current mapping
      ecx  size of range to re-map.  
      edx  requested size.  
      esi  flags: MREMAP_MAYMOVE ( = 1 ) or, zero;  
     K4     MREMAP_FIXED ( = 2, ).  
     K4  edi  new address, if MREMAP_FIXED flag specified. base address of new mapping
      return  eax  int ptr to (new) virtual memory area. ptr may be -ve,
    errors coded in range 0xfffff000 < eax <= 0xffffffff.
      errors  eax  again, fault, inval, nomem
      ref unistd.h, sys/mman.h, asm/mman.h, linux/mman.h; mm/mremap.c, mm/filemap.c
      note the man-page very shortly notes that 'mremap' provides for an efficient 'realloc'
    scheme, an example to which can be found in the "F4" fig-Forth implementation.
  70.  



  71.   setresuid uid_t ruid uid_t euid uid_t suid       164  
      set real, effective, saved user id
      return -/-
      errors perm
      ref kernel/sys.c, unistd.h
  72.  


  73.   getresuid uid_t *ruid uid_t *euid uid_t *suid       165  
      get real, effective, saved user id
      return -/-
      errors fault
      ref kernel/sys.c, unistd.h
  74.  


  75.   vm86 u long fn struct vm86plus_struct *v86         166  
      enter virtual 8086 mode
      arg eax 166  
      ebx function code
      ecx ptr to vm86plus_struct
      ret eax  value depends on function fn
      errors eax   
      ref kernel/vm86.c, asm/vm86.h,
    xfree86/int10/ of X-windows sources, INT10.HOWTO,
    libvga "lrmi" directory, dosemu sources.
  76.  


  77.   query_module c ch *name int which v *buf size_t bufsize zize_t *ret   167  
      query kernel for various bits pertaining to module
      return -/-
      errors fault, inval, noent, nospc
      ref linux/module.h
  78.  


  79.   poll struct pollfd *ufd ui nfds int timeout       168  
      wait for event(s) on a file descriptor
      return int structure no. (dependent on events in *ufds)
      errors fault, intr, nomem
      ref asm/poll.h, linux/poll.h, sys/poll.h
  80.  


  81.   nfsservctl int cmd struct nfsctl_arg *argp union nfsctl_res *resp       169  
      interface to kernel nfs daemon
      return -/-
      errors -/-
      ref nfsd/syscall.h
  82.  


  83.   setresgid gid_t rgid gid_t egid gid_t sgid     170  
      set real, effective, saved group id
      return -/-
      errors perm
      ref kernel/sys.c, unistd.h
  84.  


  85.   getresgid uid_t *rgid uid_t *egid uid_t *sgid       171  
      get real, effective, saved group id
      return  
      errors  
         
  86.  


  87.   prctl int option ul arg2 ul arg3 ul arg4 ul arg5   172  
      operations on a process
      arg ebx flags - K4: PR_SET_PDEATHSIG, PR_GET_PDETSIG
      ecx ptr to bit-array of signal numbers affected, sigset_t
      return eax ptr to big endian ordered double dword file-ptr position
      errors inval, fault, intr
      ref linux/prctl.h; -re- sigaction, [more]
      source kernel/sys.c
  88.  



  89.   rt_sigreturn             173  
      (kernel routine)
      return  
      errors  
      ref syscall used in [glibc]
      source kernel/signal.c, [more]
  90.  


  91.   rt_sigaction int signum, c struct sigaction *act, struct sigaction *oldact       174  
     
      return  
      errors  
      ref syscall used in [glibc]
      source kernel/signal.c, [more]
  92.  


  93.   rt_sigprocmask             175  
      (kernel routine)
      return  
      errors  
      ref syscall used in [glibc]
      source kernel/signal.c, [more]
  94.  


  95.   rt_sigpending             176  
      (kernel routine)
      return  
      errors  
      ref syscall used in [glibc]
      source kernel/signal.c, [more]
  96.  


  97.   rt_sigtimedwait             177  
      (kernel routine)
      return  
      errors  
      ref syscall used in [glibc]
      source kernel/signal.c, [more]
  98.  


  99.   rt_sigqueueinfo int pid, int sig, siginfo_t *uinfo       178  
      (kernel routine)
      return  
      errors  
      ref syscall used in [glibc]
      source kernel/signal.c, [more]
  100.  


  101.   rt_sigsuspend             179  
      (kernel routine)
      return  
      errors  
      ref syscall used in [glibc]
      source kernel/signal.c, [more]
  102.  


  103.   pread int fd void *buf size_t count off_t offset     180  
      read from a file descriptor at given offset
      return ssize_t no. of bytes read, file offs. unchanged
      errors (file & acces, as with read, lseek)
         
  104.  


  105.   pwrite int fd void *buf size_t count off_t offset     181  
      write to a file descriptor at given offset
      return ssize_t no. of bytes written, file offs. unchanged
      errors (file & acces, as with read, lseek)
         
  106.  


  107.   chown c ch *path uid_t owner gid_t group       182  
      change ownership of a file
      return -/-
      errors (file & access)
      ref sys/types.h, unistd.h, linux/types.h
  108.  


  109.   getcwd char *buf size_t size         183  
      get current working directory
      return -/-
      errors range
         
  110.  


  111.   capget cap_user_header_t header cap_user_data_t data         184  
      get process capabilities
      return -/-
      errors inval, perm
      ref sys/capability.h, linux/capability.h
  112.  


  113.   capset cap_user_header_t header const cap_user_data_t data         185  
      set process capabilities
      return -/-
      errors inval, perm
      ref sys/capability.h, linux/capability.h
  114.  


  115.   sigaltstack const stack_t *ss, stack_t *oss, ul sp       186  
      set-up alternate stack space for signal handlers
      arg eax 186
        ebx ptr to new stack definition data array
        ecx ptr to default stack definition data array
        edx address of new stack ptr
      return eax -/-
      errors eax  
      ref   kernel/signal.c, i386/kernel/signal.c,
    linux/sched.h, linux/signal.h, asm/signal.h, signal.h
    no manual page exists, -re- syscall sigaction
  116.  



  117.   sendfile int out_fd, int in_fd, off_t *offset, size_t count     187  
      transfer data between file descriptors
      arg eax 187
        ebx output file descriptor
        ecx input file descriptor
        edx ptr to 64-bit sized disp into source file
        esi count of byte to copy
      return eax no. of bytes transferred
      errors eax badf, inval, io, nomem
      ref   mm/filemap.c, K6:sendfile64
      note fast, kernel space file transfer.
    output to any file type, input not from a socket or
    a channel which doesn't support the mmap system call.
    destination file-ptr updated to end of transferred bytes, source unchanged
    input and output may be the same file.
  118.  



  119.   getpmsg             188  
         n.i.
  120.  


  121.   putpmsg             189  
         n.i.
  122.  


  123.   vfork void           190  
      create child process & block parent
      return -/-
      errors again, nomem
         
  124.  


  125. K24 ugetgrlimit void           191  
       
      return -/-
      errors
         
  126.  


  127. K24 mmap2 192  
      map files or devices into memory
      arg eax192 
      ebx ul address 
      ecxul len 
      edxul prot 
      edil file descriptor 
      esiul pgoff 
      return   -/-
      errors eax badf, fault, inval
      ref arch/i386/kernel/sys_i386.c

 


 

Notes

 



[next] [back] [bot] [top]
[intro] [a:index] [#:index] [1..64] [65..128] [129..192] [193..256] [257..] [ref] [struc] [fcntl] [ioctl] [pguide]

 


H.-Peter Recktenwald, Berlin, 18.Feb.2000 = .hpr.l0 = : 1642