unistd.h

来自「Linux Kernel 2.6.9 for OMAP1710」· C头文件 代码 · 共 601 行 · 第 1/2 页

H
601
字号
#undef  __NR_getresuid#undef  __NR_setresgid#undef  __NR_getresgid#undef  __NR_chown#undef  __NR_ugetrlimit#undef  __NR_mmap2#undef  __NR_truncate64#undef  __NR_ftruncate64#undef  __NR_stat64#undef  __NR_lstat64#undef  __NR_fstat64#undef  __NR_lchown32#undef  __NR_getuid32#undef  __NR_getgid32#undef  __NR_geteuid32#undef  __NR_getegid32#undef  __NR_setreuid32#undef  __NR_setregid32#undef  __NR_getgroups32#undef  __NR_setgroups32#undef  __NR_fchown32#undef  __NR_setresuid32#undef  __NR_getresuid32#undef  __NR_setresgid32#undef  __NR_getresgid32#undef  __NR_chown32#undef  __NR_setuid32#undef  __NR_setgid32#undef  __NR_setfsuid32#undef  __NR_setfsgid32#undef  __NR_getdents64#undef  __NR_fcntl64#undef  __NR_sendfile64#undef  __NR_fadvise64_64#define __NR_select		142#define __NR_getrlimit		191	/* SuS compliant getrlimit */#define __NR_lchown  		198#define __NR_getuid  		199#define __NR_getgid  		200#define __NR_geteuid  		201#define __NR_getegid  		202#define __NR_setreuid  		203#define __NR_setregid  		204#define __NR_getgroups  	205#define __NR_setgroups  	206#define __NR_fchown  		207#define __NR_setresuid  	208#define __NR_getresuid  	209#define __NR_setresgid  	210#define __NR_getresgid  	211#define __NR_chown  		212#define __NR_setuid  		213#define __NR_setgid  		214#define __NR_setfsuid  		215#define __NR_setfsgid  		216#endif/* user-visible error numbers are in the range -1 - -122: see <asm-s390/errno.h> */#define __syscall_return(type, res)			     \do {							     \	if ((unsigned long)(res) >= (unsigned long)(-125)) { \		errno = -(res);				     \		res = -1;				     \	}						     \	return (type) (res);				     \} while (0)#define _svc_clobber "1", "cc", "memory"#define _syscall0(type,name)				     \type name(void) {					     \	register long __svcres asm("2");		     \	long __res;					     \	__asm__ __volatile__ (				     \		"    .if %1 < 256\n"			     \		"    svc %b1\n"				     \		"    .else\n"				     \		"    la  %%r1,%1\n"			     \		"    svc 0\n"				     \		"    .endif"				     \		: "=d" (__svcres)			     \		: "i" (__NR_##name)			     \		: _svc_clobber );			     \	__res = __svcres;				     \	__syscall_return(type,__res);			     \}#define _syscall1(type,name,type1,arg1)			     \type name(type1 arg1) {					     \	register type1 __arg1 asm("2") = arg1;		     \	register long __svcres asm("2");		     \	long __res;					     \	__asm__ __volatile__ (				     \		"    .if %1 < 256\n"			     \		"    svc %b1\n"				     \		"    .else\n"				     \		"    la  %%r1,%1\n"			     \		"    svc 0\n"				     \		"    .endif"				     \		: "=d" (__svcres)			     \		: "i" (__NR_##name),			     \		  "0" (__arg1)				     \		: _svc_clobber );			     \	__res = __svcres;				     \	__syscall_return(type,__res);			     \}#define _syscall2(type,name,type1,arg1,type2,arg2)	     \type name(type1 arg1, type2 arg2) {			     \	register type1 __arg1 asm("2") = arg1;		     \	register type2 __arg2 asm("3") = arg2;		     \	register long __svcres asm("2");		     \	long __res;					     \	__asm__ __volatile__ (				     \		"    .if %1 < 256\n"			     \		"    svc %b1\n"				     \		"    .else\n"				     \		"    la %%r1,%1\n"			     \		"    svc 0\n"				     \		"    .endif"				     \		: "=d" (__svcres)			     \		: "i" (__NR_##name),			     \		  "0" (__arg1),				     \		  "d" (__arg2)				     \		: _svc_clobber );			     \	__res = __svcres;				     \	__syscall_return(type,__res);			     \}#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3)\type name(type1 arg1, type2 arg2, type3 arg3) {		     \	register type1 __arg1 asm("2") = arg1;		     \	register type2 __arg2 asm("3") = arg2;		     \	register type3 __arg3 asm("4") = arg3;		     \	register long __svcres asm("2");		     \	long __res;					     \	__asm__ __volatile__ (				     \		"    .if %1 < 256\n"			     \		"    svc %b1\n"				     \		"    .else\n"				     \		"    la  %%r1,%1\n"			     \		"    svc 0\n"				     \		"    .endif"				     \		: "=d" (__svcres)			     \		: "i" (__NR_##name),			     \		  "0" (__arg1),				     \		  "d" (__arg2),				     \		  "d" (__arg3)				     \		: _svc_clobber );			     \	__res = __svcres;				     \	__syscall_return(type,__res);			     \}#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,\		  type4,name4)				     \type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) {  \	register type1 __arg1 asm("2") = arg1;		     \	register type2 __arg2 asm("3") = arg2;		     \	register type3 __arg3 asm("4") = arg3;		     \	register type4 __arg4 asm("5") = arg4;		     \	register long __svcres asm("2");		     \	long __res;					     \	__asm__ __volatile__ (				     \		"    .if %1 < 256\n"			     \		"    svc %b1\n"				     \		"    .else\n"				     \		"    la  %%r1,%1\n"			     \		"    svc 0\n"				     \		"    .endif"				     \		: "=d" (__svcres)			     \		: "i" (__NR_##name),			     \		  "0" (__arg1),				     \		  "d" (__arg2),				     \		  "d" (__arg3),				     \		  "d" (__arg4)				     \		: _svc_clobber );			     \	__res = __svcres;				     \	__syscall_return(type,__res);			     \}#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,\		  type4,name4,type5,name5)		     \type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4,    \	  type5 arg5) {					     \	register type1 __arg1 asm("2") = arg1;		     \	register type2 __arg2 asm("3") = arg2;		     \	register type3 __arg3 asm("4") = arg3;		     \	register type4 __arg4 asm("5") = arg4;		     \	register type5 __arg5 asm("6") = arg5;		     \	register long __svcres asm("2");		     \	long __res;					     \	__asm__ __volatile__ (				     \		"    .if %1 < 256\n"			     \		"    svc %b1\n"				     \		"    .else\n"				     \		"    la  %%r1,%1\n"			     \		"    svc 0\n"				     \		"    .endif"				     \		: "=d" (__svcres)			     \		: "i" (__NR_##name),			     \		  "0" (__arg1),				     \		  "d" (__arg2),				     \		  "d" (__arg3),				     \		  "d" (__arg4),				     \		  "d" (__arg5)				     \		: _svc_clobber );			     \	__res = __svcres;				     \	__syscall_return(type,__res);			     \}#ifdef __KERNEL__#define __ARCH_WANT_IPC_PARSE_VERSION#define __ARCH_WANT_OLD_READDIR#define __ARCH_WANT_SYS_ALARM#define __ARCH_WANT_SYS_GETHOSTNAME#define __ARCH_WANT_SYS_PAUSE#define __ARCH_WANT_SYS_SIGNAL#define __ARCH_WANT_SYS_TIME#define __ARCH_WANT_SYS_UTIME#define __ARCH_WANT_SYS_SOCKETCALL#define __ARCH_WANT_SYS_FADVISE64#define __ARCH_WANT_SYS_GETPGRP#define __ARCH_WANT_SYS_LLSEEK#define __ARCH_WANT_SYS_NICE#define __ARCH_WANT_SYS_OLD_GETRLIMIT#define __ARCH_WANT_SYS_OLDUMOUNT#define __ARCH_WANT_SYS_SIGPENDING#define __ARCH_WANT_SYS_SIGPROCMASK#define __ARCH_WANT_SYS_RT_SIGACTION# ifndef CONFIG_ARCH_S390X#   define __ARCH_WANT_STAT64# endif#endif#ifdef __KERNEL_SYSCALLS__#include <linux/config.h>#include <linux/compiler.h>#include <linux/types.h>#include <asm/ptrace.h>#include <asm/stat.h>#include <linux/syscalls.h>/* * we need this inline - forking from kernel space will result * in NO COPY ON WRITE (!!!), until an execve is executed. This * is no problem, but for the stack. This is handled by not letting * main() use the stack at all after fork(). Thus, no function * calls - which means inline code for fork too, as otherwise we * would use the stack upon exit from 'fork()'. * * Actually only pause and fork are needed inline, so that there * won't be any messing with the stack from main(), but we define * some others too. */#define __NR__exit __NR_exitstatic inline _syscall0(pid_t,setsid)static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)static inline _syscall1(int,dup,int,fd)static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)static inline _syscall3(int,open,const char *,file,int,flag,int,mode)static inline _syscall1(int,close,int,fd)static inline _syscall2(long,stat,char *,filename,struct stat *,statbuf)static inline pid_t waitpid(int pid, int *wait_stat, int flags){	return sys_wait4(pid, wait_stat, flags, NULL);}struct mmap_arg_struct;asmlinkage long sys_mmap2(struct mmap_arg_struct __user *arg);asmlinkage long sys_execve(struct pt_regs regs);asmlinkage long sys_clone(struct pt_regs regs);asmlinkage long sys_fork(struct pt_regs regs);asmlinkage long sys_vfork(struct pt_regs regs);asmlinkage long sys_pipe(unsigned long __user *fildes);asmlinkage long sys_ptrace(long request, long pid, long addr, long data);struct sigaction;asmlinkage long sys_rt_sigaction(int sig,				const struct sigaction __user *act,				struct sigaction __user *oact,				size_t sigsetsize);#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");#endif /* _ASM_S390_UNISTD_H_ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?