|                                                                                                        |

Copyright © h-peter recktenwald, berlin, 2000 - free for any related work and, non-commercial distribution.
text mode (Lynx, Printer) tables arranged to 132 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. K6 ugetrlimit, K4 getrlimit
      arg eax  191
        ebx  unsigned int resource
        ecx  struct rlimit *rlim
     return   limits in supplied rlimit struct
     errors eax  inval, fault
      ref   arch/i386/kernel/sys.c; K6: "SuS compliant getrlimit".
      note K2 sys_getrlimit renamed to sys_old_getrlimit in K4,
    K4 sys_old_getrlimit renamed to sys_getrlimit in K6.
  2.  



  3. mmap2 map files or devices into memory
      arg eax 192
        ebx ul page aligned address
      ecx ul page aligned len (file size)  
      edx ul prot  
      edi l flags  
      edi l file descriptor  
      ebp ul pgoff  disp to file ptr to begin mapping by units of PAGE_SIZE (4K)
      return    
      errors eax badf, fault, inval
      ref   arch/i386/kernel/sys_i386.c, linux/mm.h, asm/mman.h, syscall 'mmap'.
      note memory "protection" may not become effective as expected!
    re mprotect and mmap flags
  4.  



  5. truncate64 
      arg eax 193
        ebx  const char * path
        ecx  loff_t (lo) length 
        edx  loff_t (hi) length 
     return    
     errors eax  
     ref   linux/fs/open.c - re lx 2.2. 'truncate'.
    "loff_t" by ecx/edx according to kernel (dis)assembly but, not verified.
  6.  



  7. ftruncate64 
      arg eax 194
        ebx  unsigned int fd
        ecx  loff_t (lo) length 
        edx  loff_t (hi) length 
     return    
     errors eax  
     ref   linux/fs/open.c - re lx 2.2. 'ftruncate'.
    "loff_t" by ecx/edx according to kernel (dis)assembly but, not verified.
  8.  



  9. stat64 
      arg eax 195
        ebx  char * filename 
        ecx  struct stat64 * statbuf 
        edx  long flags - note: no flags actually defined
     return    
     errors eax  
     ref   linux/fs/open.c - re lx 2.2. 'stat'.
  10.  



  11. lstat64 
      arg eax 196
        ebx  char * filename
        ecx  struct stat64 * statbuf 
        edx  long flags - note: no flags actually defined
     return    
     errors eax  
     ref   linux/fs/stat.c - re lx 2.2. 'lstat'.
  12.  



  13. fstat64 
      arg eax 197
        ebx  unsigned long fd
        ecx  struct stat64 * statbuf 
        edx  long flags  - note: no flags actually defined
     return    
     errors eax  
     ref   linux/fs/stat.c - re lx 2.2. 'fstat', oldstat.
  14.  



  15. lchown, lchown32 
      arg eax 198
        ebx  const char * filename
        ecx  uid_t user
        edx  gid_t group
     return    
     errors eax  
     ref   linux/fs/open.c - re lx 2.2. 'lchown'.
  16.  



  17. getuid, getuid32 
      arg eax 199
     return eax user ID
     errors eax  
     ref   kernel/timer.c,
    sys_getuid16 kernel/uid16.c - re lx 2.2. 'getuid'.
  18.  



  19. getgid, getgid32 
      arg eax 200
     return eax group ID
     errors eax  
     ref     sys_getgid16 kernel/uid16.c - re lx 2.2. 'getgid'.
  20.  



  21. geteuid, geteuid32 
      arg eax 201
     return eax effective user ID
     errors eax  
     ref     sys_geteuid16 kernel/uid16.c - re lx 2.2. 'geteuid'.
  22.  



  23. getegid, getegid32 
      arg eax 202
     return eax effective group ID
     errors eax  
     ref     sys_getegid16 kernel/uid16.c - re lx 2.2. 'getegid'.
  24.  



  25. setreuid, setreuid32 
      arg eax 203
        ebx  uid_t ruid 
        ecx  uid_t euid
     return    
     errors eax  
     ref     sys_setreuid16 kernel/uid16.c - re lx 2.2. 'setreuid'.
  26.  



  27. setregid, setregid32 
      arg eax 204
        ebx  
     return    
     errors eax  
     ref     sys_setregid16 kernel/uid16.c - re lx 2.2. 'setregid'.
  28.  



  29. getgroups, getgroups32 
      arg eax 205
        ebx  
     return    
     errors eax  
     ref     sys_getgroups16 kernel/uid16.c - re lx 2.2. 'getgroups'.
  30.  



  31. setgroups, setgroups32 
      arg eax 206
        ebx  
     return    
     errors eax  
     ref     sys_setgroups16 kernel/uid16.c - re lx 2.2. 'setgroups'.
  32.  



  33. fchown, fchown32 
      arg eax 207
        ebx  
     return    
     errors eax  
     ref     - re lx 2.2. 'fchown' kernel/uid16.c.
  34.  



  35. setresuid, setresuid32 
      arg eax 208
        ebx  
     return    
     errors eax  
     ref     sys_setresuid16 kernel/uid16.c - re lx 2.2. 'setresuid'.
  36.  



  37. getresuid, getresuid32 
      arg eax 209
        ebx  
     return    
     errors eax  
     ref     sys_getresuid16 kernel/uid16.c - re lx 2.2. 'getresuid'.
  38.  



  39. setresgid, setresgid32 
      arg eax 210
        ebx  
     return    
     errors eax  
     ref     sys_setresgid16 kernel/uid16.c - re lx 2.2. 'setresgid'.
  40.  



  41. getresgid, getresgid32 
      arg eax 211
        ebx  
     return    
     errors eax  
     ref     sys_getresgid16 kernel/uid16.c - re lx 2.2. 'getresgid'.
  42.  



  43. chown, chown32 
      arg eax 212
        ebx  
     return    
     errors eax  
     ref     - re lx 2.2. 'chown', kernel/uid16.c.
  44.  



  45. setuid, setuid32 
      arg eax 213
        ebx  
     return    
     errors eax  
     ref     sys_setuid16 kernel/uid16.c - re lx 2.2. 'setuid'.
  46.  



  47. setgid, setgid32 
      arg eax 214
        ebx  
     return    
     errors eax  
     ref     sys_setgid16 kernel/uid16.c - re lx 2.2. 'setgid'.
  48.  



  49. setfsuid, setfsuid32 set uid for filesystem checks
      arg eax 215
        ebx uid_t uid
     return    
     errors eax  
      ref     sys_setfsuid16 kernel/uid16.c - re lx 2.2. 'setfsuid'.
      used for "access" and, for the NFS daemon letting nfsd stay at any selected uid.
    normally shadows "euid", except when explicitly set by setfsuid or, for access.
  50.  



  51. setfsgid, setfsgid32 
      arg eax 216
        ebx  
     return    
     errors eax  
     ref     sys_setfsgid16 kernel/uid16.c - re lx 2.2. 'setfsgid'.
  52.  



  53. pivot_root 
      arg eax 217
        ebx const char *new_root 
        ecx const char *put_old) 
      return    
      errors eax  
     ref   fs/namespace.c
      Moves the current root to put_root, and sets root/cwd of all processes which had them
    on the old root to new_root.
    Note:
    we don't move root/cwd if they are not at the root (if something cared enough to change
    them, it's probably wrong to force them elsewhere) - the 'root' isn't required to be
    the root of a file system, e.g. /nfs/my_root where /nfs, but, got to be a mountpoint,
    though, so you may need to do <mount --bind /nfs/my_root /nfs/my_root> first.
  54.  



  55. mincore 
      arg eax 218
        ebx unsigned long start 
        ecx size_t len 
        edx unsigned char * vec 
      return    
      errors eax FAULT vec points to an illegal address.
    INVAL addr is not a multiple of PAGE_CACHE_SIZE, or len non-positive.
    NOMEM addr in range [addr, addr + len] invalid for the address space
     of this process or, any pages which are not currently mapped.
    AGAIN A kernel resource was temporarily unavailable.
      ref   mm/filemap.c 
      returns memory residency status of the pages in the current process's address space in
    range [addr, addr + len]. Status returned in a vector of bytes; l.s. bit of each byte
    is 1 if the referenced page is in memory, otherwise it is zero. Because the state of a
    page can change after testing but, before "mincore" returns, the vector may contain stale
    information. Only locked pages are guaranteed to remaining in memory.
         
      L4:  { f8 also linux pad '4th>abs 0 @ 0 4th>abs paligned sp@ sys mincore . pad 0 @ $1000' / dump bye }
  56.  



  57. madvise, madvise1 
      arg eax 219
        ebx unsigned long start 
        ecx size_t len 
        edx int behaviour 
    MADV_NORMAL read by clusters, results in some read-ahead/-behind.
    MADV_RANDOM read the minimum amount of data on any access.
    MADV_SEQUENTIAL aggressively read ahead.
    MADV_WILLNEED notifying the system to read some pages ahead.
    MADV_DONTNEED kernel can free resources associated with the given range.
     return    
     errors eax INVAL start+len < 0, start not page-aligned, "behavior" not valid or,
     application attempting to release locked or shared pages.
    NOMEM specified addr range not currently mapped or,
    outside address range of the process.
    IO I/O error while paging in data.
    EBADF map exists, but area maps not a file.
    EAGAIN a kernel resource was temporarily unavailable.  
     ref   mm/filemap.c, include/asm-i386/mman.h
      Applications can advise how the kernel how should handle paging I/O in given VM area,
    to help the kernel useing appropriate read-ahead and caching techniques. The information
    provided is advisory and, can be safely disregarded by the kernel without affecting the
    correct operation of the application.
  58.  



  59. getdents64 
      arg eax 220
        ebx  unsigned int fd
        ecx  void * dirent 
        edx  unsigned int count 
     return    
     errors eax  
     ref   fs/readdir.c  - re lx 2.2. 'getdents'.
  60.  



  61. fcntl64 
      arg eax 221
        ebx  unsigned int fd
        ecx  unsigned int cmd: F_GETLK64, F_SETLK64, F_SETLKW64
        edx  unsigned long arg 
     return    
     errors eax  
     ref   include/asm/fcntl.h, include/linux/fcntl.h fs/fcntl.c - K2.2 'fcntl'.
  62.  


  63. n.n.
     ref    n.i.
  64.  


  65. security 
     ref    n.i.
  66.  



  67. gettid 
       get thread ID, the internal kernel "pid"    
      arg eax 224
     return eax thread identifier
     errors eax  -?-
     ref   kernel/timer.c
  68.  



  69. readahead Read in advance one or more pages of a file within a page cache
      arg eax 225
        ebx  int fd
        ecx  loff_t offset 
        edx  size_t count 
     return    
     errors eax  
     ref   mm/filemap.c 
  70.  



  71. setxattr K6 set an extended attribute value
      arg eax 226
        ebx  char *path
        ecx  char *name
        edx  void *value
        esi  size_t size
        edi  int flags
     return   ernum or zero
     errors eax  dquot, exist, noattr, nospc, notsup and, error codes of stat
     ref   K6, "extended attributes handling"...
    fs/ext3/xattr.h fs/ext2/xattr.h fs/devpts/xattr.h
      src   xattr.c xattr.h
      'explanation' from the kernel source:
    "Extended attribute memory allocation wrappers, originally based on the
    "Intermezzo PRESTO_ALLOC/PRESTO_FREE macros. The vmalloc use here is very
    "uncommon - extended attributes are supposed to be small chunks of metadata,
    "and it is quite unusual to have very many extended attributes, so lists
    "tend to be quite short as well. The 64K upper limit is derived from
    "the extended attribute size limit used by XFS. Intentionally allow
    "zero @size for value/list size requests.
    And now, since you know that it is very unusual, indeed,
    you might as well know what it is all about...
  72.  



  73. lsetxattr K6 set an extended attribute value
      arg eax 227
        ebx  char *path
        ecx  char *name
        edx  void *value
        esi  size_t size
        edi  int flags
     ref   K6 'extended attributes handling' - re setxattr
     src   xattr.c xattr.h
  74.  



  75. fsetxattr K6 set an extended attribute value
      arg eax 228
        ebx  int fd
        ecx  char *name
        edx  void *value
        esi  size_t size
        edi  int flags
     ref   K6 'extended attributes handling' - re setxattr
     src   xattr.c xattr.h
  76.  



  77. getxattr K6 retrieve an extended attribute value
      arg eax 229
        ebx  char *path
        ecx  char *name
        edx  void *value
        esi  size_t size
     ref   K6 'extended attributes handling' - re setxattr
     src   xattr.c xattr.h
  78.  



  79. lgetxattr K6 retrieve an extended attribute value
      arg eax 230
        ebx  char *path
        ecx  char *name
        edx  void *value
        esi  size_t size
     ref   K6 'extended attributes handling' - re getxattr
     src   xattr.c xattr.h

     



  80. fgetxattr K6 retrieve an extended attribute value
      arg eax 231
        ebx  int fd
        ecx  char *name
        edx  void *value
        esi  size_t size
     ref   K6 'extended attributes handling' - re getxattr
     src   xattr.c xattr.h
  81.  



  82. listxattr K6 list extended attribute names
      arg eax 232
        ebx  char *path
        ecx  char *list
        edx  size_t size
     ref   K6 'extended attributes handling' - re getxattr
     src   xattr.c xattr.h
  83.  



  84. llistxattr K6 list extended attribute names
      arg eax 233
        ebx  char *path
        ecx  char *list
        edx  size_t size
     ref   K6 'extended attributes handling' - re listxattr
     src   xattr.c xattr.h
  85.  



  86. flistxattr K6 list extended attribute names
      arg eax 234
        ebx  int fd
        ecx  char *list
        edx  size_t size
     ref   K6 'extended attributes handling' - re listxattr
     src   xattr.c xattr.h
  87.  



  88. removexattr K6 remove an extended attribute
      arg eax 235
        ebx  char *path
        ecx  char *name
     ref   K6 'extended attributes handling' - re setxattr
     src   xattr.c xattr.h
  89.  



  90. lremovexattr K6 remove an extended attribute
      arg eax 236
        ebx  char *path
        ecx  char *name
     ref   K6 'extended attributes handling' - re removexattr
     src   xattr.c xattr.h
  91.  



  92. fremovexattr K6 remove an extended attribute
      arg eax 237
        ebx  int fd
        ecx  char *name
     ref   K6 'extended attributes handling' - re removexattr
     src   xattr.c xattr.h
  93.  



  94. tkill kill a single task
      arg eax 238
        ebx  pid
        ecx  signal number
     return    
     errors eax  inval, srch
      src    kernel/signal.c,
      ref    i386/kernel/signal.c, [more] about signals, syscall tgkill.
  95.  



  96. sendfile64 K6 transfer data between file descriptors
      arg eax 239
        ebx  out_fd
        ecx  in_fd
        edx  loff_t __user *offset, ptr to 64bit offset figure in memory
        edi  size_t count of bytes to send
     return   ssize_t count of bytes sent
     errors eax  inval, srch
      src   fs/read_write.c
      ref   sendfile variant of the undocumented sendfile64 syscall, internally restricted to 2G;
    mm/filemap.c
  97.  



  98. futex K6 fast userspace locking system call (a 'watchpoint' implementation)
      arg eax 240
        ebx  void *futex
        ecx  int val
        edx  r/o ptr to timeout timespec array
     return   ssize_t count of bytes sent
     errors eax  inval, srch
      src   fs/read_write.c
      ref   futex example library, man 4 futex
  99.  



  100. sched_setaffinity K6 sets CPU affinity mask of a process by pid
      arg eax 241
        ebx  pid_t pid of the process the mask of which should be set
        ecx  bytes uint length of affinity bitmask @edx
        edx  ulong, ptr to affinity bitmask; bit-numbers correspond to the rsp. scheduleable CPU
     return   ernum or zero
     errors eax  fault, srch, perm
      ref   include/sched.h, kernel/sched.c
    K4 man 2 sched_setscheduler
  101.  



  102. sched_getaffinity K6 reads CPU affinity mask of a process by pid
      arg eax 242
        ebx  pid_t pid of the process the mask of which should be read
        ecx  bytes uint length of affinity bitmask @edx
        edx  ulong, r/o ptr to affinity bitmask; bit-numbers correspond to the rsp. scheduleable CPU
     return   ernum or zero
     errors eax  fault, srch, perm
      ref   include/sched.h, kernel/sched.c
    K4 man 2 sched_setscheduler
  103.  



  104. set_thread_area K6 Set a Thread Local Storage (TLS) area
      arg eax 243
        ebx  ptr to array user_desc u_info
     return   ernum or zero
     errors eax  fault, inval, srch
      src   arch/i386/kernel/process.c
      ref   include/asm/ldt.h, include/sched.h
  105.  



  106. get_thread_area K6 Get a Thread Local Storage (TLS) area
      arg eax 244
        ebx  ptr to r/w array user_desc u_info
     return   ernum or zero
     errors eax  fault, inval
      src   arch/i386/kernel/process.c
      ref   include/asm/ldt.h, include/sched.h
  107.  



  108. io_setup K6 Create an asynchronous ('realtime') I/O context
      arg eax 245
        ebx  unsigned nr_events, no. of events an async i/o context can receive
        ecx  aio_context_t *ctxp, ptr to received context handle
     return   ernum or zero
     errors eax  again, fault, inval, nomem, nosys
      src   fs/aio.c
      ref   include/linux/aio.h, include/linux/aio_abi.h
  109.  



  110. io_destroy K6 Destroy an asynchronous I/O context
      arg eax 246
        ebx  ptr to data array aio_context_t *ctxp
     return   ernum or zero
     errors eax  fault, inval, nosys
      src   fs/aio.c
      ref   include/linux/aio.h, include/linux/aio_abi.h
  111.  



  112. io_getevents K6 Read asynchronuous I/O events from the completion queue
      arg eax 247
        ebx  data array aio_context_t ctx_id
        ecx  long min_nr
        edx  long nr
        esi  struct io_event *events
        edi  struct timespec *timeout; max time to wait for nr events,
    zero timout to waiting for at least min_nr events
     return   +ve no. of events read, no. < min_nr after time-out or, -ve ernum
     errors eax  fault, inval, nosys
      src   fs/aio.c
      ref   include/linux/aio.h, include/linux/aio_abi.h
  113.  



  114. io_submit K6 Submit asynchronous I/O blocks for processing
      arg eax 248
        ebx  data array aio_context_t ctx_id, context for nr queued request blocks
        ecx  long nr
        edx  struct iocb **iocbpp, array of nr ai/o request blocks
     return   number of iocbs submitted and 0 if nr is zero or, -ve ernum
     errors eax  again, badf, fault, inval, nosys
      src   fs/aio.c
      ref   include/linux/aio.h, include/linux/aio_abi.h
  115.  



  116. io_cancel K6 Cancel an outstanding asynchronous I/O operation
      arg eax 249
        ebx  data array aio_context_t ctx_id, context of previously submitted by io_submit opr to cancel
        ecx  struct iocb *iocbp, aio request block data array
        edx  struct io_event *result; receives the cancelled event data
     return   ernum or zero
     errors eax  again, fault, inval, nosys
      src   fs/aio.c
      ref   include/linux/aio.h, include/linux/aio_abi.h
  117.  



  118. alloc_hugepages k5 
      arg eax 250
      ref   n.i; man 2:
    "The system calls alloc_hugepages and free_hugepages were introduced in Linux
    "2.5.36 and removed again in 2.5.54. They existed only on i386 and ia64 [...]
    "In Linux 2.4.20 the syscall numbers exist, but the calls return ENOSYS.
  119.  



  120. free_hugepages k5 
      arg eax 251
      ref   re alloc_hugepages, n.i. (the 'hugepages' were an experiment which failed)
  121.  



  122. exit_group K6 
      arg eax 252
      ref    n.i.
  123.  



  124. lookup_dcookie K6 return a directory entry's path
      arg eax 253
        ebx  u64 cookie; l.s.dword -?-
        ecx  u64 cookie; m.s.dword -?-
        edx  char * buffer
        esi  size_t len
     return   ernum or zero
     errors eax  fault, inval, nomem, perm, range
      src   fs/dcookies.c
      ref   include/linux/dcookies.h
  125.  



  126. epoll_create K6 open an epoll file descriptor
      arg eax 254
        ebx  int size
     return   -ve ernum or, +ve epoll file descriptor, 'epfd'
     errors eax  nomem
      src   fs/eventpoll.c
      ref   include/linux/eventpoll.h, /usr/include/sys/epoll.h (glibc-2.3)
  127.  



  128. epoll_ctl K6 control interface for an epoll descriptor
      arg eax 255
        ebx  int epfd
        ecx  int op
        edx  int fd
        esi  struct epoll_event *event
     return   -ve ernum or zero
     errors eax  badf, fault, inval, nomem, perm
      src   fs/eventpoll.c
      ref   include/linux/eventpoll.h
    glibc 2.3: sysdeps/unix/sysv/linux/sys/epoll.h /usr/include/sys/epoll.h
  129.  



  130. epoll_wait K6 wait for an I/O event on an epoll file descriptor
      arg eax 256
        ebx  int epfd
        ecx  struct epoll_event *events
        edx  int maxevents
        edx  int timeout
     return   > 0 : no. of filedescriptors ready for requested i/o
    = 0 : none received, time-out elapsed
    < 0 : error code
     errors eax  badf, fault
      src   fs/eventpoll.c,
      ref   include/linux/eventpoll.h, /usr/include/sys/epoll.h (glibc-2.3)
  131.  



[1st] [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, 1.Mar.2001 = .hpr.l0 = : 1178