unistd.h
来自「linux 内核源代码」· C头文件 代码 · 共 989 行 · 第 1/3 页
H
989 行
#define __NR_poll (__NR_Linux + 168)#define __NR_nfsservctl (__NR_Linux + 169)#define __NR_setresgid (__NR_Linux + 170)#define __NR_getresgid (__NR_Linux + 171)#define __NR_prctl (__NR_Linux + 172)#define __NR_rt_sigreturn (__NR_Linux + 173)#define __NR_rt_sigaction (__NR_Linux + 174)#define __NR_rt_sigprocmask (__NR_Linux + 175)#define __NR_rt_sigpending (__NR_Linux + 176)#define __NR_rt_sigtimedwait (__NR_Linux + 177)#define __NR_rt_sigqueueinfo (__NR_Linux + 178)#define __NR_rt_sigsuspend (__NR_Linux + 179)#define __NR_chown (__NR_Linux + 180)#define __NR_setsockopt (__NR_Linux + 181)#define __NR_getsockopt (__NR_Linux + 182)#define __NR_sendmsg (__NR_Linux + 183)#define __NR_recvmsg (__NR_Linux + 184)#define __NR_semop (__NR_Linux + 185)#define __NR_semget (__NR_Linux + 186)#define __NR_semctl (__NR_Linux + 187)#define __NR_msgsnd (__NR_Linux + 188)#define __NR_msgrcv (__NR_Linux + 189)#define __NR_msgget (__NR_Linux + 190)#define __NR_msgctl (__NR_Linux + 191)#define __NR_shmat (__NR_Linux + 192)#define __NR_shmdt (__NR_Linux + 193)#define __NR_shmget (__NR_Linux + 194)#define __NR_shmctl (__NR_Linux + 195)#define __NR_getpmsg (__NR_Linux + 196) /* Somebody *wants* streams? */#define __NR_putpmsg (__NR_Linux + 197)#define __NR_lstat64 (__NR_Linux + 198)#define __NR_truncate64 (__NR_Linux + 199)#define __NR_ftruncate64 (__NR_Linux + 200)#define __NR_getdents64 (__NR_Linux + 201)#define __NR_fcntl64 (__NR_Linux + 202)#define __NR_attrctl (__NR_Linux + 203)#define __NR_acl_get (__NR_Linux + 204)#define __NR_acl_set (__NR_Linux + 205)#define __NR_gettid (__NR_Linux + 206)#define __NR_readahead (__NR_Linux + 207)#define __NR_tkill (__NR_Linux + 208)#define __NR_sendfile64 (__NR_Linux + 209)#define __NR_futex (__NR_Linux + 210)#define __NR_sched_setaffinity (__NR_Linux + 211)#define __NR_sched_getaffinity (__NR_Linux + 212)#define __NR_set_thread_area (__NR_Linux + 213)#define __NR_get_thread_area (__NR_Linux + 214)#define __NR_io_setup (__NR_Linux + 215)#define __NR_io_destroy (__NR_Linux + 216)#define __NR_io_getevents (__NR_Linux + 217)#define __NR_io_submit (__NR_Linux + 218)#define __NR_io_cancel (__NR_Linux + 219)#define __NR_alloc_hugepages (__NR_Linux + 220)#define __NR_free_hugepages (__NR_Linux + 221)#define __NR_exit_group (__NR_Linux + 222)#define __NR_lookup_dcookie (__NR_Linux + 223)#define __NR_epoll_create (__NR_Linux + 224)#define __NR_epoll_ctl (__NR_Linux + 225)#define __NR_epoll_wait (__NR_Linux + 226)#define __NR_remap_file_pages (__NR_Linux + 227)#define __NR_semtimedop (__NR_Linux + 228)#define __NR_mq_open (__NR_Linux + 229)#define __NR_mq_unlink (__NR_Linux + 230)#define __NR_mq_timedsend (__NR_Linux + 231)#define __NR_mq_timedreceive (__NR_Linux + 232)#define __NR_mq_notify (__NR_Linux + 233)#define __NR_mq_getsetattr (__NR_Linux + 234)#define __NR_waitid (__NR_Linux + 235)#define __NR_fadvise64_64 (__NR_Linux + 236)#define __NR_set_tid_address (__NR_Linux + 237)#define __NR_setxattr (__NR_Linux + 238)#define __NR_lsetxattr (__NR_Linux + 239)#define __NR_fsetxattr (__NR_Linux + 240)#define __NR_getxattr (__NR_Linux + 241)#define __NR_lgetxattr (__NR_Linux + 242)#define __NR_fgetxattr (__NR_Linux + 243)#define __NR_listxattr (__NR_Linux + 244)#define __NR_llistxattr (__NR_Linux + 245)#define __NR_flistxattr (__NR_Linux + 246)#define __NR_removexattr (__NR_Linux + 247)#define __NR_lremovexattr (__NR_Linux + 248)#define __NR_fremovexattr (__NR_Linux + 249)#define __NR_timer_create (__NR_Linux + 250)#define __NR_timer_settime (__NR_Linux + 251)#define __NR_timer_gettime (__NR_Linux + 252)#define __NR_timer_getoverrun (__NR_Linux + 253)#define __NR_timer_delete (__NR_Linux + 254)#define __NR_clock_settime (__NR_Linux + 255)#define __NR_clock_gettime (__NR_Linux + 256)#define __NR_clock_getres (__NR_Linux + 257)#define __NR_clock_nanosleep (__NR_Linux + 258)#define __NR_tgkill (__NR_Linux + 259)#define __NR_mbind (__NR_Linux + 260)#define __NR_get_mempolicy (__NR_Linux + 261)#define __NR_set_mempolicy (__NR_Linux + 262)#define __NR_vserver (__NR_Linux + 263)#define __NR_add_key (__NR_Linux + 264)#define __NR_request_key (__NR_Linux + 265)#define __NR_keyctl (__NR_Linux + 266)#define __NR_ioprio_set (__NR_Linux + 267)#define __NR_ioprio_get (__NR_Linux + 268)#define __NR_inotify_init (__NR_Linux + 269)#define __NR_inotify_add_watch (__NR_Linux + 270)#define __NR_inotify_rm_watch (__NR_Linux + 271)#define __NR_migrate_pages (__NR_Linux + 272)#define __NR_pselect6 (__NR_Linux + 273)#define __NR_ppoll (__NR_Linux + 274)#define __NR_openat (__NR_Linux + 275)#define __NR_mkdirat (__NR_Linux + 276)#define __NR_mknodat (__NR_Linux + 277)#define __NR_fchownat (__NR_Linux + 278)#define __NR_futimesat (__NR_Linux + 279)#define __NR_fstatat64 (__NR_Linux + 280)#define __NR_unlinkat (__NR_Linux + 281)#define __NR_renameat (__NR_Linux + 282)#define __NR_linkat (__NR_Linux + 283)#define __NR_symlinkat (__NR_Linux + 284)#define __NR_readlinkat (__NR_Linux + 285)#define __NR_fchmodat (__NR_Linux + 286)#define __NR_faccessat (__NR_Linux + 287)#define __NR_unshare (__NR_Linux + 288)#define __NR_set_robust_list (__NR_Linux + 289)#define __NR_get_robust_list (__NR_Linux + 290)#define __NR_splice (__NR_Linux + 291)#define __NR_sync_file_range (__NR_Linux + 292)#define __NR_tee (__NR_Linux + 293)#define __NR_vmsplice (__NR_Linux + 294)#define __NR_move_pages (__NR_Linux + 295)#define __NR_getcpu (__NR_Linux + 296)#define __NR_epoll_pwait (__NR_Linux + 297)#define __NR_statfs64 (__NR_Linux + 298)#define __NR_fstatfs64 (__NR_Linux + 299)#define __NR_kexec_load (__NR_Linux + 300)#define __NR_utimensat (__NR_Linux + 301)#define __NR_signalfd (__NR_Linux + 302)#define __NR_timerfd (__NR_Linux + 303)#define __NR_eventfd (__NR_Linux + 304)#define __NR_fallocate (__NR_Linux + 305)#define __NR_Linux_syscalls (__NR_fallocate + 1)#define __IGNORE_select /* newselect */#define __IGNORE_fadvise64 /* fadvise64_64 */#define __IGNORE_utimes /* utime */#define HPUX_GATEWAY_ADDR 0xC0000004#define LINUX_GATEWAY_ADDR 0x100#ifdef __KERNEL__#ifndef __ASSEMBLY__#define SYS_ify(syscall_name) __NR_##syscall_name#ifndef ASM_LINE_SEP# define ASM_LINE_SEP ;#endif/* Definition taken from glibc 2.3.3 * sysdeps/unix/sysv/linux/hppa/sysdep.h */#ifdef PIC/* WARNING: CANNOT BE USED IN A NOP! */# define K_STW_ASM_PIC " copy %%r19, %%r4\n"# define K_LDW_ASM_PIC " copy %%r4, %%r19\n"# define K_USING_GR4 "%r4",#else# define K_STW_ASM_PIC " \n"# define K_LDW_ASM_PIC " \n"# define K_USING_GR4#endif/* GCC has to be warned that a syscall may clobber all the ABI registers listed as "caller-saves", see page 8, Table 2 in section 2.2.6 of the PA-RISC RUN-TIME architecture document. However! r28 is the result and will conflict with the clobber list so it is left out. Also the input arguments registers r20 -> r26 will conflict with the list so they are treated specially. Although r19 is clobbered by the syscall we cannot say this because it would violate ABI, thus we say r4 is clobbered and use that register to save/restore r19 across the syscall. */#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \ "%r20", "%r29", "%r31"#undef K_INLINE_SYSCALL#define K_INLINE_SYSCALL(name, nr, args...) ({ \ long __sys_res; \ { \ register unsigned long __res __asm__("r28"); \ K_LOAD_ARGS_##nr(args) \ /* FIXME: HACK stw/ldw r19 around syscall */ \ __asm__ volatile( \ K_STW_ASM_PIC \ " ble 0x100(%%sr2, %%r0)\n" \ " ldi %1, %%r20\n" \ K_LDW_ASM_PIC \ : "=r" (__res) \ : "i" (SYS_ify(name)) K_ASM_ARGS_##nr \ : "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr \ ); \ __sys_res = (long)__res; \ } \ if ( (unsigned long)__sys_res >= (unsigned long)-4095 ){ \ errno = -__sys_res; \ __sys_res = -1; \ } \ __sys_res; \})#define K_LOAD_ARGS_0()#define K_LOAD_ARGS_1(r26) \ register unsigned long __r26 __asm__("r26") = (unsigned long)(r26); \ K_LOAD_ARGS_0()#define K_LOAD_ARGS_2(r26,r25) \ register unsigned long __r25 __asm__("r25") = (unsigned long)(r25); \ K_LOAD_ARGS_1(r26)#define K_LOAD_ARGS_3(r26,r25,r24) \ register unsigned long __r24 __asm__("r24") = (unsigned long)(r24); \ K_LOAD_ARGS_2(r26,r25)#define K_LOAD_ARGS_4(r26,r25,r24,r23) \ register unsigned long __r23 __asm__("r23") = (unsigned long)(r23); \ K_LOAD_ARGS_3(r26,r25,r24)#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22) \ register unsigned long __r22 __asm__("r22") = (unsigned long)(r22); \ K_LOAD_ARGS_4(r26,r25,r24,r23)#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21) \ register unsigned long __r21 __asm__("r21") = (unsigned long)(r21); \ K_LOAD_ARGS_5(r26,r25,r24,r23,r22)/* Even with zero args we use r20 for the syscall number */#define K_ASM_ARGS_0#define K_ASM_ARGS_1 K_ASM_ARGS_0, "r" (__r26)#define K_ASM_ARGS_2 K_ASM_ARGS_1, "r" (__r25)#define K_ASM_ARGS_3 K_ASM_ARGS_2, "r" (__r24)#define K_ASM_ARGS_4 K_ASM_ARGS_3, "r" (__r23)#define K_ASM_ARGS_5 K_ASM_ARGS_4, "r" (__r22)#define K_ASM_ARGS_6 K_ASM_ARGS_5, "r" (__r21)/* The registers not listed as inputs but clobbered */#define K_CLOB_ARGS_6#define K_CLOB_ARGS_5 K_CLOB_ARGS_6, "%r21"#define K_CLOB_ARGS_4 K_CLOB_ARGS_5, "%r22"#define K_CLOB_ARGS_3 K_CLOB_ARGS_4, "%r23"#define K_CLOB_ARGS_2 K_CLOB_ARGS_3, "%r24"#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"#define _syscall0(type,name) \type name(void) \{ \ return K_INLINE_SYSCALL(name, 0); \}#define _syscall1(type,name,type1,arg1) \type name(type1 arg1) \{ \ return K_INLINE_SYSCALL(name, 1, arg1); \}#define _syscall2(type,name,type1,arg1,type2,arg2) \type name(type1 arg1, type2 arg2) \{ \ return K_INLINE_SYSCALL(name, 2, arg1, arg2); \}#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \type name(type1 arg1, type2 arg2, type3 arg3) \{ \ return K_INLINE_SYSCALL(name, 3, arg1, arg2, arg3); \}#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \{ \ return K_INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4); \}/* select takes 5 arguments */#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \{ \ return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5); \}#define __ARCH_WANT_OLD_READDIR#define __ARCH_WANT_STAT64#define __ARCH_WANT_SYS_ALARM#define __ARCH_WANT_SYS_GETHOSTNAME#define __ARCH_WANT_SYS_PAUSE#define __ARCH_WANT_SYS_SGETMASK#define __ARCH_WANT_SYS_SIGNAL#define __ARCH_WANT_SYS_TIME#define __ARCH_WANT_COMPAT_SYS_TIME#define __ARCH_WANT_SYS_UTIME#define __ARCH_WANT_SYS_WAITPID#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#define __ARCH_WANT_SYS_RT_SIGSUSPEND#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND#endif /* __ASSEMBLY__ */#undef STR/* * "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 /* __KERNEL__ */#endif /* _ASM_PARISC_UNISTD_H_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?