Linux下有哪些系统调用,在哪里可以查到
在/usr/include/asm/unistd.h
具体内容如代码所示
- /* File autogenerated by 'make headers_install' */
- #ifndef __ASM_STUB_UNISTD_H
- #define __ASM_STUB_UNISTD_H
- # if defined __x86_64__
- # include <asm-x86_64/unistd.h>
- # elif defined __i386__
- # include <asm-i386/unistd.h>
- # else
- # warning This machine appears to be neither x86_64 nor i386.
- # endif
- #endif /* __ASM_STUB_UNISTD_H */
- ~
我的机器是x86_64 位系统,内容为
- ifndef _ASM_X86_64_UNISTD_H_
- #define _ASM_X86_64_UNISTD_H_
- #ifndef __SYSCALL
- #define __SYSCALL(a,b)
- #endif
- /*
- * This file contains the system call numbers.
- *
- * Note: holes are not allowed.
- */
- /* at least 8 syscall per cacheline */
- #define __NR_read 0
- __SYSCALL(__NR_read, sys_read)
- #define __NR_write 1
- __SYSCALL(__NR_write, sys_write)
- #define __NR_open 2
- __SYSCALL(__NR_open, sys_open)
- #define __NR_close 3
- __SYSCALL(__NR_close, sys_close)
- #define __NR_stat 4
- __SYSCALL(__NR_stat, sys_newstat)
- #define __NR_fstat 5
- __SYSCALL(__NR_fstat, sys_newfstat)
- #define __NR_lstat 6
- __SYSCALL(__NR_lstat, sys_newlstat)
- #define __NR_poll 7
- __SYSCALL(__NR_poll, sys_poll)
- #define __NR_lseek 8
- __SYSCALL(__NR_lseek, sys_lseek)
- #define __NR_mmap 9
- __SYSCALL(__NR_mmap, sys_mmap)
- #define __NR_mprotect 10
- __SYSCALL(__NR_mprotect, sys_mprotect)
- #define __NR_munmap 11
- __SYSCALL(__NR_munmap, sys_munmap)
- #define __NR_brk 12
- __SYSCALL(__NR_brk, sys_brk)
- #define __NR_rt_sigaction 13
- __SYSCALL(__NR_rt_sigaction, sys_rt_sigaction)
- #define __NR_rt_sigprocmask 14
- __SYSCALL(__NR_rt_sigprocmask, sys_rt_sigprocmask)
- #define __NR_rt_sigreturn 15
- __SYSCALL(__NR_rt_sigreturn, stub_rt_sigreturn)
阅读(2111) | 评论(0) | 转发(1) |