📄 syscalls.c
字号:
_syscall3(int, setpriority, __priority_which_t, which, id_t, who, int, prio);#endif//#define __NR_profil 98//#define __NR_statfs 99#ifdef L_statfs#include <sys/vfs.h>_syscall2(int, statfs, const char *, path, struct statfs *, buf);#endif//#define __NR_fstatfs 100#ifdef L_fstatfs#include <sys/vfs.h>_syscall2(int, fstatfs, int, fd, struct statfs *, buf);#endif//#define __NR_ioperm 101#ifdef L_ioperm# if defined __UCLIBC_HAS_MMU__ && defined __NR_ioperm _syscall3(int, ioperm, unsigned long, from, unsigned long, num, int, turn_on);# else int ioperm(unsigned long from, unsigned long num, int turn_on) { __set_errno(ENOSYS); return -1; }# endif#endif//#define __NR_socketcall 102#ifdef L___socketcall#ifdef __NR_socketcall#define __NR___socketcall __NR_socketcall_syscall2(int, __socketcall, int, call, unsigned long *, args);#endif#endif//#define __NR_syslog 103#ifdef L__syslog#include <unistd.h>#define __NR__syslog __NR_syslogextern int _syslog(int type, char *buf, int len);_syscall3(int, _syslog, int, type, char *, buf, int, len);int klogctl(int type, char *buf, int len){ return (_syslog(type, buf, len));}#endif//#define __NR_setitimer 104#ifdef L_setitimer#include <sys/time.h>_syscall3(int, setitimer, __itimer_which_t, which, const struct itimerval *, new, struct itimerval *, old);#endif//#define __NR_getitimer 105#ifdef L_getitimer#include <sys/time.h>_syscall2(int, getitimer, __itimer_which_t, which, struct itimerval *, value);#endif//#define __NR_stat 106#ifdef L___syscall_stat#define __NR___syscall_stat __NR_stat#include <unistd.h>#define _SYS_STAT_H#include <bits/stat.h>#include "xstatconv.h"_syscall2(int, __syscall_stat, const char *, file_name, struct kernel_stat *, buf);int stat(const char * file_name, struct stat * buf){ int result; struct kernel_stat kbuf; result = __syscall_stat(file_name, &kbuf); if (result == 0) { __xstat_conv(&kbuf, buf); } return result;}#if ! defined __NR_stat64 && defined __UCLIBC_HAS_LFS__weak_alias(stat, stat64);#endif#endif//#define __NR_lstat 107#ifdef L___syscall_lstat#define __NR___syscall_lstat __NR_lstat#include <unistd.h>#define _SYS_STAT_H#include <bits/stat.h>#include <bits/kernel_stat.h>#include "xstatconv.h"_syscall2(int, __syscall_lstat, const char *, file_name, struct kernel_stat *, buf);int lstat(const char * file_name, struct stat * buf){ int result; struct kernel_stat kbuf; result = __syscall_lstat(file_name, &kbuf); if (result == 0) { __xstat_conv(&kbuf, buf); } return result;}#if ! defined __NR_lstat64 && defined __UCLIBC_HAS_LFS__weak_alias(lstat, lstat64);#endif#endif//#define __NR_fstat 108#ifdef L___syscall_fstat#define __NR___syscall_fstat __NR_fstat#include <unistd.h>#define _SYS_STAT_H#include <bits/stat.h>#include <bits/kernel_stat.h>#include "xstatconv.h"_syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf);int fstat(int fd, struct stat * buf){ int result; struct kernel_stat kbuf; result = __syscall_fstat(fd, &kbuf); if (result == 0) { __xstat_conv(&kbuf, buf); } return result;}#if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__weak_alias(fstat, fstat64);#endif#endif//#define __NR_olduname 109//#define __NR_iopl 110#ifdef L_iopl/* For arm there is a totally different implementation */#if !defined(__arm__)/* Tuns out the m68k unistd.h kernel header is broken */# if defined __UCLIBC_HAS_MMU__ && defined __NR_iopl && ( !defined(__mc68000__)) _syscall1(int, iopl, int, level);# else int iopl(int level) { __set_errno(ENOSYS); return -1; }# endif# endif#endif//#define __NR_vhangup 111#ifdef L_vhangup#include <unistd.h>_syscall0(int, vhangup);#endif//#define __NR_idle 112//int idle(void);//#define __NR_vm86old 113//#define __NR_wait4 114#ifdef L___syscall_wait4#define __NR___syscall_wait4 __NR_wait4static inline_syscall4(int, __syscall_wait4, __kernel_pid_t, pid, int *, status, int, opts, void *, rusage);int wait4(pid_t pid, int * status, int opts, void * rusage){ return(__syscall_wait4(pid, status, opts, rusage));}#endif//#define __NR_swapoff 115#ifdef L_swapoff#include <sys/swap.h>_syscall1(int, swapoff, const char *, path);#endif//#define __NR_sysinfo 116#ifdef L_sysinfo#include <sys/sysinfo.h>_syscall1(int, sysinfo, struct sysinfo *, info);#endif//#define __NR_ipc 117#ifdef L___ipc#ifdef __NR_ipc#define __NR___ipc __NR_ipc_syscall5(int, __ipc, unsigned int, call, int, first, int, second, int, third, void *, ptr);#endif#endif//#define __NR_fsync 118#ifdef L___libc_fsync#include <unistd.h>#define __NR___libc_fsync __NR_fsync_syscall1(int, __libc_fsync, int, fd);weak_alias(__libc_fsync, fsync)#endif//#define __NR_sigreturn 119//int sigreturn(unsigned long __unused);//#define __NR_clone 120//See architecture specific implementation...//#define __NR_setdomainname 121#ifdef L_setdomainname#include <unistd.h>_syscall2(int, setdomainname, const char *, name, size_t, len);#endif//#define __NR_uname 122#ifdef L_uname#include <sys/utsname.h>_syscall1(int, uname, struct utsname *, buf);#endif//#define __NR_modify_ldt 123#ifdef __NR_modify_ldt#ifdef L_modify_ldt_syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount);weak_alias(modify_ldt, __modify_ldt);#endif#endif//#define __NR_adjtimex 124#ifdef L_adjtimex#include <sys/timex.h>_syscall1(int, adjtimex, struct timex *, buf);weak_alias(adjtimex, __adjtimex);#endif//#define __NR_mprotect 125#ifdef L_mprotect#include <sys/mman.h>_syscall3(int, mprotect, void *, addr, size_t, len, int, prot);#endif//#define __NR_sigprocmask 126#ifndef __NR_rt_sigprocmask#ifdef L_sigprocmask#include <signal.h>#undef sigprocmask_syscall3(int, sigprocmask, int, how, const sigset_t *, set, sigset_t *, oldset);#endif#endif//#define __NR_create_module 127//See sysdeps/linux/commom/create_module.c//#define __NR_init_module 128#ifdef L_init_module/* This may have 5 arguments (for old 2.0 kernels) or 2 arguments * (for 2.2 and 2.4 kernels). Use the greatest common denominator, * and let the kernel cope with whatever it gets. It's good at that. */_syscall5(int, init_module, void *, first, void *, second, void *, third, void *, fourth, void *, fifth);#endif//#define __NR_delete_module 129#ifdef L_delete_module# ifdef __NR_delete_module _syscall1(int, delete_module, const char *, name);# else int delete_module(const char * name) { __set_errno(ENOSYS); return -1; }# endif#endif//#define __NR_get_kernel_syms 130#ifdef L_get_kernel_symsstruct kernel_sym;_syscall1(int, get_kernel_syms, struct kernel_sym *, table);#endif//#define __NR_quotactl 131#ifdef __NR_quotactl#ifdef L_quotactl#include <sys/quota.h>_syscall4(int, quotactl, int, cmd, const char *, special , int, id, caddr_t, addr);#endif#endif//#define __NR_getpgid 132#ifdef L___syscall_getpgid#define __NR___syscall_getpgid __NR_getpgidstatic inline_syscall1(__kernel_pid_t, __syscall_getpgid, __kernel_pid_t, pid);pid_t getpgid(pid_t pid){ return(__syscall_getpgid(pid));}#endif//#define __NR_fchdir 133#ifdef L_fchdir#include <unistd.h>_syscall1(int, fchdir, int, fd);#endif//#define __NR_bdflush 134#ifdef L_bdflush#include <sys/kdaemon.h>_syscall2(int, bdflush, int, __func, long int, __data);#endif//#define __NR_sysfs 135//#define __NR_personality 136//#define __NR_afs_syscall 137//#define __NR_setfsuid 138#ifdef __NR_setfsuid#ifdef L___syscall_setfsuid#include <sys/fsuid.h>#define __NR___syscall_setfsuid __NR_setfsuidstatic inline_syscall1(int, __syscall_setfsuid, __kernel_uid_t, uid);int setfsuid(uid_t uid){ return(__syscall_setfsuid(uid));}#endif#endif//#define __NR_setfsgid 139#ifdef __NR_setfsgid#ifdef L___syscall_setfsgid#include <sys/fsuid.h>#define __NR___syscall_setfsgid __NR_setfsgidstatic inline_syscall1(int, __syscall_setfsgid, __kernel_gid_t, gid);int setfsgid(gid_t gid){ return(__syscall_setfsgid(gid));}#endif#endif//#define __NR__llseek 140//See llseek.c//#define __NR_getdents 141// See getdents.c//#define __NR__newselect 142#ifdef L__newselect//Used in preference to select when available...#ifdef __NR__newselect#include <unistd.h>extern int _newselect(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);_syscall5(int, _newselect, int, n, fd_set *, readfds, fd_set *, writefds, fd_set *, exceptfds, struct timeval *, timeout);weak_alias(_newselect, select);#endif#endif//#define __NR_flock 143#ifdef L_flock#include <sys/file.h>_syscall2(int,flock,int,fd, int,operation);#endif//#define __NR_msync 144#ifdef L___libc_msync#include <unistd.h>#include <sys/mman.h>#define __NR___libc_msync __NR_msync_syscall3(int, __libc_msync, void *, addr, size_t, length, int, flags);weak_alias(__libc_msync, msync);#endif//#define __NR_readv 145#ifdef L_readv#include <sys/uio.h>_syscall3(ssize_t, readv, int, filedes, const struct iovec *, vector, int, count);#endif//#define __NR_writev 146#ifdef L_writev#include <sys/uio.h>_syscall3(ssize_t, writev, int, filedes, const struct iovec *, vector, int, count);#endif//#define __NR_getsid 147#ifdef L___syscall_getsid#include <unistd.h>#define __NR___syscall_getsid __NR_getsidstatic inline_syscall1(__kernel_pid_t, __syscall_getsid, __kernel_pid_t, pid);pid_t getsid(pid_t pid){ return(__syscall_getsid(pid));}#endif//#define __NR_fdatasync 148#ifdef __NR_fdatasync#ifdef L_fdatasync#include <unistd.h>_syscall1(int, fdatasync, int, fd);#endif#endif//#define __NR__sysctl 149#ifdef __NR__sysctl#ifdef L__sysctl#include <linux/sysctl.h>_syscall1(int, _sysctl, struct __sysctl_args *, args);int sysctl(int *name, int nlen, void *oldval, size_t *oldlenp, void *newval, size_t newlen){ struct __sysctl_args args = { name: name, nlen: nlen, oldval: oldval, oldlenp: oldlenp, newval: newval, newlen: newlen }; return _sysctl(&args);}#endif#endif//#define __NR_mlock 150#ifdef L_mlock#include <sys/mman.h># if defined __UCLIBC_HAS_MMU__ && defined __NR_mlock _syscall2(int, mlock, const void *, addr, size_t, len);# endif #endif //#define __NR_munlock 151#ifdef L_munlock#include <sys/mman.h># if defined __UCLIBC_HAS_MMU__ && defined __NR_munlock _syscall2(int, munlock, const void *, addr, size_t, len);# endif #endif //#define __NR_mlockall 152#ifdef L_mlockall#include <sys/mman.h># if defined __UCLIBC_HAS_MMU__ && defined __NR_mlockall _syscall1(int, mlockall, int, flags);# endif #endif //#define __NR_munlockall 153#ifdef L_munlockall#include <sys/mman.h># if defined __UCLIBC_HAS_MMU__ && defined L_munlockall _syscall0(int, munlockall);# endif #endif //#define __NR_sched_setparam 154#ifdef __NR_sched_setparam#ifdef L___syscall_sched_setparam#include <sched.h>#define __NR___syscall_sched_setparam __NR_sched_setparamstatic inline_syscall2(int, __syscall_sched_setparam, __kernel_pid_t, pid, const struct sched_param *, p);int sched_setparam(pid_t pid, const struct sched_param * p){ return(__syscall_sched_setparam(pid, p));}#endif#endif//#define __NR_sched_getparam 155#ifdef __NR_sched_getparam#ifdef L___syscall_sched_getparam#include <sched.h>#define __NR___syscall_sched_getparam __NR_sched_getparamstatic inline_syscall2(int, __syscall_sched_getparam, __kernel_pid_t, pid, struct sched_param *, p);int sched_getparam(pid_t pid, struct sched_param * p){ return(__syscall_sched_getparam(pid, p));}#endif#endif//#define __NR_sched_setscheduler 156#ifdef __NR_sched_setscheduler#ifdef L___syscall_sched_setscheduler#include <sched.h>#define __NR___syscall_sched_setscheduler __NR_sched_setschedulerstatic inline_syscall3(int, __syscall_sched_setscheduler, __kernel_pid_t, pid, int, policy, const struct sched_param *, p);int sched_setscheduler(pid_t pid, int policy, const struct sched_param * p){
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -