AngoLinux

Chimate di sistema in Assembler


Per richiamare una funzione di sistema da un programma in linguaggio assembly esistono fondamentalemnte due metodi:
  • Collegare al programma la libreria di sistema usata dal C (libc.so) e richiamare la relativa funzione, usando la convenzione di chiamata del C
  • Richiamare direttamente la funzione del Kernel di Linux
Per ora ci occuperemo del secondo metodo.

Qualunque funzione si voglia far eseguire al Kernel, si utilizzerà sempre la stessa chiamata, e più precisamente, si invierà in interrupt software 0x80.
Il valore che avremo posto nel registro %eax indicherà al Kernel quale funzione eseguire. I parametrei della funzione andranno messi negli altri registri del processore, in particolare:

  • primo parametro in %ebx,
  • secondo parametro in %ecx,
  • terzo parametro in %edx,
  • quarto parametro in %esi,
  • quinto parametro in %edi,
  • sesto parametro in %ebp,

Il valore di ritorno verrà lasciato in %eax. Se il valore in %eax è negativo, allora la funzione stà riportando un'errore ed il codice d'errore è il valore di %eax cambiato di segno.

Per sapere i codici da porre in %eax per le funzioni che ci servono, dovremo cercarli nel file /usr/include/asm/unistd.h.
Per conoscere l'uso di ogni singola funzione, il tipo ed i valori leciti per ogni parametro, il valore ritornato ed i codici di errore prodotti si deve fare riferimento alla sezione 2 del manuale, ad esempio, per la terminazione del programma si può dare il comando man 2 exit.

Ad esempio, la funzione exit che termina il programma ha il seguente prototipo, tratto dal manuale:

void _exit(int status);
Dal file /usr/include/asm/unistd.h scopriamo che il codice per _exit (costante __NR_exit) ha valore 1.
A questo punto, se vorremo terminare il programma con un codice di terminazione 0, dovremo scrivere il seguente codice in linguaggio assembly:
__NR_exit	=	1
KERNEL		=	0x80

        movl    $0,%ebx           # first argument: exit code
        movl    $__NR_exit,%eax   # system call number (sys_exit)
        int     $KERNEL           # call kernel

Segue l'elenco dei codici delle chiamate al Kernel, tratte dal file /usr/include/asm/unistd.h, corredate con la corrispondente funzione e con i valori da porre nei registri, tratti dalle pagine del manuale.

Elenco delle chiamate al kernel di Linux

__NR_exit [Codice 1] Funzione void _exit(int status);
terminate the current process
%eax%ebx%ecx %edx%esi%edi%ebp
1int status     
__NR_fork [Codice 2] Funzione pid_t fork(void);
create a child process
%eax%ebx%ecx %edx%esi%edi%ebp
2      
__NR_read [Codice 3] Funzione ssize_t read(int fd, void *buf, size_t count);
read from a file descriptor
%eax%ebx%ecx %edx%esi%edi%ebp
3int fd void *buf size_t count   
__NR_write [Codice 4] Funzione ssize_t write(int fd, const void *buf, size_t count);
write to a file descriptor
%eax%ebx%ecx %edx%esi%edi%ebp
4int fd const void *buf size_t count   
__NR_open [Codice 5] Funzione int open(const char *pathname, int flags, mode_t mode);
open and possibly create a file or device
%eax%ebx%ecx %edx%esi%edi%ebp
5const char *pathname int flags mode_t mode   
__NR_close [Codice 6] Funzione int close(int fd);
close a file descriptor
%eax%ebx%ecx %edx%esi%edi%ebp
6int fd     
__NR_waitpid [Codice 7] Funzione pid_t waitpid(pid_t pid, int *status, int options);
wait for process termination
%eax%ebx%ecx %edx%esi%edi%ebp
7pid_t pid int *status int options   
__NR_creat [Codice 8] Funzione int creat(const char *pathname, mode_t mode);
open and possibly create a file or device
%eax%ebx%ecx %edx%esi%edi%ebp
8const char *pathname mode_t mode    
__NR_link [Codice 9] Funzione int link(const char *oldpath, const char *newpath);
make a new name for a file
%eax%ebx%ecx %edx%esi%edi%ebp
9const char *oldpath const char *newpath    
__NR_unlink [Codice 10] Funzione int unlink(const char *pathname);
delete a name and possibly the file it refers to
%eax%ebx%ecx %edx%esi%edi%ebp
10const char *pathname     
__NR_execve [Codice 11] Funzione int execve(const char *filename, char *const argv [], char *const envp[]);
execute program
%eax%ebx%ecx %edx%esi%edi%ebp
11const char *filename char *const argv [] char *const envp[]   
__NR_chdir [Codice 12] Funzione int chdir(const char *path);
change working directory
%eax%ebx%ecx %edx%esi%edi%ebp
12const char *path     
__NR_time [Codice 13] Funzione time_t time(time_t *t);
get time in seconds
%eax%ebx%ecx %edx%esi%edi%ebp
13time_t *t     
__NR_mknod [Codice 14] Funzione int mknod(const char *pathname, mode_t mode, dev_t dev);
create a special or ordinary file
%eax%ebx%ecx %edx%esi%edi%ebp
14const char *pathname mode_t mode dev_t dev   
__NR_chmod [Codice 15] Funzione int chmod(const char *path, mode_t mode);
change permissions of a file
%eax%ebx%ecx %edx%esi%edi%ebp
15const char *path mode_t mode    
__NR_lchown [Codice 16] Funzione int lchown(const char *path, uid_t owner, gid_t group);
change ownership of a file
%eax%ebx%ecx %edx%esi%edi%ebp
16const char *path uid_t owner gid_t group   
__NR_break [Codice 17] : Nessuna funzione di libreria corrispondente
unimplemented system calls
__NR_oldstat [Codice 18] : Nessuna funzione di libreria corrispondente
obsolete system calls
__NR_lseek [Codice 19] Funzione off_t lseek(int fildes, off_t offset, int whence);
reposition read/write file offset
%eax%ebx%ecx %edx%esi%edi%ebp
19int fildes off_t offset int whence   
__NR_getpid [Codice 20] Funzione pid_t getpid(void);
get process identification
%eax%ebx%ecx %edx%esi%edi%ebp
20      
__NR_mount [Codice 21] Funzione int mount(const char *source, const char *target , const char *filesystemtype, unsigned long mountflags , const void *data);
mount and unmount filesystems.
%eax%ebx%ecx %edx%esi%edi%ebp
21const char *source const char *target const char *filesystemtype unsigned long mountflags const void *data 
__NR_umount [Codice 22] Funzione int umount(const char *target);
mount and unmount filesystems.
%eax%ebx%ecx %edx%esi%edi%ebp
22const char *target     
__NR_setuid [Codice 23] Funzione int setuid(uid_t uid);
set user identity
%eax%ebx%ecx %edx%esi%edi%ebp
23uid_t uid     
__NR_getuid [Codice 24] Funzione uid_t getuid(void);
get user identity
%eax%ebx%ecx %edx%esi%edi%ebp
24      
__NR_stime [Codice 25] Funzione int stime(time_t *t);
set time
%eax%ebx%ecx %edx%esi%edi%ebp
25time_t *t     
__NR_ptrace [Codice 26] Funzione long ptrace(enum __ptrace_request request, pid_t pid, void *addr, void *data);
process trace
%eax%ebx%ecx %edx%esi%edi%ebp
26enum __ptrace_request request pid_t pid void *addr void *data  
__NR_alarm [Codice 27] Funzione int alarm(unsigned int seconds);
set an alarm clock for delivery of a signal
%eax%ebx%ecx %edx%esi%edi%ebp
27unsigned int seconds     
__NR_oldfstat [Codice 28] : Nessuna funzione di libreria corrispondente
obsolete system calls
__NR_pause [Codice 29] Funzione int pause(void);
wait for signal
%eax%ebx%ecx %edx%esi%edi%ebp
29      
__NR_utime [Codice 30] Funzione int utime(const char *filename, struct utimbuf *buf);
change access and/or modification times of an inode
%eax%ebx%ecx %edx%esi%edi%ebp
30const char *filename struct utimbuf *buf    
__NR_stty [Codice 31] : Nessuna funzione di libreria corrispondente
unimplemented system calls
__NR_gtty [Codice 32] : Nessuna funzione di libreria corrispondente
unimplemented system calls
__NR_access [Codice 33] Funzione int access(const char *pathname, int mode);
check user’s permissions for a file
%eax%ebx%ecx %edx%esi%edi%ebp
33const char *pathname int mode    
__NR_nice [Codice 34] Funzione int nice(int inc);
change process priority
%eax%ebx%ecx %edx%esi%edi%ebp
34int inc     
__NR_ftime [Codice 35] : Nessuna funzione di libreria corrispondente
unimplemented system calls
__NR_sync [Codice 36] Funzione void sync(void);
commit buffer cache to disk.
%eax%ebx%ecx %edx%esi%edi%ebp
36      
__NR_kill [Codice 37] Funzione int kill(pid_t pid, int sig);
send signal to a process
%eax%ebx%ecx %edx%esi%edi%ebp
37pid_t pid int sig    
__NR_rename [Codice 38] Funzione int rename(const char *oldpath, const char *newpath);
change the name or location of a file
%eax%ebx%ecx %edx%esi%edi%ebp
38const char *oldpath const char *newpath    
__NR_mkdir [Codice 39] Funzione int mkdir(const char *pathname, mode_t mode);
create a directory
%eax%ebx%ecx %edx%esi%edi%ebp
39const char *pathname mode_t mode    
__NR_rmdir [Codice 40] Funzione int rmdir(const char *pathname);
delete a directory
%eax%ebx%ecx %edx%esi%edi%ebp
40const char *pathname     
__NR_dup [Codice 41] Funzione int dup(int oldfd);
duplicate a file descriptor
%eax%ebx%ecx %edx%esi%edi%ebp
41int oldfd     
__NR_pipe [Codice 42] Funzione int pipe(int filedes[2]);
create pipe
%eax%ebx%ecx %edx%esi%edi%ebp
42int filedes[2]     
__NR_times [Codice 43] Funzione clock_t times(struct tms *buf);
get process times
%eax%ebx%ecx %edx%esi%edi%ebp
43struct tms *buf     
__NR_prof [Codice 44] : Nessuna funzione di libreria corrispondente
unimplemented system calls
__NR_brk [Codice 45] Funzione int brk(void *end_data_segment);
change data segment size
%eax%ebx%ecx %edx%esi%edi%ebp
45void *end_data_segment     
__NR_setgid [Codice 46] Funzione int setgid(gid_t gid);
set group identity
%eax%ebx%ecx %edx%esi%edi%ebp
46gid_t gid     
__NR_getgid [Codice 47] Funzione gid_t getgid(void);
get group identity
%eax%ebx%ecx %edx%esi%edi%ebp
47      
__NR_signal [Codice 48] Funzione sighandler_t signal(int signum, sighandler_t handler);
ANSI C signal handling
%eax%ebx%ecx %edx%esi%edi%ebp
48int signum sighandler_t handler    
__NR_geteuid [Codice 49] Funzione uid_t geteuid(void);
get user identity
%eax%ebx%ecx %edx%esi%edi%ebp
49      
__NR_getegid [Codice 50] Funzione gid_t getegid(void);
get group identity
%eax%ebx%ecx %edx%esi%edi%ebp
50      
__NR_acct [Codice 51] Funzione int acct(const char *filename);
switch process accounting on or off
%eax%ebx%ecx %edx%esi%edi%ebp
51const char *filename     
__NR_umount2 [Codice 52] : Nessuna funzione di libreria corrispondente
No description Available
__NR_lock [Codice 53] : Nessuna funzione di libreria corrispondente
unimplemented system calls
__NR_ioctl [Codice 54] Funzione int ioctl(int d, int request, ...);
control device
%eax%ebx%ecx %edx%esi%edi%ebp
54int d int request    
__NR_fcntl [Codice 55] Funzione int fcntl(int fd, int cmd, struct flock *lock);
manipulate file descriptor
%eax%ebx%ecx %edx%esi%edi%ebp
55int fd int cmd struct flock *lock   
__NR_mpx [Codice 56] : Nessuna funzione di libreria corrispondente
unimplemented system calls
__NR_setpgid [Codice 57] Funzione int setpgid(pid_t pid, pid_t pgid);
set/get process group
%eax%ebx%ecx %edx%esi%edi%ebp
57pid_t pid pid_t pgid    
__NR_ulimit [Codice 58] : Nessuna funzione di libreria corrispondente
unimplemented system calls
__NR_oldolduname [Codice 59] : Nessuna funzione di libreria corrispondente
obsolete system calls
__NR_umask [Codice 60] Funzione mode_t umask(mode_t mask);
set file creation mask
%eax%ebx%ecx %edx%esi%edi%ebp
60mode_t mask     
__NR_chroot [Codice 61] Funzione int chroot(const char *path);
change root directory
%eax%ebx%ecx %edx%esi%edi%ebp
61const char *path     
__NR_ustat [Codice 62] Funzione int ustat(dev_t dev, struct ustat *ubuf);
get file system statistics
%eax%ebx%ecx %edx%esi%edi%ebp
62dev_t dev struct ustat *ubuf    
__NR_dup2 [Codice 63] Funzione int dup2(int oldfd, int newfd);
duplicate a file descriptor
%eax%ebx%ecx %edx%esi%edi%ebp
63int oldfd int newfd    
__NR_getppid [Codice 64] Funzione pid_t getppid(void);
get process identification
%eax%ebx%ecx %edx%esi%edi%ebp
64      
__NR_getpgrp [Codice 65] Funzione pid_t getpgrp(void);
set/get process group
%eax%ebx%ecx %edx%esi%edi%ebp
65      
__NR_setsid [Codice 66] Funzione pid_t setsid(void);
creates a session and sets the process group ID
%eax%ebx%ecx %edx%esi%edi%ebp
66      
__NR_sigaction [Codice 67] Funzione int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
POSIX signal handling functions.
%eax%ebx%ecx %edx%esi%edi%ebp
67int signum const struct sigaction *act struct sigaction *oldact   
__NR_sgetmask [Codice 68] : Nessuna funzione di libreria corrispondente
No description Available
__NR_ssetmask [Codice 69] : Nessuna funzione di libreria corrispondente
No description Available
__NR_setreuid [Codice 70] Funzione int setreuid(uid_t ruid, uid_t euid);
set real and/or effective user or group ID
%eax%ebx%ecx %edx%esi%edi%ebp
70uid_t ruid uid_t euid    
__NR_setregid [Codice 71] Funzione int setregid(gid_t rgid, gid_t egid);
set real and/or effective user or group ID
%eax%ebx%ecx %edx%esi%edi%ebp
71gid_t rgid gid_t egid    
__NR_sigsuspend [Codice 72] Funzione int sigsuspend(const sigset_t *mask);
POSIX signal handling functions.
%eax%ebx%ecx %edx%esi%edi%ebp
72const sigset_t *mask     
__NR_sigpending [Codice 73] Funzione int sigpending(sigset_t *set);
POSIX signal handling functions.
%eax%ebx%ecx %edx%esi%edi%ebp
73sigset_t *set     
__NR_sethostname [Codice 74] Funzione int sethostname(const char *name, size_t len);
get/set host name
%eax%ebx%ecx %edx%esi%edi%ebp
74const char *name size_t len    
__NR_setrlimit [Codice 75] Funzione int setrlimit(int resource, const struct rlimit *rlim);
get/set resource limits and usage
%eax%ebx%ecx %edx%esi%edi%ebp
75int resource const struct rlimit *rlim    
__NR_getrlimit [Codice 76] Funzione int getrlimit(int resource, struct rlimit *rlim);
get/set resource limits and usage
%eax%ebx%ecx %edx%esi%edi%ebp
76int resource struct rlimit *rlim    
__NR_getrusage [Codice 77] Funzione int getrusage(int who, struct rusage *usage);
get/set resource limits and usage
%eax%ebx%ecx %edx%esi%edi%ebp
77int who struct rusage *usage    
__NR_gettimeofday [Codice 78] Funzione int gettimeofday(struct timeval *tv, struct timezone *tz);
get / set time
%eax%ebx%ecx %edx%esi%edi%ebp
78struct timeval *tv struct timezone *tz    
__NR_settimeofday [Codice 79] Funzione int settimeofday(const struct timeval *tv , const struct timezone *tz);
get / set time
%eax%ebx%ecx %edx%esi%edi%ebp
79const struct timeval *tv const struct timezone *tz    
__NR_getgroups [Codice 80] Funzione int getgroups(int size, gid_t list[]);
get/set list of supplementary group IDs
%eax%ebx%ecx %edx%esi%edi%ebp
80int size gid_t list[]    
__NR_setgroups [Codice 81] Funzione int setgroups(size_t size, const gid_t *list);
get/set list of supplementary group IDs
%eax%ebx%ecx %edx%esi%edi%ebp
81size_t size const gid_t *list    
__NR_select [Codice 82] Funzione int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
synchronous I/O multiplexing
%eax%ebx%ecx %edx%esi%edi%ebp
82int n fd_set *readfds fd_set *writefds fd_set *exceptfds struct timeval *timeout 
__NR_symlink [Codice 83] Funzione int symlink(const char *oldpath, const char *newpath);
make a new name for a file
%eax%ebx%ecx %edx%esi%edi%ebp
83const char *oldpath const char *newpath    
__NR_oldlstat [Codice 84] : Nessuna funzione di libreria corrispondente
obsolete system calls
__NR_readlink [Codice 85] Funzione int readlink(const char *path, char *buf, size_t bufsiz);
read value of a symbolic link
%eax%ebx%ecx %edx%esi%edi%ebp
85const char *path char *buf size_t bufsiz   
__NR_uselib [Codice 86] Funzione int uselib(const char *library);
select shared library
%eax%ebx%ecx %edx%esi%edi%ebp
86const char *library     
__NR_swapon [Codice 87] Funzione int swapon(const char *path, int swapflags);
start/stop swapping to file/device
%eax%ebx%ecx %edx%esi%edi%ebp
87const char *path int swapflags    
__NR_reboot [Codice 88] Funzione int reboot(int flag);
reboot or enable/disable Ctrl-Alt-Del
%eax%ebx%ecx %edx%esi%edi%ebp
88int flag     
__NR_readdir [Codice 89] Funzione int readdir(unsigned int fd, struct dirent *dirp, unsigned int count);
read directory entry
%eax%ebx%ecx %edx%esi%edi%ebp
89unsigned int fd struct dirent *dirp unsigned int count   
__NR_mmap [Codice 90] Funzione void * mmap(void *start, size_t length, int prot , int flags, int fd, off_t offset);
map or unmap files or devices into memory
%eax%ebx%ecx %edx%esi%edi%ebp
90void *start size_t length int prot int flags int fd off_t offset
__NR_munmap [Codice 91] Funzione int munmap(void *start, size_t length);
map or unmap files or devices into memory
%eax%ebx%ecx %edx%esi%edi%ebp
91void *start size_t length    
__NR_truncate [Codice 92] Funzione int truncate(const char *path, off_t length);
truncate a file to a specified length
%eax%ebx%ecx %edx%esi%edi%ebp
92const char *path off_t length    
__NR_ftruncate [Codice 93] Funzione int ftruncate(int fd, off_t length);
truncate a file to a specified length
%eax%ebx%ecx %edx%esi%edi%ebp
93int fd off_t length    
__NR_fchmod [Codice 94] Funzione int fchmod(int fildes, mode_t mode);
change permissions of a file
%eax%ebx%ecx %edx%esi%edi%ebp
94int fildes mode_t mode    
__NR_fchown [Codice 95] Funzione int fchown(int fd, uid_t owner, gid_t group);
change ownership of a file
%eax%ebx%ecx %edx%esi%edi%ebp
95int fd uid_t owner gid_t group   
__NR_getpriority [Codice 96] Funzione int getpriority(int which, int who);
get/set program scheduling priority
%eax%ebx%ecx %edx%esi%edi%ebp
96int which int who    
__NR_setpriority [Codice 97] Funzione int setpriority(int which, int who, int prio);
get/set program scheduling priority
%eax%ebx%ecx %edx%esi%edi%ebp
97int which int who int prio   
__NR_profil [Codice 98] : Nessuna funzione di libreria corrispondente
unimplemented system calls
__NR_statfs [Codice 99] Funzione int statfs(const char *path, struct statfs *buf);
get file system statistics
%eax%ebx%ecx %edx%esi%edi%ebp
99const char *path struct statfs *buf    
__NR_fstatfs [Codice 100] Funzione int fstatfs(int fd, struct statfs *buf);
get file system statistics
%eax%ebx%ecx %edx%esi%edi%ebp
100int fd struct statfs *buf    
__NR_ioperm [Codice 101] Funzione int ioperm(unsigned long from, unsigned long num, int turn_on);
set port input/output permissions
%eax%ebx%ecx %edx%esi%edi%ebp
101unsigned long from unsigned long num int turn_on   
__NR_socketcall [Codice 102] Funzione int socketcall(int call, unsigned long *args);
socket system calls
%eax%ebx%ecx %edx%esi%edi%ebp
102int call unsigned long *args    
__NR_syslog [Codice 103] Funzione int syslog(int type, char *bufp, int len);
read and/or clear kernel message ring buffer; set console_loglevel
%eax%ebx%ecx %edx%esi%edi%ebp
103int type char *bufp int len   
__NR_setitimer [Codice 104] Funzione int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue);
get or set value of an interval timer
%eax%ebx%ecx %edx%esi%edi%ebp
104int which const struct itimerval *value struct itimerval *ovalue   
__NR_getitimer [Codice 105] Funzione int getitimer(int which, struct itimerval *value);
get or set value of an interval timer
%eax%ebx%ecx %edx%esi%edi%ebp
105int which struct itimerval *value    
__NR_stat [Codice 106] Funzione int stat(const char *file_name, struct stat *buf);
get file status
%eax%ebx%ecx %edx%esi%edi%ebp
106const char *file_name struct stat *buf    
__NR_lstat [Codice 107] Funzione int lstat(const char *file_name, struct stat *buf);
get file status
%eax%ebx%ecx %edx%esi%edi%ebp
107const char *file_name struct stat *buf    
__NR_fstat [Codice 108] Funzione int fstat(int filedes, struct stat *buf);
get file status
%eax%ebx%ecx %edx%esi%edi%ebp
108int filedes struct stat *buf    
__NR_olduname [Codice 109] : Nessuna funzione di libreria corrispondente
obsolete system calls
__NR_iopl [Codice 110] Funzione int iopl(int level);
change I/O privilege level
%eax%ebx%ecx %edx%esi%edi%ebp
110int level     
__NR_vhangup [Codice 111] Funzione int vhangup(void);
virtually hangup the current tty
%eax%ebx%ecx %edx%esi%edi%ebp
111      
__NR_idle [Codice 112] Funzione int idle(void);
make process 0 idle
%eax%ebx%ecx %edx%esi%edi%ebp
112      
__NR_vm86old [Codice 113] Funzione int vm86old(struct vm86_struct *info);
enter virtual 8086 mode
%eax%ebx%ecx %edx%esi%edi%ebp
113struct vm86_struct *info     
__NR_wait4 [Codice 114] Funzione pid_t wait4(pid_t pid, int *status, int options, struct rusage *rusage);
wait for process termination, BSD style
%eax%ebx%ecx %edx%esi%edi%ebp
114pid_t pid int *status int options struct rusage *rusage  
__NR_swapoff [Codice 115] Funzione int swapoff(const char *path);
start/stop swapping to file/device
%eax%ebx%ecx %edx%esi%edi%ebp
115const char *path     
__NR_sysinfo [Codice 116] Funzione int sysinfo(struct sysinfo *info);
returns information on overall system statistics
%eax%ebx%ecx %edx%esi%edi%ebp
116struct sysinfo *info     
__NR_ipc [Codice 117] Funzione int ipc(unsigned int call, int first, int second, int third, void *ptr, long fifth);
System V IPC system calls
%eax%ebx%ecx %edx%esi%edi%ebp
117unsigned int call int first int second int third void *ptr long fifth
__NR_fsync [Codice 118] Funzione int fsync(int fd);
synchronize a file’s complete in-core state with that on disk
%eax%ebx%ecx %edx%esi%edi%ebp
118int fd     
__NR_sigreturn [Codice 119] Funzione int sigreturn(unsigned long __unused);
return from signal handler and cleanup stack frame
%eax%ebx%ecx %edx%esi%edi%ebp
119unsigned long __unused     
__NR_clone [Codice 120] Funzione int clone(int (*fn)(void *), void *child_stack, int flags, void *arg);
create a child process
%eax%ebx%ecx %edx%esi%edi%ebp
120int clone(int (*fn)(void *) void *child_stack int flags void *arg);  
__NR_setdomainname [Codice 121] Funzione int setdomainname(const char *name, size_t len);
get/set domain name
%eax%ebx%ecx %edx%esi%edi%ebp
121const char *name size_t len    
__NR_uname [Codice 122] Funzione int uname(struct utsname *buf);
get name and information about current kernel
%eax%ebx%ecx %edx%esi%edi%ebp
122struct utsname *buf     
__NR_modify_ldt [Codice 123] Funzione int modify_ldt(int func, void *ptr, unsigned long bytecount);
get or set ldt
%eax%ebx%ecx%edx%esi%edi %ebp
123int func void *ptr unsigned long bytecount   
__NR_adjtimex [Codice 124] Funzione int adjtimex(struct timex *buf);
tune kernel clock
%eax%ebx%ecx %edx%esi%edi%ebp
124struct timex *buf     
__NR_mprotect [Codice 125] Funzione int mprotect(const void *addr, size_t len, int prot);
control allowable accesses to a region of memory
%eax%ebx%ecx %edx%esi%edi%ebp
125const void *addr size_t len int prot   
__NR_sigprocmask [Codice 126] Funzione int sigprocmask(int how, const sigset_t *set, sigset_t *oldset);
POSIX signal handling functions.
%eax%ebx%ecx %edx%esi%edi%ebp
126int how const sigset_t *set sigset_t *oldset   
__NR_create_module [Codice 127] Funzione caddr_t create_module(const char *name, size_t size);
create a loadable module entry
%eax%ebx%ecx %edx%esi%edi%ebp
127const char *name size_t size    
__NR_init_module [Codice 128] Funzione int init_module(const char *name, struct module *image);
initialize a loadable module entry
%eax%ebx%ecx %edx%esi%edi%ebp
128const char *name struct module *image    
__NR_delete_module [Codice 129] Funzione int delete_module(const char *name);
delete a loadable module entry
%eax%ebx%ecx %edx%esi%edi%ebp
129const char *name     
__NR_get_kernel_syms [Codice 130] Funzione int get_kernel_syms(struct kernel_sym *table);
retrieve exported kernel and module symbols
%eax%ebx%ecx %edx%esi%edi%ebp
130struct kernel_sym *table     
__NR_quotactl [Codice 131] Funzione int quotactl(int cmd, const char *special, int id, caddr_t addr);
manipulate disk quotas
%eax%ebx%ecx %edx%esi%edi%ebp
131int cmd const char *special int id caddr_t addr  
__NR_getpgid [Codice 132] Funzione pid_t getpgid(pid_t pid);
set/get process group
%eax%ebx%ecx %edx%esi%edi%ebp
132pid_t pid     
__NR_fchdir [Codice 133] Funzione int fchdir(int fd);
change working directory
%eax%ebx%ecx %edx%esi%edi%ebp
133int fd     
__NR_bdflush [Codice 134] Funzione int bdflush(int func, long data);
start, flush, or tune buffer-dirty-flush daemon
%eax%ebx%ecx %edx%esi%edi%ebp
134int func long data    
__NR_sysfs [Codice 135] Funzione int sysfs(int option);
get file system type information
%eax%ebx%ecx %edx%esi%edi%ebp
135int option     
__NR_personality [Codice 136] Funzione int personality(unsigned long persona);
set the process execution domain
%eax%ebx%ecx %edx%esi%edi%ebp
136unsigned long persona     
__NR_afs_syscall [Codice 137] : Nessuna funzione di libreria corrispondente
unimplemented system calls
__NR_setfsuid [Codice 138] Funzione int setfsuid(uid_t fsuid);
set user identity used for file system checks
%eax%ebx%ecx %edx%esi%edi%ebp
138uid_t fsuid     
__NR_setfsgid [Codice 139] Funzione int setfsgid(uid_t fsgid);
set group identity used for file system checks
%eax%ebx%ecx %edx%esi%edi%ebp
139uid_t fsgid     
__NR_getdents [Codice 141] Funzione int getdents(unsigned int fd, struct dirent *dirp, unsigned int count);
get directory entries
%eax%ebx%ecx %edx%esi%edi%ebp
141unsigned int fd struct dirent *dirp unsigned int count   
__NR_flock [Codice 143] Funzione int flock(int fd, int operation);
apply or remove an advisory lock on an open file
%eax%ebx%ecx %edx%esi%edi%ebp
143int fd int operation    
__NR_msync [Codice 144] Funzione int msync(const void *start, size_t length, int flags);
synchronize a file with a memory map
%eax%ebx%ecx %edx%esi%edi%ebp
144const void *start size_t length int flags   
__NR_readv [Codice 145] Funzione int readv(int fd, const struct iovec *vector, int count);
read or write a vector
%eax%ebx%ecx %edx%esi%edi%ebp
145int fd const struct iovec *vector int count   
__NR_writev [Codice 146] Funzione int writev(int fd, const struct iovec *vector, int count);
read or write a vector
%eax%ebx%ecx %edx%esi%edi%ebp
146int fd const struct iovec *vector int count   
__NR_getsid [Codice 147] Funzione pid_t getsid(pid_t pid);
get session ID
%eax%ebx%ecx %edx%esi%edi%ebp
147pid_t pid     
__NR_fdatasync [Codice 148] Funzione int fdatasync(int fd);
synchronize a file’s in-core data with that on disk
%eax%ebx%ecx %edx%esi%edi%ebp
148int fd     
__NR_mlock [Codice 150] Funzione int mlock(const void *addr, size_t len);
disable paging for some parts of memory
%eax%ebx%ecx %edx%esi%edi%ebp
150const void *addr size_t len    
__NR_munlock [Codice 151] Funzione int munlock(const void *addr, size_t len);
reenable paging for some parts of memory
%eax%ebx%ecx %edx%esi%edi%ebp
151const void *addr size_t len    
__NR_mlockall [Codice 152] Funzione int mlockall(int flags);
disable paging for calling process
%eax%ebx%ecx %edx%esi%edi%ebp
152int flags     
__NR_munlockall [Codice 153] Funzione int munlockall(void);
reenable paging for calling process
%eax%ebx%ecx %edx%esi%edi%ebp
153      
__NR_sched_setparam [Codice 154] Funzione int sched_setparam(pid_t pid, const struct sched_param *p);
set and get scheduling parameters
%eax%ebx%ecx %edx%esi%edi%ebp
154pid_t pid const struct sched_param *p    
__NR_sched_getparam [Codice 155] Funzione int sched_getparam(pid_t pid, struct sched_param *p);
set and get scheduling parameters
%eax%ebx%ecx %edx%esi%edi%ebp
155pid_t pid struct sched_param *p    
__NR_sched_setscheduler [Codice 156] Funzione int sched_setscheduler(pid_t pid, int policy, const struct sched_param *p);
set and get scheduling algorithm/parameters
%eax%ebx%ecx %edx%esi%edi%ebp
156pid_t pid int policy const struct sched_param *p   
__NR_sched_getscheduler [Codice 157] Funzione int sched_getscheduler(pid_t pid);
set and get scheduling algorithm/parameters
%eax%ebx%ecx %edx%esi%edi%ebp
157pid_t pid     
__NR_sched_yield [Codice 158] Funzione int sched_yield(void);
yield the processor
%eax%ebx%ecx %edx%esi%edi%ebp
158      
__NR_sched_get_priority_max [Codice 159] Funzione int sched_get_priority_max(int policy);
get static priority range
%eax%ebx%ecx %edx%esi%edi%ebp
159int policy     
__NR_sched_get_priority_min [Codice 160] Funzione int sched_get_priority_min(int policy);
get static priority range
%eax%ebx%ecx %edx%esi%edi%ebp
160int policy     
__NR_sched_rr_get_interval [Codice 161] Funzione int sched_rr_get_interval(pid_t pid, struct timespec *tp);
get the SCHED_RR interval for the named process
%eax%ebx%ecx %edx%esi%edi%ebp
161pid_t pid struct timespec *tp    
__NR_nanosleep [Codice 162] Funzione int nanosleep(const struct timespec *req, struct timespec *rem);
pause execution for a specified time
%eax%ebx%ecx %edx%esi%edi%ebp
162const struct timespec *req struct timespec *rem    
__NR_mremap [Codice 163] Funzione void * mremap(void *old_address, size_t old_size , size_t new_size, unsigned long flags);
re-map a virtual memory address
%eax%ebx%ecx %edx%esi%edi%ebp
163void *old_address size_t old_size size_t new_size unsigned long flags  
__NR_setresuid [Codice 164] Funzione int setresuid(uid_t ruid, uid_t euid, uid_t suid);
set real, effective and saved user or group ID
%eax%ebx%ecx %edx%esi%edi%ebp
164uid_t ruid uid_t euid uid_t suid   
__NR_getresuid [Codice 165] Funzione int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
get real, effective and saved user or group ID
%eax%ebx%ecx %edx%esi%edi%ebp
165uid_t *ruid uid_t *euid uid_t *suid   
__NR_vm86 [Codice 166] Funzione int vm86(unsigned long fn, struct vm86plus_struct *v86);
enter virtual 8086 mode
%eax%ebx%ecx %edx%esi%edi%ebp
166unsigned long fn struct vm86plus_struct *v86    
__NR_query_module [Codice 167] Funzione int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret);
query the kernel for various bits pertaining to modules.
%eax%ebx%ecx %edx%esi%edi%ebp
167const char *name int which void *buf size_t bufsize size_t *ret 
__NR_poll [Codice 168] Funzione int poll(struct pollfd *ufds, unsigned int nfds, int timeout);
wait for some event on a file descriptor
%eax%ebx%ecx %edx%esi%edi%ebp
168struct pollfd *ufds unsigned int nfds int timeout   
__NR_nfsservctl [Codice 169] Funzione nfsservctl(int cmd, struct nfsctl_arg *argp, union nfsctl_res *resp);
syscall interface to kernel nfs daemon
%eax%ebx%ecx %edx%esi%edi%ebp
169int cmd struct nfsctl_arg *argp union nfsctl_res *resp   
__NR_setresgid [Codice 170] Funzione int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
set real, effective and saved user or group ID
%eax%ebx%ecx %edx%esi%edi%ebp
170gid_t rgid gid_t egid gid_t sgid   
__NR_getresgid [Codice 171] Funzione int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
get real, effective and saved user or group ID
%eax%ebx%ecx %edx%esi%edi%ebp
171gid_t *rgid gid_t *egid gid_t *sgid   
__NR_prctl [Codice 172] Funzione int prctl(int option, unsigned long arg2, unsigned long arg3 , unsigned long arg4, unsigned long arg5);
operations on a process
%eax%ebx%ecx %edx%esi%edi%ebp
172int option unsigned long arg2 unsigned long arg3 unsigned long arg4 unsigned long arg5 
__NR_rt_sigreturn [Codice 173] : Nessuna funzione di libreria corrispondente
No description Available
__NR_rt_sigaction [Codice 174] : Nessuna funzione di libreria corrispondente
No description Available
__NR_rt_sigprocmask [Codice 175] : Nessuna funzione di libreria corrispondente
No description Available
__NR_rt_sigpending [Codice 176] : Nessuna funzione di libreria corrispondente
No description Available
__NR_rt_sigtimedwait [Codice 177] : Nessuna funzione di libreria corrispondente
No description Available
__NR_rt_sigqueueinfo [Codice 178] : Nessuna funzione di libreria corrispondente
No description Available
__NR_rt_sigsuspend [Codice 179] : Nessuna funzione di libreria corrispondente
No description Available
__NR_pread [Codice 180] Funzione ssize_t pread(int fd, void *buf, size_t count, off_t offset);
read from or write to a file descriptor at a given offset
%eax%ebx%ecx %edx%esi%edi%ebp
180int fd void *buf size_t count off_t offset  
__NR_pwrite [Codice 181] Funzione ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
read from or write to a file descriptor at a given offset
%eax%ebx%ecx %edx%esi%edi%ebp
181int fd const void *buf size_t count off_t offset  
__NR_chown [Codice 182] Funzione int chown(const char *path, uid_t owner, gid_t group);
change ownership of a file
%eax%ebx%ecx %edx%esi%edi%ebp
182const char *path uid_t owner gid_t group   
__NR_getcwd [Codice 183] : Nessuna funzione di libreria corrispondente
No description Available
__NR_capget [Codice 184] Funzione int capget(cap_user_header_t header, cap_user_data_t data);
set/get process capabilities
%eax%ebx%ecx %edx%esi%edi%ebp
184cap_user_header_t header cap_user_data_t data    
__NR_capset [Codice 185] Funzione int capset(cap_user_header_t header, const cap_user_data_t data);
set/get process capabilities
%eax%ebx%ecx %edx%esi%edi%ebp
185cap_user_header_t header const cap_user_data_t data    
__NR_sigaltstack [Codice 186] Funzione int sigaltstack(const stack_t *ss, stack_t *oss);
set and/or get signal stack context
%eax%ebx%ecx %edx%esi%edi%ebp
186const stack_t *ss stack_t *oss    
__NR_sendfile [Codice 187] Funzione ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
transfer data between file descriptors
%eax%ebx%ecx %edx%esi%edi%ebp
187int out_fd int in_fd off_t *offset size_t count  
__NR_getpmsg [Codice 188] : Nessuna funzione di libreria corrispondente
No description Available
__NR_putpmsg [Codice 189] : Nessuna funzione di libreria corrispondente
No description Available
__NR_vfork [Codice 190] Funzione pid_t vfork(void);
create a child process and block parent
%eax%ebx%ecx %edx%esi%edi%ebp
190      
__NR_ugetrlimit [Codice 191] : Nessuna funzione di libreria corrispondente
No description Available
__NR_mmap2 [Codice 192] : Nessuna funzione di libreria corrispondente
No description Available
__NR_truncate64 [Codice 193] : Nessuna funzione di libreria corrispondente
No description Available
__NR_ftruncate64 [Codice 194] : Nessuna funzione di libreria corrispondente
No description Available
__NR_stat64 [Codice 195] : Nessuna funzione di libreria corrispondente
No description Available
__NR_lstat64 [Codice 196] : Nessuna funzione di libreria corrispondente
No description Available
__NR_fstat64 [Codice 197] : Nessuna funzione di libreria corrispondente
No description Available
__NR_lchown32 [Codice 198] : Nessuna funzione di libreria corrispondente
No description Available
__NR_getuid32 [Codice 199] : Nessuna funzione di libreria corrispondente
No description Available
__NR_getgid32 [Codice 200] : Nessuna funzione di libreria corrispondente
No description Available
__NR_geteuid32 [Codice 201] : Nessuna funzione di libreria corrispondente
No description Available
__NR_getegid32 [Codice 202] : Nessuna funzione di libreria corrispondente
No description Available
__NR_setreuid32 [Codice 203] : Nessuna funzione di libreria corrispondente
No description Available
__NR_setregid32 [Codice 204] : Nessuna funzione di libreria corrispondente
No description Available
__NR_getgroups32 [Codice 205] : Nessuna funzione di libreria corrispondente
No description Available
__NR_setgroups32 [Codice 206] : Nessuna funzione di libreria corrispondente
No description Available
__NR_fchown32 [Codice 207] : Nessuna funzione di libreria corrispondente
No description Available
__NR_setresuid32 [Codice 208] : Nessuna funzione di libreria corrispondente
No description Available
__NR_getresuid32 [Codice 209] : Nessuna funzione di libreria corrispondente
No description Available
__NR_setresgid32 [Codice 210] : Nessuna funzione di libreria corrispondente
No description Available
__NR_getresgid32 [Codice 211] : Nessuna funzione di libreria corrispondente
No description Available
__NR_chown32 [Codice 212] : Nessuna funzione di libreria corrispondente
No description Available
__NR_setuid32 [Codice 213] : Nessuna funzione di libreria corrispondente
No description Available
__NR_setgid32 [Codice 214] : Nessuna funzione di libreria corrispondente
No description Available
__NR_setfsuid32 [Codice 215] : Nessuna funzione di libreria corrispondente
No description Available
__NR_setfsgid32 [Codice 216] : Nessuna funzione di libreria corrispondente
No description Available
__NR_pivot_root [Codice 217] Funzione int pivot_root(const char *new_root, const char *put_old);
change the root file system
%eax%ebx%ecx %edx%esi%edi%ebp
217const char *new_root const char *put_old    
__NR_mincore [Codice 218] Funzione int mincore(void *start, size_t length, unsigned char *vec);
get information on whether pages are in core
%eax%ebx%ecx %edx%esi%edi%ebp
218void *start size_t length unsigned char *vec   
__NR_madvise [Codice 219] Funzione int madvise(void *start, size_t length, int advice);
give advice about use of memory
%eax%ebx%ecx %edx%esi%edi%ebp
219void *start size_t length int advice   
__NR_getdents64 [Codice 220] : Nessuna funzione di libreria corrispondente
No description Available
__NR_fcntl64 [Codice 221] : Nessuna funzione di libreria corrispondente
No description Available
__NR_security [Codice 223] : Nessuna funzione di libreria corrispondente
No description Available
__NR_gettid [Codice 224] : Nessuna funzione di libreria corrispondente
No description Available
__NR_readahead [Codice 225] : Nessuna funzione di libreria corrispondente
No description Available
__NR_setxattr [Codice 226] : Nessuna funzione di libreria corrispondente
No description Available
__NR_lsetxattr [Codice 227] : Nessuna funzione di libreria corrispondente
No description Available
__NR_fsetxattr [Codice 228] : Nessuna funzione di libreria corrispondente
No description Available
__NR_getxattr [Codice 229] : Nessuna funzione di libreria corrispondente
No description Available
__NR_lgetxattr [Codice 230] : Nessuna funzione di libreria corrispondente
No description Available
__NR_fgetxattr [Codice 231] : Nessuna funzione di libreria corrispondente
No description Available
__NR_listxattr [Codice 232] : Nessuna funzione di libreria corrispondente
No description Available
__NR_llistxattr [Codice 233] : Nessuna funzione di libreria corrispondente
No description Available
__NR_flistxattr [Codice 234] : Nessuna funzione di libreria corrispondente
No description Available
__NR_removexattr [Codice 235] : Nessuna funzione di libreria corrispondente
No description Available
__NR_lremovexattr [Codice 236] : Nessuna funzione di libreria corrispondente
No description Available
__NR_fremovexattr [Codice 237] : Nessuna funzione di libreria corrispondente
No description Available

[Home Page dell'ITIS "Fermi"] [Indice Quarta] [Precedente] [Successivo]