Kernel系统调用功能分类

原创 2013年12月04日 22:16:07
1 源码文件
/*
 *  linux/include/asm-arm/unistd.h
 *
 *  Copyright (C) 2001-2005 Russell King
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
 * no matter what the change is.  Thanks!
 */
#ifndef __ASM_ARM_UNISTD_H
#define __ASM_ARM_UNISTD_H

// 这里定义系统调用的起始地址,应该是虚拟地址
#define __NR_OABI_SYSCALL_BASE 0x900000

// 这里定义系统调用号的起始数字
#if defined(__thumb__) || defined(__ARM_EABI__)
#define __NR_SYSCALL_BASE 0
#else
#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
#endif

/*
 * This file contains the system call numbers.
 */

/*
格式:
#define __NR_syscal_name                (__NR_SYSCAL_BASE+ number)       
通过前面定义的起始数字,这里依次递增   
*/

/*
restart_syscal()
重启系统调用
*/
#define __NR_restart_syscall (__NR_SYSCALL_BASE+  0)

/*
_exit(int status)
终止当前进程
*/
#define __NR_exit (__NR_SYSCALL_BASE+  1)

/*
pid_t fork(void)
创建一个子进程
*/
#define __NR_fork (__NR_SYSCALL_BASE+  2)

/*
ssize_t read(int fd, void *buf, size_t count)
从指定文件描述符中读取对应文件中指定数目的字符
*/
#define __NR_read (__NR_SYSCALL_BASE+  3)

/*
ssize_t write(int fd, void *buf, size_t count)
向指定文件描述符中写入特定数目的字符
*/
#define __NR_write (__NR_SYSCALL_BASE+  4)

/*
int open(const char *pathname, int flags)
int open(const char *pathname, int flags, mode_t mode)
int open(const char *pathname, mode_t mode)
打开或者创建一个文件或设备,返回文件描述符
*/
#define __NR_open (__NR_SYSCALL_BASE+  5)

/*
int close(int fd)
关闭指定文件描述符
*/
#define __NR_close (__NR_SYSCALL_BASE+  6)
/* 7 was sys_waitpid */

/*
在内核中转化调用open
*/
#define __NR_creat (__NR_SYSCALL_BASE+  8)

/*
int link(const char *oldpath, const char *newpath)
为指定文件创建新名字,也是俗称的hard link
*/
#define __NR_link (__NR_SYSCALL_BASE+  9)

/*
int unlink(const char *pathname)
删除一个文件的名字,有可能删除这个文件,也就是删除指定的硬链接,当删除的是最后一个链接到这个文件的链接时,这个文件会被删除。
*/
#define __NR_unlink (__NR_SYSCALL_BASE+ 10)

/*
int execve(const char *filename, char *const argv[], char* const envp[])
通过指定文件名字,执行这个程序,被调用程序的text、data、bss、stack会替换掉当前进程的对应段,并且继承当前进程的PID和已经打开的文件。成功执行后是没有机会返回的,代码段都被替换掉了,就从新进程的起始部分继续执行了哦。
*/
#define __NR_execve (__NR_SYSCALL_BASE+ 11)

/*
int chdir(const char *path)
int fchdir(fd)
将当前工作文件夹切换到指定文件夹,chdir和fchdir功能相同,只不过chdir传入指定文件夹路径,而fchdir传入指定文件夹的文件描述符
*/
#define __NR_chdir (__NR_SYSCALL_BASE+ 12)

/*
time_t time(time_t *t)
以秒的形式获取当前时间,从Epoch到当前的秒数
*/
#define __NR_time (__NR_SYSCALL_BASE+ 13)

/*
int mknod(const char *pathname, mode_t mode, dev_t dev)
创建一个特殊或者一般的文件,也就是创建一个文件系统节点(文件,设备文件或者命名管道),通过mode和dev来设定属性
*/
#define __NR_mknod (__NR_SYSCALL_BASE+ 14)

/*
int chmod(const char *pathname, mode_t mode)
int fchmod(int fd, mode_t mode)
修改文件的权限
*/
#define __NR_chmod (__NR_SYSCALL_BASE+ 15)

/*
int chown(const char *path, uid_t owner, gid_t group)
int fchown(int fd, uid_t owner, gid_t group)
int lchown(const char *path, uid_t owner, gid_t group)
修改文件所属权
*/
#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
/* 17 was sys_break */
/* 18 was sys_stat */
/*
off_t lssk(int fd, off_t offset, int whence)
重定位读/写文件偏移值
*/
#define __NR_lseek (__NR_SYSCALL_BASE+ 19)

/*
pid_t getpid(void)
pid_t getppid(void)
getpid 获取调用进程的pid
getppid 获取调用进程父进程的pid
*/
#define __NR_getpid (__NR_SYSCALL_BASE+ 20)

/*
int mount(const char *source, const char *target,
          const char *filesystemtype, unsigned long mountflags,
          const void *data)
挂载文件系统
*/
#define __NR_mount (__NR_SYSCALL_BASE+ 21)

/*
int umount(const char *target)
int umount2(const char *target, int flags)
卸载文件系统,通过target来指定,linux 2.1.116后添加的umount2通过传入flags来指定操作的控制,如强制卸载等
*/
#define __NR_umount (__NR_SYSCALL_BASE+ 22)

/*
int setuid(uid_t uid)
设置用户标识符,调用进程的有效用户ID
*/
#define __NR_setuid (__NR_SYSCALL_BASE+ 23)

/*
uid_t getuid(void)
uid_t geteuid(void)
获取用户标识符,
getuid() 返回调用进程的实际用户ID
geteuid() 返回调用进程的有效用户ID
*/
#define __NR_getuid (__NR_SYSCALL_BASE+ 24)

/*
int stime(time_t *t)
设置时间,单位是秒
*/
#define __NR_stime (__NR_SYSCALL_BASE+ 25)

/*
long ptrace(enum __ptrace_request request, pid_t pid,
            void *addr, void *data)
进程跟踪,这个为对一个进程对执行的另一个进程进行查看和控制提供了支持,用于实现断点和系统调用跟踪的程序
*/
#define __NR_ptrace (__NR_SYSCALL_BASE+ 26)

/*
unsigned int alarm(unsigned int seconds)
对调用进程添加一个闹钟,用来在指定时间后发送一个SIGALRM的信号
*/
#define __NR_alarm (__NR_SYSCALL_BASE+ 27)
/* 28 was sys_fstat */

/*
int pause(void)
等待信号发生,导致调用进程进入睡眠状态,直到有信号发生,调用进程转为终止或者触发信号处理函数
*/
#define __NR_pause (__NR_SYSCALL_BASE+ 29)

/*
int utime(const char *filename, const struct utimebuf *times)
int utimes(const char *filename, const struct timeval times[2])
修改文件最后访问和修改时间
utime 设置时间时使用struct utimebuf,这样只能精确到秒
utimes 设置时间使用struct timeval,可以精确到毫秒
*/
#define __NR_utime (__NR_SYSCALL_BASE+ 30)
/* 31 was sys_stty */
/* 32 was sys_gtty */

/*
int access(const char *path, int mode)
检查文件的实际用户的权限
通过mode参数传入要检测的权限,如果可以按照这个权限访问,则返回0,否则返回-1
*/
#define __NR_access (__NR_SYSCALL_BASE+ 33)

/*
int nice(int inc)
修改进程优先级
*/
#define __NR_nice (__NR_SYSCALL_BASE+ 34)
/* 35 was sys_ftime */

/*
void sync(void)
int syncfs(int fd)
提交缓冲区缓存到硬盘
sync导致所有这个文件被缓存的修改,如metadata和data,都被写入底层文件系统
syncfs和sync功能一样,只不过只同步和传入fd文件描述符相关的数据写入硬盘
*/
#define __NR_sync (__NR_SYSCALL_BASE+ 36)

/*
int kill(pid_t pid, int sig)
向指定进程发送signal
不只是9这个终止信号
*/
#define __NR_kill (__NR_SYSCALL_BASE+ 37)

/*
int rename(const char *oldpath, const char *newpath)
修改文件的名字或地址
*/
#define __NR_rename (__NR_SYSCALL_BASE+ 38)

/*
int mkdir(const char *pathname, mode_t mode)
创建一个目录,并且设定权限为mode,实际上是mode & ~umast & 0777
*/
#define __NR_mkdir (__NR_SYSCALL_BASE+ 39)

/*
int rmdir(const char *pathname)
删除一个目录,必须是空的。
*/
#define __NR_rmdir (__NR_SYSCALL_BASE+ 40)

/*
int dup(int oldfd)
int dup2(int oldfd, int newfd)
复制一个文件描述符
dup() 用当前可用的最小文件描述符数作为新描述符
dup2() 用给定的newfd复制oldfd,如果必要会关闭newfd
*/
#define __NR_dup (__NR_SYSCALL_BASE+ 41)

/*
int pipe(int pipefd[2])
int pipe2(int pipefd[2], int flags)
创建一个管道
一个为定向的数据通道可以用来进行进程间通讯。pipefd这个数组是用来返回指向管道两段的文件描述符。pipefd[0]指向管道的读端口,pipefd[1]用来指向管道的写端。
*/
#define __NR_pipe (__NR_SYSCALL_BASE+ 42)

/*
clock_t time(struct tms *buf)
获取与调用进程相关的时间信息
struct tms {
    clock_t tms_utime;// 执行调用进程指令所花费的CPU时间
    clock_t tms_stime;// 
    clock_t tms_cutime;
    clock_t tms_cstime;
};
信息较复杂,这里先不分析了
*/
#define __NR_times (__NR_SYSCALL_BASE+ 43)
/* 44 was sys_prof */

/*
int brk(void *addr)
void *sbrk(intptr_t increment)
改变调用进程的数据段size
brk() 设置数据段结尾地址为传入参数addr,当addr值是合理的,并且系统有足够的内存,并且进程没有查过最大数据size
sbrk() 增长进程数据空间increment个字节
*/
#define __NR_brk (__NR_SYSCALL_BASE+ 45)

/*
int setgid(gid_t gid)
设置组标识符
设置调用进程的有效组ID
*/
#define __NR_setgid (__NR_SYSCALL_BASE+ 46)

/*
gid_t getgid(void)
gid_t getegid(void);
获取组标识符
getgid() 返回调用进程的实际组ID
getegid() 返回调用进程的有效组ID
*/
#define __NR_getgid (__NR_SYSCALL_BASE+ 47)
/* 48 was sys_signal */

/*
上面已经在getuid那里一起介绍过了
*/
#define __NR_geteuid (__NR_SYSCALL_BASE+ 49)

/*
上面已经在getuid那里一起介绍过了
*/
#define __NR_getegid (__NR_SYSCALL_BASE+ 50)

/*
int acct(const char *filename)
开启或关闭进程统计
如果参数为NULL,则关闭进程统计信息
如果参数不为NULL,则开启,并
这个不明白
*/
#define __NR_acct (__NR_SYSCALL_BASE+ 51)

/*
在umount时讨论过了
*/
#define __NR_umount2 (__NR_SYSCALL_BASE+ 52)
/* 53 was sys_lock */

/*
int ioctl(int d, int request, ...)
对设备进行控制,d是打开文件的描述符,设备文件,request有很多参数,也要根据设备的驱动来做
*/
#define __NR_ioctl (__NR_SYSCALL_BASE+ 54)

/*
int fcntl(int fd, int cmd, .../* arg */)
操作文件描述符
对指定的文件描述符执行cmd所指定的操作,如复制文件描述符、设置文件描述符对应文件的flags等
*/
#define __NR_fcntl (__NR_SYSCALL_BASE+ 55)
/* 56 was sys_mpx */

/*
int setpgid(pid_t pid, pid_t pgid)
pid_t getpgid(pid_t pid)

pid_t getpgrp(void)
pid_t getpgrp(pid_t pid)

int setpgrp(void)
int setpgrp(pid_t pid, pid_t pgid)

获取和设置进程组ID
*/
#define __NR_setpgid (__NR_SYSCALL_BASE+ 57)
/* 58 was sys_ulimit */
/* 59 was sys_olduname */

/*
mode_t umast(mode_t mask)
设置创建文件mode的掩码,设置完后,在创建文件时传入的mode会与~mask进行与操作
*/
#define __NR_umask (__NR_SYSCALL_BASE+ 60)

/*
int chroot(const char *path)
切换root文件夹,也就是将/开始的路径重定位从path指定的路径开始
*/
#define __NR_chroot (__NR_SYSCALL_BASE+ 61)

/*
int ustat(dev_t dev, struct ustat *ubuf)
获取文件系统统计信息,如总的free块,free indoes数等
*/
#define __NR_ustat (__NR_SYSCALL_BASE+ 62)

/*
上面讨论过
*/
#define __NR_dup2 (__NR_SYSCALL_BASE+ 63)

/*
上面讨论过
*/
#define __NR_getppid (__NR_SYSCALL_BASE+ 64)

/*
上面讨论过
*/
#define __NR_getpgrp (__NR_SYSCALL_BASE+ 65)

/*
pid_t setsid(void)
如果调用进程不是一个进程组的leader,则创建一个新session。这个进程组合session不是很清楚
*/
#define __NR_setsid (__NR_SYSCALL_BASE+ 66)

/*
int sigaction(int signum, const struct sigaction *act,
              struct sigaction *oldact);
用来改变当进程接受到特定signal时候执行action
signum指定信号
act指定新的action
*/
#define __NR_sigaction (__NR_SYSCALL_BASE+ 67)
/* 68 was sys_sgetmask */
/* 69 was sys_ssetmask */

/*
int setreuid(uid_t ruid, uid_t euid)
int setregid(gid_t rgid, gid_t egid)
设置real或effective用户或组ID,前面有单独的,这个只不过是组合了起来
*/
#define __NR_setreuid (__NR_SYSCALL_BASE+ 70)

/*
如上
*/
#define __NR_setregid (__NR_SYSCALL_BASE+ 71)

/*
int sigsuspend(const sigset_t *mask)
是调用进程等待信号发生,并通过mask临时改变进程默认signal mask
*/
#define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72)

/*
int sigpending(sigset_t *set)
返回等待传输给调用进程的信号集合
*/
#define __NR_sigpending (__NR_SYSCALL_BASE+ 73)

/*
int gethostname(char *name, size_t len)
int sethostname(const char *name, size_t len)
获取或设置hostname
*/
#define __NR_sethostname (__NR_SYSCALL_BASE+ 74)

/*
int getrlimit(int resource, struct rlimit *rlim)
int setrlimit(int resource, const struct rlimit *rlim)

int prlimit(pid_t pid, int resource, const struct rlimit *new_limit,
            struct rlimit *old_limit)
获取和设置指定资源限制,资源限制有软硬限制,
struct rlimit {
    rlim_t rlim_cur; // soft limit
    rlim_t rlim_max; // hard limit
}
prlimit()是set和get的组合,对任意进程进行资源限制操作
*/
#define __NR_setrlimit (__NR_SYSCALL_BASE+ 75)

/*
同上
*/
#define __NR_getrlimit (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */

/*
int getrusage(int who, struct rusage *usage)
获取资源使用情况信息
who用来指定信息所属主,有如下选项
RUSAGE_SELF
RUSAGE_CHILDREN
RUSAGE_THREAD
usage用来存储返回的资源使用信息
     struct rusage {
               struct timeval ru_utime; /* user CPU time used */
               struct timeval ru_stime; /* system CPU time used */
               long   ru_maxrss;        /* maximum resident set size */
               long   ru_ixrss;         /* integral shared memory size */
               long   ru_idrss;         /* integral unshared data size */
               long   ru_isrss;         /* integral unshared stack size */
               long   ru_minflt;        /* page reclaims (soft page faults) */
               long   ru_majflt;        /* page faults (hard page faults) */
               long   ru_nswap;         /* swaps */
               long   ru_inblock;       /* block input operations */
               long   ru_oublock;       /* block output operations */
               long   ru_msgsnd;        /* IPC messages sent */
               long   ru_msgrcv;        /* IPC messages received */
               long   ru_nsignals;      /* signals received */
               long   ru_nvcsw;         /* voluntary context switches */
               long   ru_nivcsw;        /* involuntary context switches */
           };

*/
#define __NR_getrusage (__NR_SYSCALL_BASE+ 77)

/*
int gettimeofday(struct timeval *tv, struct timezone *tz)
int settimeofday(const struct timeval *tv, const struct timezone *tz)
获取和设置时间
*/
#define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78)

/*
同上
*/
#define __NR_settimeofday (__NR_SYSCALL_BASE+ 79)

/*
int getgroups(int size, gid_t list[])
int setgroups(size_t size, const gid_t *list)
获取和设置额外的组IDs
*/
#define __NR_getgroups (__NR_SYSCALL_BASE+ 80)

/*
同上
*/
#define __NR_setgroups (__NR_SYSCALL_BASE+ 81)

/*
int select(int nfds, fd_set *readfds, fd_set *writefds,
           fd_set *exceptfds, struct timeval *timeout)
void FD_CLR(int fd, fd_set *set)
int FD_ISSET(int fd, fd_set *set)
void FD_SET(int fd, fd_set *set)
void FD_ZERO(fd_set *set)
int pselect(int nfds, fd_set *readfds, fd_set *writefds,
            fd_set *exceptfds, const struct timespec *timeout,
            const sigset_t *sigmask)
同步I/O多路复用
*/
#define __NR_select (__NR_SYSCALL_BASE+ 82)

/*
int symlink(const char *oldpath, const char *newpath)
为一个文件创建一个新名字,符号链接,可以指向目录
*/
#define __NR_symlink (__NR_SYSCALL_BASE+ 83)
/* 84 was sys_lstat */

/*
ssize_t readlink(const char *path, char *buf, size_t bufsize)
读取一个符号链接的值,也就是将符号链接的path路径存储在buf中,readlink不会自动在buf末尾添加NULL。
*/
#define __NR_readlink (__NR_SYSCALL_BASE+ 85)

/*
int uselib(const char *library)
加载动态链接库,library是连接库文件的路径
*/
#define __NR_uselib (__NR_SYSCALL_BASE+ 86)

/*
int swapon(const char *path, int swapflags)
int swapoff(const char *path)
开启或停止对某个文件或设备的交换分区
*/
#define __NR_swapon (__NR_SYSCALL_BASE+ 87)

/*
int reboot(int magic, int magic2, int cmd, void *argc)
int reboot(int cmd)
重启系统或者开启/关闭Ctrl-Alt-Del功能(也就是重启的快捷键),选择哪个功能通过cmd参数来设定
*/
#define __NR_reboot (__NR_SYSCALL_BASE+ 88)

/*
int readdir(unsigned int fd, struct old_linux_dirent *dirrp
            unsigned int count)
是对老的old_linx_dirent的支持
*/
#define __NR_readdir (__NR_SYSCALL_BASE+ 89)

/*
void *mmap(void *addr, size_t length, int prot, int flags,
           int fd, off_t offset)
int munmap(void *addr, size_t length)
在调用进程的虚拟地址空间中创建一个新的映射。
mmap()将文件fd从偏移offset的地址后长度为length的字节映射到addr地址后面,prot和flags设置一些权限。
munmap()取消从addr开始长度为length的地址映射,取消之后,所有应用addr后length长度内的引用全部失效,会报错。
*/
#define __NR_mmap (__NR_SYSCALL_BASE+ 90)

/*
同上
*/
#define __NR_munmap (__NR_SYSCALL_BASE+ 91)

/*
int truncate(const char *path, off_t length)
int ftruncate(int fd, off_t length)
剪裁一个文件为指定长度
*/
#define __NR_truncate (__NR_SYSCALL_BASE+ 92)

/*
同上
*/
#define __NR_ftruncate (__NR_SYSCALL_BASE+ 93)

/*
同chmod
*/
#define __NR_fchmod (__NR_SYSCALL_BASE+ 94)

/*
同chown
*/
#define __NR_fchown (__NR_SYSCALL_BASE+ 95)

/*
int getpriority(int which, int who)
int setpriority(int which, int who, int prio)
获取或设置程序调度优先级,which指定是获取那种优先级,有如下选项
PRIO_PRCESS/PRIO_PGRP/PRIO_USER
who根据which的不同而不同,进程是pid,进程组是pgid,用户是uid
*/
#define __NR_getpriority (__NR_SYSCALL_BASE+ 96)

/*
同上
*/
#define __NR_setpriority (__NR_SYSCALL_BASE+ 97)
/* 98 was sys_profil */

/*
int statfs(const char *path, struct statfs *buf)
int fstatfs(int fd, struct statfs *buf)
获取文件系统统计信息,struct statfs结构定义如下
struct statfs {
               __SWORD_TYPE f_type;    /* type of file system (see below) */
               __SWORD_TYPE f_bsize;   /* optimal transfer block size */
               fsblkcnt_t   f_blocks;  /* total data blocks in file system */
               fsblkcnt_t   f_bfree;   /* free blocks in fs */
               fsblkcnt_t   f_bavail;  /* free blocks available to
                                          unprivileged user */
               fsfilcnt_t   f_files;   /* total file nodes in file system */
               fsfilcnt_t   f_ffree;   /* free file nodes in fs */
               fsid_t       f_fsid;    /* file system id */
               __SWORD_TYPE f_namelen; /* maximum length of filenames */
               __SWORD_TYPE f_frsize;  /* fragment size (since Linux 2.6) */
               __SWORD_TYPE f_spare[5];
           };

*/
#define __NR_statfs (__NR_SYSCALL_BASE+ 99)
/*
同上
*/
#define __NR_fstatfs (__NR_SYSCALL_BASE+100)
/* 101 was sys_ioperm */

/*
int socketcall(int call, unsigned long *args)
socket系统调用,call来指明调用哪个命令,arg指向一块存储传给这个命令额参数的地址
这个命令在用户程序中一般不用,一般使用C库封装好的。
*/
#define __NR_socketcall (__NR_SYSCALL_BASE+102)

/*
int syslog(int type, char *bufp, int len)
int klogctl(int type, char *bufp, int len)
读取或清空内核消息环形缓冲区;设置console_loglevel
*/
#define __NR_syslog (__NR_SYSCALL_BASE+103)

/*
int getitimer(int which, struct itimerval *curr_value)
int setitimer(int which, const struct itimerval *newvalue,
              struct itimerval *oldvalue)
获取或设置内部计时器的值,which用来指定哪个类型的时钟,有如下三个选项
ITIMER_REAL 实时递减,在超时后发送SIGALRM信号
ITIMER_VIRTUAL 只有当进程执行时才递减,发送SIGVTALRM
ITIMER_PROF 当进程执行或系统代表这个进程执行时都递减,发出SIGPROF
*/
#define __NR_setitimer (__NR_SYSCALL_BASE+104)
/*
同上
*/
#define __NR_getitimer (__NR_SYSCALL_BASE+105)

/*
int stat(const char *path, struct stat *buf)
int fstat(int fd, struct stat *buf)
int lstat(const char *path, struct stat *buf)
获取文件状态
stat 通过路径来指定文件
fstat() 通过文件描述符来指定文件
lstat 通过路径来指定,如果路径指定的是一个符号链接文件,则返回符号链接文件stat,而不是指向的文件
    struct stat {
               dev_t     st_dev;     /* ID of device containing file */
               ino_t     st_ino;     /* inode number */
               mode_t    st_mode;    /* protection */
               nlink_t   st_nlink;   /* number of hard links */
               uid_t     st_uid;     /* user ID of owner */
               gid_t     st_gid;     /* group ID of owner */
               dev_t     st_rdev;    /* device ID (if special file) */
               off_t     st_size;    /* total size, in bytes */
               blksize_t st_blksize; /* blocksize for file system I/O */
               blkcnt_t  st_blocks;  /* number of 512B blocks allocated */
               time_t    st_atime;   /* time of last access */
               time_t    st_mtime;   /* time of last modification */
               time_t    st_ctime;   /* time of last status change */
           };

*/
#define __NR_stat (__NR_SYSCALL_BASE+106)
/*
同上
*/
#define __NR_lstat (__NR_SYSCALL_BASE+107)
/*
同上
*/
#define __NR_fstat (__NR_SYSCALL_BASE+108)
/* 109 was sys_uname */
/* 110 was sys_iopl */

/*
int vhangup(void)
虚拟的挂起当前tty
*/
#define __NR_vhangup (__NR_SYSCALL_BASE+111)
/* 112 was sys_idle */

/*
int syscall(int number, ...)
间接系统调用,执行一个编号为Number并且带特定参数的系统调用。我认为就是直接使用这个文件的系统调用号来执行系统调用,而不需要执行函数名
*/
#define __NR_syscall (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */

/*
pid_t wait3(int *status, int options
            struct rusage *rusage)
pid_t wait4(pid_t pid, int *status, int options,
            struct rusage *rusage)
等待指定进程变换状态
*/
#define __NR_wait4 (__NR_SYSCALL_BASE+114)

/*
同swapon
*/
#define __NR_swapoff (__NR_SYSCALL_BASE+115)

/*
int sysinfo(struct sysinfo *info)
返回系统整体的统计信息

       Since Linux 2.3.23 (i386), 2.3.48 (all architectures) the structure is:

           struct sysinfo {
               long uptime;             /* Seconds since boot */
               unsigned long loads[3];  /* 1, 5, and 15 minute load averages */
               unsigned long totalram;  /* Total usable main memory size */
               unsigned long freeram;   /* Available memory size */
               unsigned long sharedram; /* Amount of shared memory */
               unsigned long bufferram; /* Memory used by buffers */
               unsigned long totalswap; /* Total swap space size */
               unsigned long freeswap;  /* swap space still available */
               unsigned short procs;    /* Number of current processes */
               unsigned long totalhigh; /* Total high memory size */
               unsigned long freehigh;  /* Available high memory size */
               unsigned int mem_unit;   /* Memory unit size in bytes */
               char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding for libc5 */
           };

*/
#define __NR_sysinfo (__NR_SYSCALL_BASE+116)

/*
int ipc(unsigned int call ,int first, int second, int third,
        void *ptr, long fifth)
ipc是System V系统IPC调用的通用内核进入点,用于消息、信号量、共享内存。
*/
#define __NR_ipc (__NR_SYSCALL_BASE+117)

/*
int fsync(int fd)
int fdatasync(int fd)
同步一个文件的in-core状态到存储设备中
*/
#define __NR_fsync (__NR_SYSCALL_BASE+118)

/*
int sigreturn(unsigned long __unused)
从信号处理函数返回,清理栈针
*/
#define __NR_sigreturn (__NR_SYSCALL_BASE+119)

/*
int clone(int (*fn)(void *), void *child_statck,
          int flags, void *arg, ...
          /* pid_t *ptid, struct user_desc *tls, pid_t *ctid */)
创建一个子进程
*/
#define __NR_clone (__NR_SYSCALL_BASE+120)

/*
int getdomainname(char *name, size_t len)
int setdomainname(const char *name, size_t len)
获取或设置domain name
*/
#define __NR_setdomainname (__NR_SYSCALL_BASE+121)

/*
int uname(sturct utsname *buf);
获取有关当前kernel的名字和信息
 struct utsname {
               char sysname[];    /* Operating system name (e.g., "Linux") */
               char nodename[];   /* Name within "some implementation-defined
                                     network" */
               char release[];    /* OS release (e.g., "2.6.28") */
               char version[];    /* OS version */
               char machine[];    /* Hardware identifier */
           #ifdef _GNU_SOURCE
               char domainname[]; /* NIS or YP domain name */
           #endif
           };
*/
#define __NR_uname (__NR_SYSCALL_BASE+122)
/* 123 was sys_modify_ldt */


/*
int adjtimex(struct timex *buf)
调整kernel time
struct timex {
               int modes;           /* mode selector */
               long offset;         /* time offset (usec) */
               long freq;           /* frequency offset (scaled ppm) */
               long maxerror;       /* maximum error (usec) */
               long esterror;       /* estimated error (usec) */
               int status;          /* clock command/status */
               long constant;       /* pll time constant */
               long precision;      /* clock precision (usec) (read-only) */
               long tolerance;      /* clock frequency tolerance (ppm)
                                       (read-only) */
               struct timeval time; /* current time (read-only) */
               long tick;           /* usecs between clock ticks */
           };
*/
#define __NR_adjtimex (__NR_SYSCALL_BASE+124)

/*
int mprotect(const void *addr, size_t len, int prot)
设置对内存区域的保护
prot:
PROT_NONE
PROT_READ
PROT_WRITE
PROT_EXEC
*/
#define __NR_mprotect (__NR_SYSCALL_BASE+125)

/*
int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
检查并且改变分块后的信号
*/
#define __NR_sigprocmask (__NR_SYSCALL_BASE+126)
/* 127 was sys_create_module */

/*
int init_module(const char *name, struct module *image)
初始化一个可加载的模块入口
 structure is defined as follows:

           struct module {
               unsigned long         size_of_struct;
               struct module        *next;
               const char           *name;
               unsigned long         size;
               long                  usecount;
               unsigned long         flags;
               unsigned int          nsyms;
               unsigned int          ndeps;
               struct module_symbol *syms;
               struct module_ref    *deps;
               struct module_ref    *refs;
               int                 (*init)(void);
               void                (*cleanup)(void);
               const struct exception_table_entry *ex_table_start;
               const struct exception_table_entry *ex_table_end;
           #ifdef __alpha__
               unsigned long gp;
           #endif
           };
*/
#define __NR_init_module (__NR_SYSCALL_BASE+128)

/*
int delete_module(const char *name)
删除一个内核可加载模块进入点
*/
#define __NR_delete_module (__NR_SYSCALL_BASE+129)
/* 130 was sys_get_kernel_syms */

/*
int quoatactl(int cmd, const char *special, int id, caddr_t addr)
维护硬盘配额
*/
#define __NR_quotactl (__NR_SYSCALL_BASE+131)

/*
上面分析过
*/
#define __NR_getpgid (__NR_SYSCALL_BASE+132)

/*
同chdir
*/
#define __NR_fchdir (__NR_SYSCALL_BASE+133)

/*
int bdflush(int func, long *address)
int bdflush(int func, long data)
启动、flush、调整buffer-dirty-flush守护进程
*/
#define __NR_bdflush (__NR_SYSCALL_BASE+134)

/*
int sysfs(int option, const char *fsname)
int sysfs(int option, unsigned fs_index, char *buf)
int sysfs(int option)
获取文件系统类型信息
*/
#define __NR_sysfs (__NR_SYSCALL_BASE+135)

/*
int personality(unsigned long persona)
设置进程执行domain
*/
#define __NR_personality (__NR_SYSCALL_BASE+136)
/* 137 was sys_afs_syscall */

/*
int setfsuid(uid_t fsuid)
设置用于文件系统检查的用户标识符(uid)
*/
#define __NR_setfsuid (__NR_SYSCALL_BASE+138)

/*
int setfsgid(uid_t fsgid)
设置用于文件系统检查的组标识符(gid)
*/
#define __NR_setfsgid (__NR_SYSCALL_BASE+139)

/*
int _llseek(unsigned int fd, unsigned long offset_hight,
            unsigned long offset_low, loff_t *result,
            unsigned int whence)
这个和lseek功能相似,只不过可以支持更大的文件,actual_offset = offset_hight << 32 | offset_low
*/
#define __NR__llseek (__NR_SYSCALL_BASE+140)

/*
int getdents(unsigned int fd, struct linux_dirent *dirp,
             unsigned int count)
获取文件目录进入点
*/
#define __NR_getdents (__NR_SYSCALL_BASE+141)

/*

*/
#define __NR__newselect (__NR_SYSCALL_BASE+142)

/*
int flock(int fd, int operation)
应用或者删除指定文件的咨询锁
operation:
LOCK_SH shared lock
LOCK_EX exclusive lock
LOCK_UN Remove an lock
*/
#define __NR_flock (__NR_SYSCALL_BASE+143)

/*
int msync(void *addr, size_t length, int flags)
同步一个内存映射的文件
*/
#define __NR_msync (__NR_SYSCALL_BASE+144)

/*
ssize_t readv(int fd, const struct iovec *iov, int iovcnt)
ssize_t writev(int fd, const struct iovec *iov, int iovcnt)
ssize_t preadv(int fd, const struct iovec *iov, int iovcnt,
               off_t offset)
ssize_t pwritev(int fd, const struct iovec *iov, int iovcnt,
                off_t offset)
从多个缓冲区中读或者写数据
 struct iovec {
               void  *iov_base;    /* Starting address */
               size_t iov_len;     /* Number of bytes to transfer */
           };
*/
#define __NR_readv (__NR_SYSCALL_BASE+145)

/*
同上
*/
#define __NR_writev (__NR_SYSCALL_BASE+146)

/*
pid_t getsid(pid_t pid)
获取session ID
*/
#define __NR_getsid (__NR_SYSCALL_BASE+147)

/*
同fsync
*/
#define __NR_fdatasync (__NR_SYSCALL_BASE+148)

/*
int _sysctl(struct __sysctl_args *args)
读或写系统参数
 struct __sysctl_args {
               int    *name;    /* integer vector describing variable */
               int     nlen;    /* length of this vector */
               void   *oldval;  /* 0 or address where to store old value */
               size_t *oldlenp; /* available room for old value,
                                   overwritten by actual size of old value */
               void   *newval;  /* 0 or address of new value */
               size_t  newlen;  /* size of new value */
           };
*/
#define __NR__sysctl (__NR_SYSCALL_BASE+149)

/*
int mlock(const void *addr, size_t len)
int munlock(const void *addr, size_t len)

int mlockall(int flags)
int munlockall(void)

锁或者解锁指定内存区域
*/
#define __NR_mlock (__NR_SYSCALL_BASE+150)

/*
同上
*/
#define __NR_munlock (__NR_SYSCALL_BASE+151)

/*
同上
*/
#define __NR_mlockall (__NR_SYSCALL_BASE+152)

/*
同上
*/
#define __NR_munlockall (__NR_SYSCALL_BASE+153)

/*
int sched_setparam(pid_t pid, const struct sched_param *param)
int sched_getparam(pid_t pid, struct sched_param *param)
获取和设置调度参数
*/
#define __NR_sched_setparam (__NR_SYSCALL_BASE+154)

/*
同上
*/
#define __NR_sched_getparam (__NR_SYSCALL_BASE+155)

/*
int sched_setscheduler(pid_t pid, int policy,
                       const struct sched_param *param)
int sched_getscheduler(pid_t pid)
获取和设置调度策略或者参数
*/
#define __NR_sched_setscheduler (__NR_SYSCALL_BASE+156)

/*
同上
*/
#define __NR_sched_getscheduler (__NR_SYSCALL_BASE+157)

/*
int sched_yield(void)
放弃CPU的占用,使其它线程获取CPU时间进行运行
*/
#define __NR_sched_yield (__NR_SYSCALL_BASE+158)

/*
int sched_get_priority_max(int policy)
int sched_get_priority_min(int policy)
获取静态优先级范围
*/
#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE+159)

/*
同上
*/
#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE+160)

/*
int sched_rr_get_interval(pid_t pid, struct timespec *tp)
获取指定进程的SCHED_RR间隔
*/
#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE+161)

/*
int nanosleep(const struct timespec *reg, struct timespec *rem)
高精度的睡眠,通过reg参数传入睡眠时间,如果线程睡眠的过程中,被外部信号打断,会将剩余睡眠的时间写入指针rem指针指向的结构体
*/
#define __NR_nanosleep (__NR_SYSCALL_BASE+162)

/*
void *mremap(void *old_address, size_t old_size,
             size_t new_size, int flags, ... /* void *new_address */)
重映射一个虚拟内存地址,扩展或者缩小已经存在的内存映射,有可能移动这段内存
*/
#define __NR_mremap (__NR_SYSCALL_BASE+163)

/*
int setresuid(uid_t ruid, uid_t euid, uid_t suid)
int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
设置real、effective 和 saved user或组ID
*/
#define __NR_setresuid (__NR_SYSCALL_BASE+164)

/*
int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid)
int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid)
获取real、effective和saved user或组ID
*/
#define __NR_getresuid (__NR_SYSCALL_BASE+165)
/* 166 was sys_vm86 */
/* 167 was sys_query_module */

/*
int poll(struct pollfd *fds, nfds_t nfds, int timeout)
int ppoll(struct pollfd *fds, nfds_t nfds,
          const struct timespec *timeout_ts, const sigset_t *sigmask)
等待指定文件描述符上的事件,与select类似
*/
#define __NR_poll (__NR_SYSCALL_BASE+168)

/*
long nfsservctl(int cmd, struct nfsctl_arg *argp,
                union nfsctl_res *resp)
内核nfs守护进程的系统调用接口
     /*
        * These are the commands understood by nfsctl().
        */
       #define NFSCTL_SVC          0    /* This is a server process. */
       #define NFSCTL_ADDCLIENT    1    /* Add an NFS client. */
       #define NFSCTL_DELCLIENT    2    /* Remove an NFS client. */
       #define NFSCTL_EXPORT       3    /* export a file system. */
       #define NFSCTL_UNEXPORT     4    /* unexport a file system. */
       #define NFSCTL_UGIDUPDATE   5    /* update a client's UID/GID map. */
       #define NFSCTL_GETFH        6    /* get an fh (used by mountd) */

       struct nfsctl_arg {
           int                       ca_version;     /* safeguard */
           union {
               struct nfsctl_svc     u_svc;
               struct nfsctl_client  u_client;
               struct nfsctl_export  u_export;
               struct nfsctl_uidmap  u_umap;
               struct nfsctl_fhparm  u_getfh;
               unsigned int          u_debug;
           } u;
       }

       union nfsctl_res {
               struct knfs_fh          cr_getfh;
               unsigned int            cr_debug;
       };

*/
#define __NR_nfsservctl (__NR_SYSCALL_BASE+169)

/*
上面讨论过
*/
#define __NR_setresgid (__NR_SYSCALL_BASE+170)

/*
同上
*/
#define __NR_getresgid (__NR_SYSCALL_BASE+171)

/*
int prctl(int option, unsigned long arg2, unsigned long arg3,
          unsigned long arg4, unsigned long arg5)
对进程进行操作,options指定做什么,剩下的2-5根据options的需要传入参数,options可以是,
PR_CAPBSET_READ
PR_CAPBSET_DROP
PR_SET_DUMPABLE
PR_GET_DUMPABLE
PR_SET_ENDIAN
PR_GET_ENDIAN
PR_SET_FPEMU
PR_GET_FPEMU
PR_SET_FPEXC
...
*/
#define __NR_prctl (__NR_SYSCALL_BASE+172)

/*
同sigreturn
*/
#define __NR_rt_sigreturn (__NR_SYSCALL_BASE+173)

/*
同sigaction
*/
#define __NR_rt_sigaction (__NR_SYSCALL_BASE+174)

/*
同sigprocmask
*/
#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE+175)

/*
同sigpending
*/
#define __NR_rt_sigpending (__NR_SYSCALL_BASE+176)

/*
int sigwaitinfo(const sigset_t *set, siginfo_t *info)
int sigtimedwait(const sigset_t *set, siginfo_t *info,
                 const struct timespec *timeout)
同步等待信号队列
sigwaitinfo()暂停调用线程,知道set中的信号发出
sigtimedwait()和sigwaitinfo功能相同,只不过等待时间设置了上限timeout,如果时间到了,signal还没有发出,则自动激活暂停中的进程
*/
#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)

/*
int sigqueue(pid_t pid, int sig, const union sigval value)
将一个signal和对应的数据放入指定进程的队列中
union sigval {
    int sival_int;
    void *sival_ptr;
};
*/
#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)

/*
同sigsuspend
*/
#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)

/*
ssize_t pread(int fd, void *buf, size_t count, off_t offset)
ssize_t pwrite(int fd, cosnt void *buf, size_t count ,off_t offset)
从给定文件描述符的指定偏移位置读、或者写指定个字节
*/
#define __NR_pread64 (__NR_SYSCALL_BASE+180)

/*
同上
*/
#define __NR_pwrite64 (__NR_SYSCALL_BASE+181)

/*
上面讨论过fchown
*/
#define __NR_chown (__NR_SYSCALL_BASE+182)

/*
char *getcwd(char *buf, size_t size)
char *getwd(char *buf)
char *get_current_dir_name(void)
获取当前工作目录
*/
#define __NR_getcwd (__NR_SYSCALL_BASE+183)

/*
int capget(cap_user_header_t hdrp, cap_user_data_t datap)
int capset(cap_user_header_t hdrp, const cap_user_data_t datap)
获取或设置线程能力
 #define _LINUX_CAPABILITY_VERSION_1  0x19980330
           #define _LINUX_CAPABILITY_U32S_1     1

           #define _LINUX_CAPABILITY_VERSION_2  0x20071026
           #define _LINUX_CAPABILITY_U32S_2     2

           typedef struct __user_cap_header_struct {
              __u32 version;
              int pid;
           } *cap_user_header_t;

           typedef struct __user_cap_data_struct {
              __u32 effective;
              __u32 permitted;
              __u32 inheritable;
           } *cap_user_data_t;
*/
#define __NR_capget (__NR_SYSCALL_BASE+184)

/*
同上
*/
#define __NR_capset (__NR_SYSCALL_BASE+185)

/*
int sigaltstack(const stack_t *ss, stack_t *oss)
获取并且/或设置信号占上下文(signal stack context)
sigaltstack()函数可以允许进程定义一个新的可选信号栈或获取已经存在的可选信号栈的状态
 typedef struct {
               void  *ss_sp;     /* Base address of stack */
               int    ss_flags;  /* Flags */
               size_t ss_size;   /* Number of bytes in stack */
           } stack_t;

*/
#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)

/*
ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count)
在文件描述符之间传递数据
*/
#define __NR_sendfile (__NR_SYSCALL_BASE+187)
/* 188 reserved */
/* 189 reserved */

/*
pid_t vfork(void)
创建一个子进程,并且阻塞父进程,和fork的区别就是会阻塞父进程,知道子进程terminal
*/
#define __NR_vfork (__NR_SYSCALL_BASE+190)

/*
同getrlimit
*/
#define __NR_ugetrlimit (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */

/*
void *mmap2(void *addr, size_t length, int prot,
            int flags, int fd, off_t pgoffset)
映射文件或设备到内存
*/
#define __NR_mmap2 (__NR_SYSCALL_BASE+192)

/*
同truncate
*/
#define __NR_truncate64 (__NR_SYSCALL_BASE+193)

/*
同上
*/
#define __NR_ftruncate64 (__NR_SYSCALL_BASE+194)

/*
同stat
*/
#define __NR_stat64 (__NR_SYSCALL_BASE+195)

/*
同上
*/
#define __NR_lstat64 (__NR_SYSCALL_BASE+196)

/*
同上
*/
#define __NR_fstat64 (__NR_SYSCALL_BASE+197)

/*
同lchown
*/
#define __NR_lchown32 (__NR_SYSCALL_BASE+198)

/*
同getuid
*/
#define __NR_getuid32 (__NR_SYSCALL_BASE+199)

/*
同getgid
*/
#define __NR_getgid32 (__NR_SYSCALL_BASE+200)

/*
同geteuid
*/
#define __NR_geteuid32 (__NR_SYSCALL_BASE+201)

/*
同getegid
*/
#define __NR_getegid32 (__NR_SYSCALL_BASE+202)

/*
同setreuid
*/
#define __NR_setreuid32 (__NR_SYSCALL_BASE+203)


#define __NR_setregid32 (__NR_SYSCALL_BASE+204)
#define __NR_getgroups32 (__NR_SYSCALL_BASE+205)
#define __NR_setgroups32 (__NR_SYSCALL_BASE+206)

/*
上面讨论过fchown
*/
#define __NR_fchown32 (__NR_SYSCALL_BASE+207)
#define __NR_setresuid32 (__NR_SYSCALL_BASE+208)
#define __NR_getresuid32 (__NR_SYSCALL_BASE+209)
#define __NR_setresgid32 (__NR_SYSCALL_BASE+210)
#define __NR_getresgid32 (__NR_SYSCALL_BASE+211)

/*
上面讨论过fchown
*/
#define __NR_chown32 (__NR_SYSCALL_BASE+212)
#define __NR_setuid32 (__NR_SYSCALL_BASE+213)
#define __NR_setgid32 (__NR_SYSCALL_BASE+214)
#define __NR_setfsuid32 (__NR_SYSCALL_BASE+215)
#define __NR_setfsgid32 (__NR_SYSCALL_BASE+216)
#define __NR_getdents64 (__NR_SYSCALL_BASE+217)

/*

*/
#define __NR_pivot_root (__NR_SYSCALL_BASE+218)
#define __NR_mincore (__NR_SYSCALL_BASE+219)
#define __NR_madvise (__NR_SYSCALL_BASE+220)
#define __NR_fcntl64 (__NR_SYSCALL_BASE+221)
/* 222 for tux */
/* 223 is unused */
#define __NR_gettid (__NR_SYSCALL_BASE+224)
#define __NR_readahead (__NR_SYSCALL_BASE+225)
#define __NR_setxattr (__NR_SYSCALL_BASE+226)
#define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
#define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
#define __NR_getxattr (__NR_SYSCALL_BASE+229)
#define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
#define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
#define __NR_listxattr (__NR_SYSCALL_BASE+232)
#define __NR_llistxattr (__NR_SYSCALL_BASE+233)
#define __NR_flistxattr (__NR_SYSCALL_BASE+234)
#define __NR_removexattr (__NR_SYSCALL_BASE+235)
#define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
#define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
#define __NR_tkill (__NR_SYSCALL_BASE+238)
#define __NR_sendfile64 (__NR_SYSCALL_BASE+239)
#define __NR_futex (__NR_SYSCALL_BASE+240)
#define __NR_sched_setaffinity (__NR_SYSCALL_BASE+241)
#define __NR_sched_getaffinity (__NR_SYSCALL_BASE+242)
#define __NR_io_setup (__NR_SYSCALL_BASE+243)
#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
#define __NR_io_submit (__NR_SYSCALL_BASE+246)
#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
#define __NR_exit_group (__NR_SYSCALL_BASE+248)
#define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249)
#define __NR_epoll_create (__NR_SYSCALL_BASE+250)
#define __NR_epoll_ctl (__NR_SYSCALL_BASE+251)
#define __NR_epoll_wait (__NR_SYSCALL_BASE+252)
#define __NR_remap_file_pages (__NR_SYSCALL_BASE+253)
/* 254 for set_thread_area */
/* 255 for get_thread_area */
#define __NR_set_tid_address (__NR_SYSCALL_BASE+256)
#define __NR_timer_create (__NR_SYSCALL_BASE+257)
#define __NR_timer_settime (__NR_SYSCALL_BASE+258)
#define __NR_timer_gettime (__NR_SYSCALL_BASE+259)
#define __NR_timer_getoverrun (__NR_SYSCALL_BASE+260)
#define __NR_timer_delete (__NR_SYSCALL_BASE+261)
#define __NR_clock_settime (__NR_SYSCALL_BASE+262)
#define __NR_clock_gettime (__NR_SYSCALL_BASE+263)
#define __NR_clock_getres (__NR_SYSCALL_BASE+264)
#define __NR_clock_nanosleep (__NR_SYSCALL_BASE+265)
#define __NR_statfs64 (__NR_SYSCALL_BASE+266)
#define __NR_fstatfs64 (__NR_SYSCALL_BASE+267)
#define __NR_tgkill (__NR_SYSCALL_BASE+268)
#define __NR_utimes (__NR_SYSCALL_BASE+269)
#define __NR_arm_fadvise64_64 (__NR_SYSCALL_BASE+270)
#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271)
#define __NR_pciconfig_read (__NR_SYSCALL_BASE+272)
#define __NR_pciconfig_write (__NR_SYSCALL_BASE+273)
#define __NR_mq_open (__NR_SYSCALL_BASE+274)
#define __NR_mq_unlink (__NR_SYSCALL_BASE+275)
#define __NR_mq_timedsend (__NR_SYSCALL_BASE+276)
#define __NR_mq_timedreceive (__NR_SYSCALL_BASE+277)
#define __NR_mq_notify (__NR_SYSCALL_BASE+278)
#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
#define __NR_waitid (__NR_SYSCALL_BASE+280)
#define __NR_socket (__NR_SYSCALL_BASE+281)
#define __NR_bind (__NR_SYSCALL_BASE+282)
#define __NR_connect (__NR_SYSCALL_BASE+283)
#define __NR_listen (__NR_SYSCALL_BASE+284)
#define __NR_accept (__NR_SYSCALL_BASE+285)
#define __NR_getsockname (__NR_SYSCALL_BASE+286)
#define __NR_getpeername (__NR_SYSCALL_BASE+287)
#define __NR_socketpair (__NR_SYSCALL_BASE+288)
#define __NR_send (__NR_SYSCALL_BASE+289)
#define __NR_sendto (__NR_SYSCALL_BASE+290)
#define __NR_recv (__NR_SYSCALL_BASE+291)
#define __NR_recvfrom (__NR_SYSCALL_BASE+292)
#define __NR_shutdown (__NR_SYSCALL_BASE+293)
#define __NR_setsockopt (__NR_SYSCALL_BASE+294)
#define __NR_getsockopt (__NR_SYSCALL_BASE+295)
#define __NR_sendmsg (__NR_SYSCALL_BASE+296)
#define __NR_recvmsg (__NR_SYSCALL_BASE+297)
#define __NR_semop (__NR_SYSCALL_BASE+298)
#define __NR_semget (__NR_SYSCALL_BASE+299)
#define __NR_semctl (__NR_SYSCALL_BASE+300)
#define __NR_msgsnd (__NR_SYSCALL_BASE+301)
#define __NR_msgrcv (__NR_SYSCALL_BASE+302)
#define __NR_msgget (__NR_SYSCALL_BASE+303)
#define __NR_msgctl (__NR_SYSCALL_BASE+304)
#define __NR_shmat (__NR_SYSCALL_BASE+305)
#define __NR_shmdt (__NR_SYSCALL_BASE+306)
#define __NR_shmget (__NR_SYSCALL_BASE+307)
#define __NR_shmctl (__NR_SYSCALL_BASE+308)
#define __NR_add_key (__NR_SYSCALL_BASE+309)
#define __NR_request_key (__NR_SYSCALL_BASE+310)
#define __NR_keyctl (__NR_SYSCALL_BASE+311)
#define __NR_semtimedop (__NR_SYSCALL_BASE+312)
#define __NR_vserver (__NR_SYSCALL_BASE+313)
#define __NR_ioprio_set (__NR_SYSCALL_BASE+314)
#define __NR_ioprio_get (__NR_SYSCALL_BASE+315)
#define __NR_inotify_init (__NR_SYSCALL_BASE+316)
#define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)
#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)
#define __NR_mbind (__NR_SYSCALL_BASE+319)
#define __NR_get_mempolicy (__NR_SYSCALL_BASE+320)
#define __NR_set_mempolicy (__NR_SYSCALL_BASE+321)
#define __NR_openat (__NR_SYSCALL_BASE+322)
#define __NR_mkdirat (__NR_SYSCALL_BASE+323)
#define __NR_mknodat (__NR_SYSCALL_BASE+324)
#define __NR_fchownat (__NR_SYSCALL_BASE+325)
#define __NR_futimesat (__NR_SYSCALL_BASE+326)
#define __NR_fstatat64 (__NR_SYSCALL_BASE+327)
#define __NR_unlinkat (__NR_SYSCALL_BASE+328)
#define __NR_renameat (__NR_SYSCALL_BASE+329)
#define __NR_linkat (__NR_SYSCALL_BASE+330)
#define __NR_symlinkat (__NR_SYSCALL_BASE+331)
#define __NR_readlinkat (__NR_SYSCALL_BASE+332)
#define __NR_fchmodat (__NR_SYSCALL_BASE+333)
#define __NR_faccessat (__NR_SYSCALL_BASE+334)
/* 335 for pselect6 */
/* 336 for ppoll */
#define __NR_unshare (__NR_SYSCALL_BASE+337)
#define __NR_set_robust_list (__NR_SYSCALL_BASE+338)
#define __NR_get_robust_list (__NR_SYSCALL_BASE+339)
#define __NR_splice (__NR_SYSCALL_BASE+340)
#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE+341)
#define __NR_sync_file_range2 __NR_arm_sync_file_range
#define __NR_tee (__NR_SYSCALL_BASE+342)
#define __NR_vmsplice (__NR_SYSCALL_BASE+343)
#define __NR_move_pages (__NR_SYSCALL_BASE+344)
#define __NR_getcpu (__NR_SYSCALL_BASE+345)
/* 346 for epoll_pwait */
#define __NR_kexec_load (__NR_SYSCALL_BASE+347)
#define __NR_utimensat (__NR_SYSCALL_BASE+348)
#define __NR_signalfd (__NR_SYSCALL_BASE+349)
#define __NR_timerfd (__NR_SYSCALL_BASE+350)
#define __NR_eventfd (__NR_SYSCALL_BASE+351)
#define __NR_fallocate (__NR_SYSCALL_BASE+352)

/*
 * The following SWIs are ARM private.
 */
#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
#define __ARM_NR_set_tls (__ARM_NR_BASE+5)

/*
 * The following syscalls are obsolete and no longer available for EABI.
 */
#if defined(__ARM_EABI__) && !defined(__KERNEL__)
#undef __NR_time
#undef __NR_umount
#undef __NR_stime
#undef __NR_alarm
#undef __NR_utime
#undef __NR_getrlimit
#undef __NR_select
#undef __NR_readdir
#undef __NR_mmap
#undef __NR_socketcall
#undef __NR_syscall
#undef __NR_ipc
#endif

#ifdef __KERNEL__

#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_GETHOSTNAME
#define __ARCH_WANT_SYS_PAUSE
#define __ARCH_WANT_SYS_GETPGRP
#define __ARCH_WANT_SYS_LLSEEK
#define __ARCH_WANT_SYS_NICE
#define __ARCH_WANT_SYS_SIGPENDING
#define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION

#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_SYS_OLDUMOUNT
#define __ARCH_WANT_SYS_ALARM
#define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_SYS_OLD_GETRLIMIT
#define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_SYS_SOCKETCALL
#endif

/*
 * "Conditional" syscalls
 *
 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
 * but it doesn't work on all toolchains, so we just do it by hand
 */
#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")

/*
 * Unimplemented (or alternatively implemented) syscalls
 */
#define __IGNORE_fadvise64_64 1

#endif /* __KERNEL__ */
#endif /* __ASM_ARM_UNISTD_H */


有道笔记连接: http://note.youdao.com/share/?id=56739b78c7a167f48635c36d3234021b&type=note

相关文章推荐

linux采用编译内核的方法增加系统功能调用

最近做了我们院的操作系统课程设计,本来是想把我的报告拿出来和大家分享的,可寝室的朋友说我这么做容易使后来的童鞋不经过自己的思考就全盘copy,所以我决定还是分类讲讲我做的过程吧!首先完成的是一个lin...

linux添加系统调用总结(内核版本4.4.4)

Linux添加系统调用总结最近在做操作系统的课程设计,其中一题就是给linux系统添加一个copy功能的系统调用,折腾之后总结一下:其实一开始我是不打算写的,但是发现老师的课设指导实在是太过时了,li...

linux系统性能优化及瓶颈分析

一,用vmstat分析系统I/O情况 [root@localhost ~]# vmstat -n 3       (每个3秒刷新一次) procs-----------memory--------...

RTX:RTX系统调用函数分类、声明、功能及注意事项

【事件标志管理函数】 函数名              描述  os_evt_clr          清除至少一个事件标志。  os_evt_get          获取事件标志,使 os_evt...

窥探 kernel,just for fun --- 系统调用过程分析

本系列文章由张同浩编写,转载请注明出处:http://blog.csdn.net/muge0913/article/details/7518568 邮箱:muge0913@sina.com ...

linux-kernel 3.5.3Tcp系统调用,源码分析2-sys_socket & sock_create

sys_socket的实现: SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol) (前面已经说过这个宏最终会展开为sys_s...

窥探 kernel --- 有关系统调用的几个知识点

 本系列文章由张同浩编写,转载请注明出处:http://blog.csdn.net/muge0913/article/details/7517303 邮箱:muge0913@sina.com ...

linux-kernel 3.5.3Tcp系统调用,源码分析4-inet_init

inet_init是ipv4的初始化函数,在系统初始化的时候会调用(在哪里?) /* #define __init      __attribute__ ((__section__ (".init...

linux-kernel 3.5.3Tcp系统调用,源码分析5-原子操作

linux的原子操作实现,首先是基本数据结构的定义 typedef struct { int counter; } atomic_t; 操作集 #define atomic_dec_re...

kernel 系统调用----system call

Init在trap_init中对SYSCALL_VECTOR(编号0x80)的向量进行初始化。 808 set_system_trap_gate(SYSCALL_VECTOR, &system...
  • yin262
  • yin262
  • 2017年02月28日 15:56
  • 264
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Kernel系统调用功能分类
举报原因:
原因补充:

(最多只允许输入30个字)