||
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]
- 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.
- 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
- 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.
- 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.
- 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'.
- 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'.
- 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.
- 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'.
- 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'.
- getgid, getgid32
arg eax 200 return eax group ID errors eax ref sys_getgid16 kernel/uid16.c - re lx 2.2. 'getgid'.
- geteuid, geteuid32
arg eax 201 return eax effective user ID errors eax ref sys_geteuid16 kernel/uid16.c - re lx 2.2. 'geteuid'.
- getegid, getegid32
arg eax 202 return eax effective group ID errors eax ref sys_getegid16 kernel/uid16.c - re lx 2.2. 'getegid'.
- 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'.
- setregid, setregid32
arg eax 204 ebx return errors eax ref sys_setregid16 kernel/uid16.c - re lx 2.2. 'setregid'.
- getgroups, getgroups32
arg eax 205 ebx return errors eax ref sys_getgroups16 kernel/uid16.c - re lx 2.2. 'getgroups'.
- setgroups, setgroups32
arg eax 206 ebx return errors eax ref sys_setgroups16 kernel/uid16.c - re lx 2.2. 'setgroups'.
- fchown, fchown32
arg eax 207 ebx return errors eax ref - re lx 2.2. 'fchown' kernel/uid16.c.
- setresuid, setresuid32
arg eax 208 ebx return errors eax ref sys_setresuid16 kernel/uid16.c - re lx 2.2. 'setresuid'.
- getresuid, getresuid32
arg eax 209 ebx return errors eax ref sys_getresuid16 kernel/uid16.c - re lx 2.2. 'getresuid'.
- setresgid, setresgid32
arg eax 210 ebx return errors eax ref sys_setresgid16 kernel/uid16.c - re lx 2.2. 'setresgid'.
- getresgid, getresgid32
arg eax 211 ebx return errors eax ref sys_getresgid16 kernel/uid16.c - re lx 2.2. 'getresgid'.
- chown, chown32
arg eax 212 ebx return errors eax ref - re lx 2.2. 'chown', kernel/uid16.c.
- setuid, setuid32
arg eax 213 ebx return errors eax ref sys_setuid16 kernel/uid16.c - re lx 2.2. 'setuid'.
- setgid, setgid32
arg eax 214 ebx return errors eax ref sys_setgid16 kernel/uid16.c - re lx 2.2. 'setgid'.
- 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.
- setfsgid, setfsgid32
arg eax 216 ebx return errors eax ref sys_setfsgid16 kernel/uid16.c - re lx 2.2. 'setfsgid'.
- 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.
- 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 }
- 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.
- 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'.
- 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'.
- n.n.
ref n.i.
- security
ref n.i.
- gettid
get thread ID, the internal kernel "pid" arg eax 224 return eax thread identifier errors eax -?- ref kernel/timer.c
- 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
- 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...
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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.
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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.
- free_hugepages
k5
arg eax 251 ref re alloc_hugepages, n.i. (the 'hugepages' were an experiment which failed)
- exit_group
K6
arg eax 252 ref n.i.
- 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
- 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)
- 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
- 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)