syscalls.h 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * syscalls.h - Linux syscall interfaces (non-arch-specific)
  4. *
  5. * Copyright (c) 2004 Randy Dunlap
  6. * Copyright (c) 2004 Open Source Development Labs
  7. */
  8. #ifndef _LINUX_SYSCALLS_H
  9. #define _LINUX_SYSCALLS_H
  10. struct __aio_sigset;
  11. struct epoll_event;
  12. struct iattr;
  13. struct inode;
  14. struct iocb;
  15. struct io_event;
  16. struct iovec;
  17. struct __kernel_old_itimerval;
  18. struct kexec_segment;
  19. struct linux_dirent;
  20. struct linux_dirent64;
  21. struct list_head;
  22. struct mmap_arg_struct;
  23. struct msgbuf;
  24. struct user_msghdr;
  25. struct mmsghdr;
  26. struct msqid_ds;
  27. struct new_utsname;
  28. struct nfsctl_arg;
  29. struct __old_kernel_stat;
  30. struct oldold_utsname;
  31. struct old_utsname;
  32. struct pollfd;
  33. struct rlimit;
  34. struct rlimit64;
  35. struct rusage;
  36. struct sched_param;
  37. struct sched_attr;
  38. struct sel_arg_struct;
  39. struct semaphore;
  40. struct sembuf;
  41. struct shmid_ds;
  42. struct sockaddr;
  43. struct stat;
  44. struct stat64;
  45. struct statfs;
  46. struct statfs64;
  47. struct statx;
  48. struct sysinfo;
  49. struct timespec;
  50. struct __kernel_old_timeval;
  51. struct __kernel_timex;
  52. struct timezone;
  53. struct tms;
  54. struct utimbuf;
  55. struct mq_attr;
  56. struct compat_stat;
  57. struct old_timeval32;
  58. struct robust_list_head;
  59. struct futex_waitv;
  60. struct getcpu_cache;
  61. struct old_linux_dirent;
  62. struct perf_event_attr;
  63. struct file_handle;
  64. struct sigaltstack;
  65. struct rseq;
  66. union bpf_attr;
  67. struct io_uring_params;
  68. struct clone_args;
  69. struct open_how;
  70. struct mount_attr;
  71. struct landlock_ruleset_attr;
  72. enum landlock_rule_type;
  73. #include <linux/types.h>
  74. #include <linux/aio_abi.h>
  75. #include <linux/capability.h>
  76. #include <linux/signal.h>
  77. #include <linux/list.h>
  78. #include <linux/bug.h>
  79. #include <linux/sem.h>
  80. #include <asm/siginfo.h>
  81. #include <linux/unistd.h>
  82. #include <linux/quota.h>
  83. #include <linux/key.h>
  84. #include <linux/personality.h>
  85. #include <trace/syscall.h>
  86. #ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
  87. /*
  88. * It may be useful for an architecture to override the definitions of the
  89. * SYSCALL_DEFINE0() and __SYSCALL_DEFINEx() macros, in particular to use a
  90. * different calling convention for syscalls. To allow for that, the prototypes
  91. * for the sys_*() functions below will *not* be included if
  92. * CONFIG_ARCH_HAS_SYSCALL_WRAPPER is enabled.
  93. */
  94. #include <asm/syscall_wrapper.h>
  95. #endif /* CONFIG_ARCH_HAS_SYSCALL_WRAPPER */
  96. /*
  97. * __MAP - apply a macro to syscall arguments
  98. * __MAP(n, m, t1, a1, t2, a2, ..., tn, an) will expand to
  99. * m(t1, a1), m(t2, a2), ..., m(tn, an)
  100. * The first argument must be equal to the amount of type/name
  101. * pairs given. Note that this list of pairs (i.e. the arguments
  102. * of __MAP starting at the third one) is in the same format as
  103. * for SYSCALL_DEFINE<n>/COMPAT_SYSCALL_DEFINE<n>
  104. */
  105. #define __MAP0(m,...)
  106. #define __MAP1(m,t,a,...) m(t,a)
  107. #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
  108. #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
  109. #define __MAP4(m,t,a,...) m(t,a), __MAP3(m,__VA_ARGS__)
  110. #define __MAP5(m,t,a,...) m(t,a), __MAP4(m,__VA_ARGS__)
  111. #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
  112. #define __MAP(n,...) __MAP##n(__VA_ARGS__)
  113. #define __SC_DECL(t, a) t a
  114. #define __TYPE_AS(t, v) __same_type((__force t)0, v)
  115. #define __TYPE_IS_L(t) (__TYPE_AS(t, 0L))
  116. #define __TYPE_IS_UL(t) (__TYPE_AS(t, 0UL))
  117. #define __TYPE_IS_LL(t) (__TYPE_AS(t, 0LL) || __TYPE_AS(t, 0ULL))
  118. #define __SC_LONG(t, a) __typeof(__builtin_choose_expr(__TYPE_IS_LL(t), 0LL, 0L)) a
  119. #define __SC_CAST(t, a) (__force t) a
  120. #define __SC_ARGS(t, a) a
  121. #define __SC_TEST(t, a) (void)BUILD_BUG_ON_ZERO(!__TYPE_IS_LL(t) && sizeof(t) > sizeof(long))
  122. #ifdef CONFIG_FTRACE_SYSCALLS
  123. #define __SC_STR_ADECL(t, a) #a
  124. #define __SC_STR_TDECL(t, a) #t
  125. extern struct trace_event_class event_class_syscall_enter;
  126. extern struct trace_event_class event_class_syscall_exit;
  127. extern struct trace_event_functions enter_syscall_print_funcs;
  128. extern struct trace_event_functions exit_syscall_print_funcs;
  129. #define SYSCALL_TRACE_ENTER_EVENT(sname) \
  130. static struct syscall_metadata __syscall_meta_##sname; \
  131. static struct trace_event_call __used \
  132. event_enter_##sname = { \
  133. .class = &event_class_syscall_enter, \
  134. { \
  135. .name = "sys_enter"#sname, \
  136. }, \
  137. .event.funcs = &enter_syscall_print_funcs, \
  138. .data = (void *)&__syscall_meta_##sname,\
  139. .flags = TRACE_EVENT_FL_CAP_ANY, \
  140. }; \
  141. static struct trace_event_call __used \
  142. __section("_ftrace_events") \
  143. *__event_enter_##sname = &event_enter_##sname;
  144. #define SYSCALL_TRACE_EXIT_EVENT(sname) \
  145. static struct syscall_metadata __syscall_meta_##sname; \
  146. static struct trace_event_call __used \
  147. event_exit_##sname = { \
  148. .class = &event_class_syscall_exit, \
  149. { \
  150. .name = "sys_exit"#sname, \
  151. }, \
  152. .event.funcs = &exit_syscall_print_funcs, \
  153. .data = (void *)&__syscall_meta_##sname,\
  154. .flags = TRACE_EVENT_FL_CAP_ANY, \
  155. }; \
  156. static struct trace_event_call __used \
  157. __section("_ftrace_events") \
  158. *__event_exit_##sname = &event_exit_##sname;
  159. #define SYSCALL_METADATA(sname, nb, ...) \
  160. static const char *types_##sname[] = { \
  161. __MAP(nb,__SC_STR_TDECL,__VA_ARGS__) \
  162. }; \
  163. static const char *args_##sname[] = { \
  164. __MAP(nb,__SC_STR_ADECL,__VA_ARGS__) \
  165. }; \
  166. SYSCALL_TRACE_ENTER_EVENT(sname); \
  167. SYSCALL_TRACE_EXIT_EVENT(sname); \
  168. static struct syscall_metadata __used \
  169. __syscall_meta_##sname = { \
  170. .name = "sys"#sname, \
  171. .syscall_nr = -1, /* Filled in at boot */ \
  172. .nb_args = nb, \
  173. .types = nb ? types_##sname : NULL, \
  174. .args = nb ? args_##sname : NULL, \
  175. .enter_event = &event_enter_##sname, \
  176. .exit_event = &event_exit_##sname, \
  177. .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \
  178. }; \
  179. static struct syscall_metadata __used \
  180. __section("__syscalls_metadata") \
  181. *__p_syscall_meta_##sname = &__syscall_meta_##sname;
  182. static inline int is_syscall_trace_event(struct trace_event_call *tp_event)
  183. {
  184. return tp_event->class == &event_class_syscall_enter ||
  185. tp_event->class == &event_class_syscall_exit;
  186. }
  187. #else
  188. #define SYSCALL_METADATA(sname, nb, ...)
  189. static inline int is_syscall_trace_event(struct trace_event_call *tp_event)
  190. {
  191. return 0;
  192. }
  193. #endif
  194. #ifndef SYSCALL_DEFINE0
  195. #define SYSCALL_DEFINE0(sname) \
  196. SYSCALL_METADATA(_##sname, 0); \
  197. asmlinkage long sys_##sname(void); \
  198. ALLOW_ERROR_INJECTION(sys_##sname, ERRNO); \
  199. asmlinkage long sys_##sname(void)
  200. #endif /* SYSCALL_DEFINE0 */
  201. #define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
  202. #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
  203. #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
  204. #define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
  205. #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
  206. #define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
  207. #define SYSCALL_DEFINE_MAXARGS 6
  208. #define SYSCALL_DEFINEx(x, sname, ...) \
  209. SYSCALL_METADATA(sname, x, __VA_ARGS__) \
  210. __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
  211. #define __PROTECT(...) asmlinkage_protect(__VA_ARGS__)
  212. /*
  213. * The asmlinkage stub is aliased to a function named __se_sys_*() which
  214. * sign-extends 32-bit ints to longs whenever needed. The actual work is
  215. * done within __do_sys_*().
  216. */
  217. #ifndef __SYSCALL_DEFINEx
  218. #define __SYSCALL_DEFINEx(x, name, ...) \
  219. __diag_push(); \
  220. __diag_ignore(GCC, 8, "-Wattribute-alias", \
  221. "Type aliasing is used to sanitize syscall arguments");\
  222. asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
  223. __attribute__((alias(__stringify(__se_sys##name)))); \
  224. ALLOW_ERROR_INJECTION(sys##name, ERRNO); \
  225. static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
  226. asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
  227. asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
  228. { \
  229. long ret = __do_sys##name(__MAP(x,__SC_CAST,__VA_ARGS__));\
  230. __MAP(x,__SC_TEST,__VA_ARGS__); \
  231. __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \
  232. return ret; \
  233. } \
  234. __diag_pop(); \
  235. static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
  236. #endif /* __SYSCALL_DEFINEx */
  237. /* For split 64-bit arguments on 32-bit architectures */
  238. #ifdef __LITTLE_ENDIAN
  239. #define SC_ARG64(name) u32, name##_lo, u32, name##_hi
  240. #else
  241. #define SC_ARG64(name) u32, name##_hi, u32, name##_lo
  242. #endif
  243. #define SC_VAL64(type, name) ((type) name##_hi << 32 | name##_lo)
  244. #ifdef CONFIG_COMPAT
  245. #define SYSCALL32_DEFINE1 COMPAT_SYSCALL_DEFINE1
  246. #define SYSCALL32_DEFINE2 COMPAT_SYSCALL_DEFINE2
  247. #define SYSCALL32_DEFINE3 COMPAT_SYSCALL_DEFINE3
  248. #define SYSCALL32_DEFINE4 COMPAT_SYSCALL_DEFINE4
  249. #define SYSCALL32_DEFINE5 COMPAT_SYSCALL_DEFINE5
  250. #define SYSCALL32_DEFINE6 COMPAT_SYSCALL_DEFINE6
  251. #else
  252. #define SYSCALL32_DEFINE1 SYSCALL_DEFINE1
  253. #define SYSCALL32_DEFINE2 SYSCALL_DEFINE2
  254. #define SYSCALL32_DEFINE3 SYSCALL_DEFINE3
  255. #define SYSCALL32_DEFINE4 SYSCALL_DEFINE4
  256. #define SYSCALL32_DEFINE5 SYSCALL_DEFINE5
  257. #define SYSCALL32_DEFINE6 SYSCALL_DEFINE6
  258. #endif
  259. /*
  260. * Called before coming back to user-mode. Returning to user-mode with an
  261. * address limit different than USER_DS can allow to overwrite kernel memory.
  262. */
  263. static inline void addr_limit_user_check(void)
  264. {
  265. #ifdef TIF_FSCHECK
  266. if (!test_thread_flag(TIF_FSCHECK))
  267. return;
  268. #endif
  269. #ifdef TIF_FSCHECK
  270. clear_thread_flag(TIF_FSCHECK);
  271. #endif
  272. }
  273. /*
  274. * These syscall function prototypes are kept in the same order as
  275. * include/uapi/asm-generic/unistd.h. Architecture specific entries go below,
  276. * followed by deprecated or obsolete system calls.
  277. *
  278. * Please note that these prototypes here are only provided for information
  279. * purposes, for static analysis, and for linking from the syscall table.
  280. * These functions should not be called elsewhere from kernel code.
  281. *
  282. * As the syscall calling convention may be different from the default
  283. * for architectures overriding the syscall calling convention, do not
  284. * include the prototypes if CONFIG_ARCH_HAS_SYSCALL_WRAPPER is enabled.
  285. */
  286. #ifndef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
  287. asmlinkage long sys_io_setup(unsigned nr_reqs, aio_context_t __user *ctx);
  288. asmlinkage long sys_io_destroy(aio_context_t ctx);
  289. asmlinkage long sys_io_submit(aio_context_t, long,
  290. struct iocb __user * __user *);
  291. asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb,
  292. struct io_event __user *result);
  293. asmlinkage long sys_io_getevents(aio_context_t ctx_id,
  294. long min_nr,
  295. long nr,
  296. struct io_event __user *events,
  297. struct __kernel_timespec __user *timeout);
  298. asmlinkage long sys_io_getevents_time32(__u32 ctx_id,
  299. __s32 min_nr,
  300. __s32 nr,
  301. struct io_event __user *events,
  302. struct old_timespec32 __user *timeout);
  303. asmlinkage long sys_io_pgetevents(aio_context_t ctx_id,
  304. long min_nr,
  305. long nr,
  306. struct io_event __user *events,
  307. struct __kernel_timespec __user *timeout,
  308. const struct __aio_sigset *sig);
  309. asmlinkage long sys_io_pgetevents_time32(aio_context_t ctx_id,
  310. long min_nr,
  311. long nr,
  312. struct io_event __user *events,
  313. struct old_timespec32 __user *timeout,
  314. const struct __aio_sigset *sig);
  315. asmlinkage long sys_io_uring_setup(u32 entries,
  316. struct io_uring_params __user *p);
  317. asmlinkage long sys_io_uring_enter(unsigned int fd, u32 to_submit,
  318. u32 min_complete, u32 flags,
  319. const void __user *argp, size_t argsz);
  320. asmlinkage long sys_io_uring_register(unsigned int fd, unsigned int op,
  321. void __user *arg, unsigned int nr_args);
  322. /* fs/xattr.c */
  323. asmlinkage long sys_setxattr(const char __user *path, const char __user *name,
  324. const void __user *value, size_t size, int flags);
  325. asmlinkage long sys_lsetxattr(const char __user *path, const char __user *name,
  326. const void __user *value, size_t size, int flags);
  327. asmlinkage long sys_fsetxattr(int fd, const char __user *name,
  328. const void __user *value, size_t size, int flags);
  329. asmlinkage long sys_getxattr(const char __user *path, const char __user *name,
  330. void __user *value, size_t size);
  331. asmlinkage long sys_lgetxattr(const char __user *path, const char __user *name,
  332. void __user *value, size_t size);
  333. asmlinkage long sys_fgetxattr(int fd, const char __user *name,
  334. void __user *value, size_t size);
  335. asmlinkage long sys_listxattr(const char __user *path, char __user *list,
  336. size_t size);
  337. asmlinkage long sys_llistxattr(const char __user *path, char __user *list,
  338. size_t size);
  339. asmlinkage long sys_flistxattr(int fd, char __user *list, size_t size);
  340. asmlinkage long sys_removexattr(const char __user *path,
  341. const char __user *name);
  342. asmlinkage long sys_lremovexattr(const char __user *path,
  343. const char __user *name);
  344. asmlinkage long sys_fremovexattr(int fd, const char __user *name);
  345. /* fs/dcache.c */
  346. asmlinkage long sys_getcwd(char __user *buf, unsigned long size);
  347. /* fs/cookies.c */
  348. asmlinkage long sys_lookup_dcookie(u64 cookie64, char __user *buf, size_t len);
  349. /* fs/eventfd.c */
  350. asmlinkage long sys_eventfd2(unsigned int count, int flags);
  351. /* fs/eventpoll.c */
  352. asmlinkage long sys_epoll_create1(int flags);
  353. asmlinkage long sys_epoll_ctl(int epfd, int op, int fd,
  354. struct epoll_event __user *event);
  355. asmlinkage long sys_epoll_pwait(int epfd, struct epoll_event __user *events,
  356. int maxevents, int timeout,
  357. const sigset_t __user *sigmask,
  358. size_t sigsetsize);
  359. asmlinkage long sys_epoll_pwait2(int epfd, struct epoll_event __user *events,
  360. int maxevents,
  361. const struct __kernel_timespec __user *timeout,
  362. const sigset_t __user *sigmask,
  363. size_t sigsetsize);
  364. /* fs/fcntl.c */
  365. asmlinkage long sys_dup(unsigned int fildes);
  366. asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags);
  367. asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
  368. #if BITS_PER_LONG == 32
  369. asmlinkage long sys_fcntl64(unsigned int fd,
  370. unsigned int cmd, unsigned long arg);
  371. #endif
  372. /* fs/inotify_user.c */
  373. asmlinkage long sys_inotify_init1(int flags);
  374. asmlinkage long sys_inotify_add_watch(int fd, const char __user *path,
  375. u32 mask);
  376. asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd);
  377. /* fs/ioctl.c */
  378. asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd,
  379. unsigned long arg);
  380. /* fs/ioprio.c */
  381. asmlinkage long sys_ioprio_set(int which, int who, int ioprio);
  382. asmlinkage long sys_ioprio_get(int which, int who);
  383. /* fs/locks.c */
  384. asmlinkage long sys_flock(unsigned int fd, unsigned int cmd);
  385. /* fs/namei.c */
  386. asmlinkage long sys_mknodat(int dfd, const char __user * filename, umode_t mode,
  387. unsigned dev);
  388. asmlinkage long sys_mkdirat(int dfd, const char __user * pathname, umode_t mode);
  389. asmlinkage long sys_unlinkat(int dfd, const char __user * pathname, int flag);
  390. asmlinkage long sys_symlinkat(const char __user * oldname,
  391. int newdfd, const char __user * newname);
  392. asmlinkage long sys_linkat(int olddfd, const char __user *oldname,
  393. int newdfd, const char __user *newname, int flags);
  394. asmlinkage long sys_renameat(int olddfd, const char __user * oldname,
  395. int newdfd, const char __user * newname);
  396. /* fs/namespace.c */
  397. asmlinkage long sys_umount(char __user *name, int flags);
  398. asmlinkage long sys_mount(char __user *dev_name, char __user *dir_name,
  399. char __user *type, unsigned long flags,
  400. void __user *data);
  401. asmlinkage long sys_pivot_root(const char __user *new_root,
  402. const char __user *put_old);
  403. /* fs/nfsctl.c */
  404. /* fs/open.c */
  405. asmlinkage long sys_statfs(const char __user * path,
  406. struct statfs __user *buf);
  407. asmlinkage long sys_statfs64(const char __user *path, size_t sz,
  408. struct statfs64 __user *buf);
  409. asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user *buf);
  410. asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz,
  411. struct statfs64 __user *buf);
  412. asmlinkage long sys_truncate(const char __user *path, long length);
  413. asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
  414. #if BITS_PER_LONG == 32
  415. asmlinkage long sys_truncate64(const char __user *path, loff_t length);
  416. asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length);
  417. #endif
  418. asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
  419. asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode);
  420. asmlinkage long sys_faccessat2(int dfd, const char __user *filename, int mode,
  421. int flags);
  422. asmlinkage long sys_chdir(const char __user *filename);
  423. asmlinkage long sys_fchdir(unsigned int fd);
  424. asmlinkage long sys_chroot(const char __user *filename);
  425. asmlinkage long sys_fchmod(unsigned int fd, umode_t mode);
  426. asmlinkage long sys_fchmodat(int dfd, const char __user * filename,
  427. umode_t mode);
  428. asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user,
  429. gid_t group, int flag);
  430. asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group);
  431. asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
  432. umode_t mode);
  433. asmlinkage long sys_openat2(int dfd, const char __user *filename,
  434. struct open_how *how, size_t size);
  435. asmlinkage long sys_close(unsigned int fd);
  436. asmlinkage long sys_close_range(unsigned int fd, unsigned int max_fd,
  437. unsigned int flags);
  438. asmlinkage long sys_vhangup(void);
  439. /* fs/pipe.c */
  440. asmlinkage long sys_pipe2(int __user *fildes, int flags);
  441. /* fs/quota.c */
  442. asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special,
  443. qid_t id, void __user *addr);
  444. asmlinkage long sys_quotactl_fd(unsigned int fd, unsigned int cmd, qid_t id,
  445. void __user *addr);
  446. /* fs/readdir.c */
  447. asmlinkage long sys_getdents64(unsigned int fd,
  448. struct linux_dirent64 __user *dirent,
  449. unsigned int count);
  450. /* fs/read_write.c */
  451. asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
  452. unsigned long offset_low, loff_t __user *result,
  453. unsigned int whence);
  454. asmlinkage long sys_lseek(unsigned int fd, off_t offset,
  455. unsigned int whence);
  456. asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count);
  457. asmlinkage long sys_write(unsigned int fd, const char __user *buf,
  458. size_t count);
  459. asmlinkage long sys_readv(unsigned long fd,
  460. const struct iovec __user *vec,
  461. unsigned long vlen);
  462. asmlinkage long sys_writev(unsigned long fd,
  463. const struct iovec __user *vec,
  464. unsigned long vlen);
  465. asmlinkage long sys_pread64(unsigned int fd, char __user *buf,
  466. size_t count, loff_t pos);
  467. asmlinkage long sys_pwrite64(unsigned int fd, const char __user *buf,
  468. size_t count, loff_t pos);
  469. asmlinkage long sys_preadv(unsigned long fd, const struct iovec __user *vec,
  470. unsigned long vlen, unsigned long pos_l, unsigned long pos_h);
  471. asmlinkage long sys_pwritev(unsigned long fd, const struct iovec __user *vec,
  472. unsigned long vlen, unsigned long pos_l, unsigned long pos_h);
  473. /* fs/sendfile.c */
  474. asmlinkage long sys_sendfile64(int out_fd, int in_fd,
  475. loff_t __user *offset, size_t count);
  476. /* fs/select.c */
  477. asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *,
  478. fd_set __user *, struct __kernel_timespec __user *,
  479. void __user *);
  480. asmlinkage long sys_pselect6_time32(int, fd_set __user *, fd_set __user *,
  481. fd_set __user *, struct old_timespec32 __user *,
  482. void __user *);
  483. asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int,
  484. struct __kernel_timespec __user *, const sigset_t __user *,
  485. size_t);
  486. asmlinkage long sys_ppoll_time32(struct pollfd __user *, unsigned int,
  487. struct old_timespec32 __user *, const sigset_t __user *,
  488. size_t);
  489. /* fs/signalfd.c */
  490. asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask, size_t sizemask, int flags);
  491. /* fs/splice.c */
  492. asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov,
  493. unsigned long nr_segs, unsigned int flags);
  494. asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
  495. int fd_out, loff_t __user *off_out,
  496. size_t len, unsigned int flags);
  497. asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags);
  498. /* fs/stat.c */
  499. asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf,
  500. int bufsiz);
  501. asmlinkage long sys_newfstatat(int dfd, const char __user *filename,
  502. struct stat __user *statbuf, int flag);
  503. asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf);
  504. #if defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_COMPAT_STAT64)
  505. asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf);
  506. asmlinkage long sys_fstatat64(int dfd, const char __user *filename,
  507. struct stat64 __user *statbuf, int flag);
  508. #endif
  509. /* fs/sync.c */
  510. asmlinkage long sys_sync(void);
  511. asmlinkage long sys_fsync(unsigned int fd);
  512. asmlinkage long sys_fdatasync(unsigned int fd);
  513. asmlinkage long sys_sync_file_range2(int fd, unsigned int flags,
  514. loff_t offset, loff_t nbytes);
  515. asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
  516. unsigned int flags);
  517. /* fs/timerfd.c */
  518. asmlinkage long sys_timerfd_create(int clockid, int flags);
  519. asmlinkage long sys_timerfd_settime(int ufd, int flags,
  520. const struct __kernel_itimerspec __user *utmr,
  521. struct __kernel_itimerspec __user *otmr);
  522. asmlinkage long sys_timerfd_gettime(int ufd, struct __kernel_itimerspec __user *otmr);
  523. asmlinkage long sys_timerfd_gettime32(int ufd,
  524. struct old_itimerspec32 __user *otmr);
  525. asmlinkage long sys_timerfd_settime32(int ufd, int flags,
  526. const struct old_itimerspec32 __user *utmr,
  527. struct old_itimerspec32 __user *otmr);
  528. /* fs/utimes.c */
  529. asmlinkage long sys_utimensat(int dfd, const char __user *filename,
  530. struct __kernel_timespec __user *utimes,
  531. int flags);
  532. asmlinkage long sys_utimensat_time32(unsigned int dfd,
  533. const char __user *filename,
  534. struct old_timespec32 __user *t, int flags);
  535. /* kernel/acct.c */
  536. asmlinkage long sys_acct(const char __user *name);
  537. /* kernel/capability.c */
  538. asmlinkage long sys_capget(cap_user_header_t header,
  539. cap_user_data_t dataptr);
  540. asmlinkage long sys_capset(cap_user_header_t header,
  541. const cap_user_data_t data);
  542. /* kernel/exec_domain.c */
  543. asmlinkage long sys_personality(unsigned int personality);
  544. /* kernel/exit.c */
  545. asmlinkage long sys_exit(int error_code);
  546. asmlinkage long sys_exit_group(int error_code);
  547. asmlinkage long sys_waitid(int which, pid_t pid,
  548. struct siginfo __user *infop,
  549. int options, struct rusage __user *ru);
  550. /* kernel/fork.c */
  551. asmlinkage long sys_set_tid_address(int __user *tidptr);
  552. asmlinkage long sys_unshare(unsigned long unshare_flags);
  553. /* kernel/futex/syscalls.c */
  554. asmlinkage long sys_futex(u32 __user *uaddr, int op, u32 val,
  555. const struct __kernel_timespec __user *utime,
  556. u32 __user *uaddr2, u32 val3);
  557. asmlinkage long sys_futex_time32(u32 __user *uaddr, int op, u32 val,
  558. const struct old_timespec32 __user *utime,
  559. u32 __user *uaddr2, u32 val3);
  560. asmlinkage long sys_get_robust_list(int pid,
  561. struct robust_list_head __user * __user *head_ptr,
  562. size_t __user *len_ptr);
  563. asmlinkage long sys_set_robust_list(struct robust_list_head __user *head,
  564. size_t len);
  565. asmlinkage long sys_futex_waitv(struct futex_waitv *waiters,
  566. unsigned int nr_futexes, unsigned int flags,
  567. struct __kernel_timespec __user *timeout, clockid_t clockid);
  568. /* kernel/hrtimer.c */
  569. asmlinkage long sys_nanosleep(struct __kernel_timespec __user *rqtp,
  570. struct __kernel_timespec __user *rmtp);
  571. asmlinkage long sys_nanosleep_time32(struct old_timespec32 __user *rqtp,
  572. struct old_timespec32 __user *rmtp);
  573. /* kernel/itimer.c */
  574. asmlinkage long sys_getitimer(int which, struct __kernel_old_itimerval __user *value);
  575. asmlinkage long sys_setitimer(int which,
  576. struct __kernel_old_itimerval __user *value,
  577. struct __kernel_old_itimerval __user *ovalue);
  578. /* kernel/kexec.c */
  579. asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
  580. struct kexec_segment __user *segments,
  581. unsigned long flags);
  582. /* kernel/module.c */
  583. asmlinkage long sys_init_module(void __user *umod, unsigned long len,
  584. const char __user *uargs);
  585. asmlinkage long sys_delete_module(const char __user *name_user,
  586. unsigned int flags);
  587. /* kernel/posix-timers.c */
  588. asmlinkage long sys_timer_create(clockid_t which_clock,
  589. struct sigevent __user *timer_event_spec,
  590. timer_t __user * created_timer_id);
  591. asmlinkage long sys_timer_gettime(timer_t timer_id,
  592. struct __kernel_itimerspec __user *setting);
  593. asmlinkage long sys_timer_getoverrun(timer_t timer_id);
  594. asmlinkage long sys_timer_settime(timer_t timer_id, int flags,
  595. const struct __kernel_itimerspec __user *new_setting,
  596. struct __kernel_itimerspec __user *old_setting);
  597. asmlinkage long sys_timer_delete(timer_t timer_id);
  598. asmlinkage long sys_clock_settime(clockid_t which_clock,
  599. const struct __kernel_timespec __user *tp);
  600. asmlinkage long sys_clock_gettime(clockid_t which_clock,
  601. struct __kernel_timespec __user *tp);
  602. asmlinkage long sys_clock_getres(clockid_t which_clock,
  603. struct __kernel_timespec __user *tp);
  604. asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags,
  605. const struct __kernel_timespec __user *rqtp,
  606. struct __kernel_timespec __user *rmtp);
  607. asmlinkage long sys_timer_gettime32(timer_t timer_id,
  608. struct old_itimerspec32 __user *setting);
  609. asmlinkage long sys_timer_settime32(timer_t timer_id, int flags,
  610. struct old_itimerspec32 __user *new,
  611. struct old_itimerspec32 __user *old);
  612. asmlinkage long sys_clock_settime32(clockid_t which_clock,
  613. struct old_timespec32 __user *tp);
  614. asmlinkage long sys_clock_gettime32(clockid_t which_clock,
  615. struct old_timespec32 __user *tp);
  616. asmlinkage long sys_clock_getres_time32(clockid_t which_clock,
  617. struct old_timespec32 __user *tp);
  618. asmlinkage long sys_clock_nanosleep_time32(clockid_t which_clock, int flags,
  619. struct old_timespec32 __user *rqtp,
  620. struct old_timespec32 __user *rmtp);
  621. /* kernel/printk.c */
  622. asmlinkage long sys_syslog(int type, char __user *buf, int len);
  623. /* kernel/ptrace.c */
  624. asmlinkage long sys_ptrace(long request, long pid, unsigned long addr,
  625. unsigned long data);
  626. /* kernel/sched/core.c */
  627. asmlinkage long sys_sched_setparam(pid_t pid,
  628. struct sched_param __user *param);
  629. asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
  630. struct sched_param __user *param);
  631. asmlinkage long sys_sched_getscheduler(pid_t pid);
  632. asmlinkage long sys_sched_getparam(pid_t pid,
  633. struct sched_param __user *param);
  634. asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len,
  635. unsigned long __user *user_mask_ptr);
  636. asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len,
  637. unsigned long __user *user_mask_ptr);
  638. asmlinkage long sys_sched_yield(void);
  639. asmlinkage long sys_sched_get_priority_max(int policy);
  640. asmlinkage long sys_sched_get_priority_min(int policy);
  641. asmlinkage long sys_sched_rr_get_interval(pid_t pid,
  642. struct __kernel_timespec __user *interval);
  643. asmlinkage long sys_sched_rr_get_interval_time32(pid_t pid,
  644. struct old_timespec32 __user *interval);
  645. /* kernel/signal.c */
  646. asmlinkage long sys_restart_syscall(void);
  647. asmlinkage long sys_kill(pid_t pid, int sig);
  648. asmlinkage long sys_tkill(pid_t pid, int sig);
  649. asmlinkage long sys_tgkill(pid_t tgid, pid_t pid, int sig);
  650. asmlinkage long sys_sigaltstack(const struct sigaltstack __user *uss,
  651. struct sigaltstack __user *uoss);
  652. asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize);
  653. #ifndef CONFIG_ODD_RT_SIGACTION
  654. asmlinkage long sys_rt_sigaction(int,
  655. const struct sigaction __user *,
  656. struct sigaction __user *,
  657. size_t);
  658. #endif
  659. asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set,
  660. sigset_t __user *oset, size_t sigsetsize);
  661. asmlinkage long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize);
  662. asmlinkage long sys_rt_sigtimedwait(const sigset_t __user *uthese,
  663. siginfo_t __user *uinfo,
  664. const struct __kernel_timespec __user *uts,
  665. size_t sigsetsize);
  666. asmlinkage long sys_rt_sigtimedwait_time32(const sigset_t __user *uthese,
  667. siginfo_t __user *uinfo,
  668. const struct old_timespec32 __user *uts,
  669. size_t sigsetsize);
  670. asmlinkage long sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo);
  671. /* kernel/sys.c */
  672. asmlinkage long sys_setpriority(int which, int who, int niceval);
  673. asmlinkage long sys_getpriority(int which, int who);
  674. asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd,
  675. void __user *arg);
  676. asmlinkage long sys_setregid(gid_t rgid, gid_t egid);
  677. asmlinkage long sys_setgid(gid_t gid);
  678. asmlinkage long sys_setreuid(uid_t ruid, uid_t euid);
  679. asmlinkage long sys_setuid(uid_t uid);
  680. asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid);
  681. asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __user *suid);
  682. asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid);
  683. asmlinkage long sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __user *sgid);
  684. asmlinkage long sys_setfsuid(uid_t uid);
  685. asmlinkage long sys_setfsgid(gid_t gid);
  686. asmlinkage long sys_times(struct tms __user *tbuf);
  687. asmlinkage long sys_setpgid(pid_t pid, pid_t pgid);
  688. asmlinkage long sys_getpgid(pid_t pid);
  689. asmlinkage long sys_getsid(pid_t pid);
  690. asmlinkage long sys_setsid(void);
  691. asmlinkage long sys_getgroups(int gidsetsize, gid_t __user *grouplist);
  692. asmlinkage long sys_setgroups(int gidsetsize, gid_t __user *grouplist);
  693. asmlinkage long sys_newuname(struct new_utsname __user *name);
  694. asmlinkage long sys_sethostname(char __user *name, int len);
  695. asmlinkage long sys_setdomainname(char __user *name, int len);
  696. asmlinkage long sys_getrlimit(unsigned int resource,
  697. struct rlimit __user *rlim);
  698. asmlinkage long sys_setrlimit(unsigned int resource,
  699. struct rlimit __user *rlim);
  700. asmlinkage long sys_getrusage(int who, struct rusage __user *ru);
  701. asmlinkage long sys_umask(int mask);
  702. asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
  703. unsigned long arg4, unsigned long arg5);
  704. asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache);
  705. /* kernel/time.c */
  706. asmlinkage long sys_gettimeofday(struct __kernel_old_timeval __user *tv,
  707. struct timezone __user *tz);
  708. asmlinkage long sys_settimeofday(struct __kernel_old_timeval __user *tv,
  709. struct timezone __user *tz);
  710. asmlinkage long sys_adjtimex(struct __kernel_timex __user *txc_p);
  711. asmlinkage long sys_adjtimex_time32(struct old_timex32 __user *txc_p);
  712. /* kernel/sys.c */
  713. asmlinkage long sys_getpid(void);
  714. asmlinkage long sys_getppid(void);
  715. asmlinkage long sys_getuid(void);
  716. asmlinkage long sys_geteuid(void);
  717. asmlinkage long sys_getgid(void);
  718. asmlinkage long sys_getegid(void);
  719. asmlinkage long sys_gettid(void);
  720. asmlinkage long sys_sysinfo(struct sysinfo __user *info);
  721. /* ipc/mqueue.c */
  722. asmlinkage long sys_mq_open(const char __user *name, int oflag, umode_t mode, struct mq_attr __user *attr);
  723. asmlinkage long sys_mq_unlink(const char __user *name);
  724. asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct __kernel_timespec __user *abs_timeout);
  725. asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct __kernel_timespec __user *abs_timeout);
  726. asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification);
  727. asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat);
  728. asmlinkage long sys_mq_timedreceive_time32(mqd_t mqdes,
  729. char __user *u_msg_ptr,
  730. unsigned int msg_len, unsigned int __user *u_msg_prio,
  731. const struct old_timespec32 __user *u_abs_timeout);
  732. asmlinkage long sys_mq_timedsend_time32(mqd_t mqdes,
  733. const char __user *u_msg_ptr,
  734. unsigned int msg_len, unsigned int msg_prio,
  735. const struct old_timespec32 __user *u_abs_timeout);
  736. /* ipc/msg.c */
  737. asmlinkage long sys_msgget(key_t key, int msgflg);
  738. asmlinkage long sys_old_msgctl(int msqid, int cmd, struct msqid_ds __user *buf);
  739. asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf);
  740. asmlinkage long sys_msgrcv(int msqid, struct msgbuf __user *msgp,
  741. size_t msgsz, long msgtyp, int msgflg);
  742. asmlinkage long sys_msgsnd(int msqid, struct msgbuf __user *msgp,
  743. size_t msgsz, int msgflg);
  744. /* ipc/sem.c */
  745. asmlinkage long sys_semget(key_t key, int nsems, int semflg);
  746. asmlinkage long sys_semctl(int semid, int semnum, int cmd, unsigned long arg);
  747. asmlinkage long sys_old_semctl(int semid, int semnum, int cmd, unsigned long arg);
  748. asmlinkage long sys_semtimedop(int semid, struct sembuf __user *sops,
  749. unsigned nsops,
  750. const struct __kernel_timespec __user *timeout);
  751. asmlinkage long sys_semtimedop_time32(int semid, struct sembuf __user *sops,
  752. unsigned nsops,
  753. const struct old_timespec32 __user *timeout);
  754. asmlinkage long sys_semop(int semid, struct sembuf __user *sops,
  755. unsigned nsops);
  756. /* ipc/shm.c */
  757. asmlinkage long sys_shmget(key_t key, size_t size, int flag);
  758. asmlinkage long sys_old_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
  759. asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
  760. asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg);
  761. asmlinkage long sys_shmdt(char __user *shmaddr);
  762. /* net/socket.c */
  763. asmlinkage long sys_socket(int, int, int);
  764. asmlinkage long sys_socketpair(int, int, int, int __user *);
  765. asmlinkage long sys_bind(int, struct sockaddr __user *, int);
  766. asmlinkage long sys_listen(int, int);
  767. asmlinkage long sys_accept(int, struct sockaddr __user *, int __user *);
  768. asmlinkage long sys_connect(int, struct sockaddr __user *, int);
  769. asmlinkage long sys_getsockname(int, struct sockaddr __user *, int __user *);
  770. asmlinkage long sys_getpeername(int, struct sockaddr __user *, int __user *);
  771. asmlinkage long sys_sendto(int, void __user *, size_t, unsigned,
  772. struct sockaddr __user *, int);
  773. asmlinkage long sys_recvfrom(int, void __user *, size_t, unsigned,
  774. struct sockaddr __user *, int __user *);
  775. asmlinkage long sys_setsockopt(int fd, int level, int optname,
  776. char __user *optval, int optlen);
  777. asmlinkage long sys_getsockopt(int fd, int level, int optname,
  778. char __user *optval, int __user *optlen);
  779. asmlinkage long sys_shutdown(int, int);
  780. asmlinkage long sys_sendmsg(int fd, struct user_msghdr __user *msg, unsigned flags);
  781. asmlinkage long sys_recvmsg(int fd, struct user_msghdr __user *msg, unsigned flags);
  782. /* mm/filemap.c */
  783. asmlinkage long sys_readahead(int fd, loff_t offset, size_t count);
  784. /* mm/nommu.c, also with MMU */
  785. asmlinkage long sys_brk(unsigned long brk);
  786. asmlinkage long sys_munmap(unsigned long addr, size_t len);
  787. asmlinkage long sys_mremap(unsigned long addr,
  788. unsigned long old_len, unsigned long new_len,
  789. unsigned long flags, unsigned long new_addr);
  790. /* security/keys/keyctl.c */
  791. asmlinkage long sys_add_key(const char __user *_type,
  792. const char __user *_description,
  793. const void __user *_payload,
  794. size_t plen,
  795. key_serial_t destringid);
  796. asmlinkage long sys_request_key(const char __user *_type,
  797. const char __user *_description,
  798. const char __user *_callout_info,
  799. key_serial_t destringid);
  800. asmlinkage long sys_keyctl(int cmd, unsigned long arg2, unsigned long arg3,
  801. unsigned long arg4, unsigned long arg5);
  802. /* arch/example/kernel/sys_example.c */
  803. #ifdef CONFIG_CLONE_BACKWARDS
  804. asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, unsigned long,
  805. int __user *);
  806. #else
  807. #ifdef CONFIG_CLONE_BACKWARDS3
  808. asmlinkage long sys_clone(unsigned long, unsigned long, int, int __user *,
  809. int __user *, unsigned long);
  810. #else
  811. asmlinkage long sys_clone(unsigned long, unsigned long, int __user *,
  812. int __user *, unsigned long);
  813. #endif
  814. #endif
  815. asmlinkage long sys_clone3(struct clone_args __user *uargs, size_t size);
  816. asmlinkage long sys_execve(const char __user *filename,
  817. const char __user *const __user *argv,
  818. const char __user *const __user *envp);
  819. /* mm/fadvise.c */
  820. asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
  821. /* mm/, CONFIG_MMU only */
  822. asmlinkage long sys_swapon(const char __user *specialfile, int swap_flags);
  823. asmlinkage long sys_swapoff(const char __user *specialfile);
  824. asmlinkage long sys_mprotect(unsigned long start, size_t len,
  825. unsigned long prot);
  826. asmlinkage long sys_msync(unsigned long start, size_t len, int flags);
  827. asmlinkage long sys_mlock(unsigned long start, size_t len);
  828. asmlinkage long sys_munlock(unsigned long start, size_t len);
  829. asmlinkage long sys_mlockall(int flags);
  830. asmlinkage long sys_munlockall(void);
  831. asmlinkage long sys_mincore(unsigned long start, size_t len,
  832. unsigned char __user * vec);
  833. asmlinkage long sys_madvise(unsigned long start, size_t len, int behavior);
  834. asmlinkage long sys_process_madvise(int pidfd, const struct iovec __user *vec,
  835. size_t vlen, int behavior, unsigned int flags);
  836. asmlinkage long sys_process_mrelease(int pidfd, unsigned int flags);
  837. asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
  838. unsigned long prot, unsigned long pgoff,
  839. unsigned long flags);
  840. asmlinkage long sys_mbind(unsigned long start, unsigned long len,
  841. unsigned long mode,
  842. const unsigned long __user *nmask,
  843. unsigned long maxnode,
  844. unsigned flags);
  845. asmlinkage long sys_get_mempolicy(int __user *policy,
  846. unsigned long __user *nmask,
  847. unsigned long maxnode,
  848. unsigned long addr, unsigned long flags);
  849. asmlinkage long sys_set_mempolicy(int mode, const unsigned long __user *nmask,
  850. unsigned long maxnode);
  851. asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode,
  852. const unsigned long __user *from,
  853. const unsigned long __user *to);
  854. asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages,
  855. const void __user * __user *pages,
  856. const int __user *nodes,
  857. int __user *status,
  858. int flags);
  859. asmlinkage long sys_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig,
  860. siginfo_t __user *uinfo);
  861. asmlinkage long sys_perf_event_open(
  862. struct perf_event_attr __user *attr_uptr,
  863. pid_t pid, int cpu, int group_fd, unsigned long flags);
  864. asmlinkage long sys_accept4(int, struct sockaddr __user *, int __user *, int);
  865. asmlinkage long sys_recvmmsg(int fd, struct mmsghdr __user *msg,
  866. unsigned int vlen, unsigned flags,
  867. struct __kernel_timespec __user *timeout);
  868. asmlinkage long sys_recvmmsg_time32(int fd, struct mmsghdr __user *msg,
  869. unsigned int vlen, unsigned flags,
  870. struct old_timespec32 __user *timeout);
  871. asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr,
  872. int options, struct rusage __user *ru);
  873. asmlinkage long sys_prlimit64(pid_t pid, unsigned int resource,
  874. const struct rlimit64 __user *new_rlim,
  875. struct rlimit64 __user *old_rlim);
  876. asmlinkage long sys_fanotify_init(unsigned int flags, unsigned int event_f_flags);
  877. asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags,
  878. u64 mask, int fd,
  879. const char __user *pathname);
  880. asmlinkage long sys_name_to_handle_at(int dfd, const char __user *name,
  881. struct file_handle __user *handle,
  882. int __user *mnt_id, int flag);
  883. asmlinkage long sys_open_by_handle_at(int mountdirfd,
  884. struct file_handle __user *handle,
  885. int flags);
  886. asmlinkage long sys_clock_adjtime(clockid_t which_clock,
  887. struct __kernel_timex __user *tx);
  888. asmlinkage long sys_clock_adjtime32(clockid_t which_clock,
  889. struct old_timex32 __user *tx);
  890. asmlinkage long sys_syncfs(int fd);
  891. asmlinkage long sys_setns(int fd, int nstype);
  892. asmlinkage long sys_pidfd_open(pid_t pid, unsigned int flags);
  893. asmlinkage long sys_sendmmsg(int fd, struct mmsghdr __user *msg,
  894. unsigned int vlen, unsigned flags);
  895. asmlinkage long sys_process_vm_readv(pid_t pid,
  896. const struct iovec __user *lvec,
  897. unsigned long liovcnt,
  898. const struct iovec __user *rvec,
  899. unsigned long riovcnt,
  900. unsigned long flags);
  901. asmlinkage long sys_process_vm_writev(pid_t pid,
  902. const struct iovec __user *lvec,
  903. unsigned long liovcnt,
  904. const struct iovec __user *rvec,
  905. unsigned long riovcnt,
  906. unsigned long flags);
  907. asmlinkage long sys_kcmp(pid_t pid1, pid_t pid2, int type,
  908. unsigned long idx1, unsigned long idx2);
  909. asmlinkage long sys_finit_module(int fd, const char __user *uargs, int flags);
  910. asmlinkage long sys_sched_setattr(pid_t pid,
  911. struct sched_attr __user *attr,
  912. unsigned int flags);
  913. asmlinkage long sys_sched_getattr(pid_t pid,
  914. struct sched_attr __user *attr,
  915. unsigned int size,
  916. unsigned int flags);
  917. asmlinkage long sys_renameat2(int olddfd, const char __user *oldname,
  918. int newdfd, const char __user *newname,
  919. unsigned int flags);
  920. asmlinkage long sys_seccomp(unsigned int op, unsigned int flags,
  921. void __user *uargs);
  922. asmlinkage long sys_getrandom(char __user *buf, size_t count,
  923. unsigned int flags);
  924. asmlinkage long sys_memfd_create(const char __user *uname_ptr, unsigned int flags);
  925. asmlinkage long sys_bpf(int cmd, union bpf_attr *attr, unsigned int size);
  926. asmlinkage long sys_execveat(int dfd, const char __user *filename,
  927. const char __user *const __user *argv,
  928. const char __user *const __user *envp, int flags);
  929. asmlinkage long sys_userfaultfd(int flags);
  930. asmlinkage long sys_membarrier(int cmd, unsigned int flags, int cpu_id);
  931. asmlinkage long sys_mlock2(unsigned long start, size_t len, int flags);
  932. asmlinkage long sys_copy_file_range(int fd_in, loff_t __user *off_in,
  933. int fd_out, loff_t __user *off_out,
  934. size_t len, unsigned int flags);
  935. asmlinkage long sys_preadv2(unsigned long fd, const struct iovec __user *vec,
  936. unsigned long vlen, unsigned long pos_l, unsigned long pos_h,
  937. rwf_t flags);
  938. asmlinkage long sys_pwritev2(unsigned long fd, const struct iovec __user *vec,
  939. unsigned long vlen, unsigned long pos_l, unsigned long pos_h,
  940. rwf_t flags);
  941. asmlinkage long sys_pkey_mprotect(unsigned long start, size_t len,
  942. unsigned long prot, int pkey);
  943. asmlinkage long sys_pkey_alloc(unsigned long flags, unsigned long init_val);
  944. asmlinkage long sys_pkey_free(int pkey);
  945. asmlinkage long sys_statx(int dfd, const char __user *path, unsigned flags,
  946. unsigned mask, struct statx __user *buffer);
  947. asmlinkage long sys_rseq(struct rseq __user *rseq, uint32_t rseq_len,
  948. int flags, uint32_t sig);
  949. asmlinkage long sys_open_tree(int dfd, const char __user *path, unsigned flags);
  950. asmlinkage long sys_move_mount(int from_dfd, const char __user *from_path,
  951. int to_dfd, const char __user *to_path,
  952. unsigned int ms_flags);
  953. asmlinkage long sys_mount_setattr(int dfd, const char __user *path,
  954. unsigned int flags,
  955. struct mount_attr __user *uattr, size_t usize);
  956. asmlinkage long sys_fsopen(const char __user *fs_name, unsigned int flags);
  957. asmlinkage long sys_fsconfig(int fs_fd, unsigned int cmd, const char __user *key,
  958. const void __user *value, int aux);
  959. asmlinkage long sys_fsmount(int fs_fd, unsigned int flags, unsigned int ms_flags);
  960. asmlinkage long sys_fspick(int dfd, const char __user *path, unsigned int flags);
  961. asmlinkage long sys_pidfd_send_signal(int pidfd, int sig,
  962. siginfo_t __user *info,
  963. unsigned int flags);
  964. asmlinkage long sys_pidfd_getfd(int pidfd, int fd, unsigned int flags);
  965. asmlinkage long sys_landlock_create_ruleset(const struct landlock_ruleset_attr __user *attr,
  966. size_t size, __u32 flags);
  967. asmlinkage long sys_landlock_add_rule(int ruleset_fd, enum landlock_rule_type rule_type,
  968. const void __user *rule_attr, __u32 flags);
  969. asmlinkage long sys_landlock_restrict_self(int ruleset_fd, __u32 flags);
  970. asmlinkage long sys_memfd_secret(unsigned int flags);
  971. asmlinkage long sys_set_mempolicy_home_node(unsigned long start, unsigned long len,
  972. unsigned long home_node,
  973. unsigned long flags);
  974. /*
  975. * Architecture-specific system calls
  976. */
  977. /* arch/x86/kernel/ioport.c */
  978. asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on);
  979. /* pciconfig: alpha, arm, arm64, ia64, sparc */
  980. asmlinkage long sys_pciconfig_read(unsigned long bus, unsigned long dfn,
  981. unsigned long off, unsigned long len,
  982. void __user *buf);
  983. asmlinkage long sys_pciconfig_write(unsigned long bus, unsigned long dfn,
  984. unsigned long off, unsigned long len,
  985. void __user *buf);
  986. asmlinkage long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn);
  987. /* powerpc */
  988. asmlinkage long sys_spu_run(int fd, __u32 __user *unpc,
  989. __u32 __user *ustatus);
  990. asmlinkage long sys_spu_create(const char __user *name,
  991. unsigned int flags, umode_t mode, int fd);
  992. /*
  993. * Deprecated system calls which are still defined in
  994. * include/uapi/asm-generic/unistd.h and wanted by >= 1 arch
  995. */
  996. /* __ARCH_WANT_SYSCALL_NO_AT */
  997. asmlinkage long sys_open(const char __user *filename,
  998. int flags, umode_t mode);
  999. asmlinkage long sys_link(const char __user *oldname,
  1000. const char __user *newname);
  1001. asmlinkage long sys_unlink(const char __user *pathname);
  1002. asmlinkage long sys_mknod(const char __user *filename, umode_t mode,
  1003. unsigned dev);
  1004. asmlinkage long sys_chmod(const char __user *filename, umode_t mode);
  1005. asmlinkage long sys_chown(const char __user *filename,
  1006. uid_t user, gid_t group);
  1007. asmlinkage long sys_mkdir(const char __user *pathname, umode_t mode);
  1008. asmlinkage long sys_rmdir(const char __user *pathname);
  1009. asmlinkage long sys_lchown(const char __user *filename,
  1010. uid_t user, gid_t group);
  1011. asmlinkage long sys_access(const char __user *filename, int mode);
  1012. asmlinkage long sys_rename(const char __user *oldname,
  1013. const char __user *newname);
  1014. asmlinkage long sys_symlink(const char __user *old, const char __user *new);
  1015. #if defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_COMPAT_STAT64)
  1016. asmlinkage long sys_stat64(const char __user *filename,
  1017. struct stat64 __user *statbuf);
  1018. asmlinkage long sys_lstat64(const char __user *filename,
  1019. struct stat64 __user *statbuf);
  1020. #endif
  1021. /* __ARCH_WANT_SYSCALL_NO_FLAGS */
  1022. asmlinkage long sys_pipe(int __user *fildes);
  1023. asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd);
  1024. asmlinkage long sys_epoll_create(int size);
  1025. asmlinkage long sys_inotify_init(void);
  1026. asmlinkage long sys_eventfd(unsigned int count);
  1027. asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask);
  1028. /* __ARCH_WANT_SYSCALL_OFF_T */
  1029. asmlinkage long sys_sendfile(int out_fd, int in_fd,
  1030. off_t __user *offset, size_t count);
  1031. asmlinkage long sys_newstat(const char __user *filename,
  1032. struct stat __user *statbuf);
  1033. asmlinkage long sys_newlstat(const char __user *filename,
  1034. struct stat __user *statbuf);
  1035. asmlinkage long sys_fadvise64(int fd, loff_t offset, size_t len, int advice);
  1036. /* __ARCH_WANT_SYSCALL_DEPRECATED */
  1037. asmlinkage long sys_alarm(unsigned int seconds);
  1038. asmlinkage long sys_getpgrp(void);
  1039. asmlinkage long sys_pause(void);
  1040. asmlinkage long sys_time(__kernel_old_time_t __user *tloc);
  1041. asmlinkage long sys_time32(old_time32_t __user *tloc);
  1042. #ifdef __ARCH_WANT_SYS_UTIME
  1043. asmlinkage long sys_utime(char __user *filename,
  1044. struct utimbuf __user *times);
  1045. asmlinkage long sys_utimes(char __user *filename,
  1046. struct __kernel_old_timeval __user *utimes);
  1047. asmlinkage long sys_futimesat(int dfd, const char __user *filename,
  1048. struct __kernel_old_timeval __user *utimes);
  1049. #endif
  1050. asmlinkage long sys_futimesat_time32(unsigned int dfd,
  1051. const char __user *filename,
  1052. struct old_timeval32 __user *t);
  1053. asmlinkage long sys_utime32(const char __user *filename,
  1054. struct old_utimbuf32 __user *t);
  1055. asmlinkage long sys_utimes_time32(const char __user *filename,
  1056. struct old_timeval32 __user *t);
  1057. asmlinkage long sys_creat(const char __user *pathname, umode_t mode);
  1058. asmlinkage long sys_getdents(unsigned int fd,
  1059. struct linux_dirent __user *dirent,
  1060. unsigned int count);
  1061. asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
  1062. fd_set __user *exp, struct __kernel_old_timeval __user *tvp);
  1063. asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,
  1064. int timeout);
  1065. asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events,
  1066. int maxevents, int timeout);
  1067. asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf);
  1068. asmlinkage long sys_vfork(void);
  1069. asmlinkage long sys_recv(int, void __user *, size_t, unsigned);
  1070. asmlinkage long sys_send(int, void __user *, size_t, unsigned);
  1071. asmlinkage long sys_oldumount(char __user *name);
  1072. asmlinkage long sys_uselib(const char __user *library);
  1073. asmlinkage long sys_sysfs(int option,
  1074. unsigned long arg1, unsigned long arg2);
  1075. asmlinkage long sys_fork(void);
  1076. /* obsolete: kernel/time/time.c */
  1077. asmlinkage long sys_stime(__kernel_old_time_t __user *tptr);
  1078. asmlinkage long sys_stime32(old_time32_t __user *tptr);
  1079. /* obsolete: kernel/signal.c */
  1080. asmlinkage long sys_sigpending(old_sigset_t __user *uset);
  1081. asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set,
  1082. old_sigset_t __user *oset);
  1083. #ifdef CONFIG_OLD_SIGSUSPEND
  1084. asmlinkage long sys_sigsuspend(old_sigset_t mask);
  1085. #endif
  1086. #ifdef CONFIG_OLD_SIGSUSPEND3
  1087. asmlinkage long sys_sigsuspend(int unused1, int unused2, old_sigset_t mask);
  1088. #endif
  1089. #ifdef CONFIG_OLD_SIGACTION
  1090. asmlinkage long sys_sigaction(int, const struct old_sigaction __user *,
  1091. struct old_sigaction __user *);
  1092. #endif
  1093. asmlinkage long sys_sgetmask(void);
  1094. asmlinkage long sys_ssetmask(int newmask);
  1095. asmlinkage long sys_signal(int sig, __sighandler_t handler);
  1096. /* obsolete: kernel/sched/core.c */
  1097. asmlinkage long sys_nice(int increment);
  1098. /* obsolete: kernel/kexec_file.c */
  1099. asmlinkage long sys_kexec_file_load(int kernel_fd, int initrd_fd,
  1100. unsigned long cmdline_len,
  1101. const char __user *cmdline_ptr,
  1102. unsigned long flags);
  1103. /* obsolete: kernel/exit.c */
  1104. asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options);
  1105. /* obsolete: kernel/uid16.c */
  1106. #ifdef CONFIG_HAVE_UID16
  1107. asmlinkage long sys_chown16(const char __user *filename,
  1108. old_uid_t user, old_gid_t group);
  1109. asmlinkage long sys_lchown16(const char __user *filename,
  1110. old_uid_t user, old_gid_t group);
  1111. asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group);
  1112. asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid);
  1113. asmlinkage long sys_setgid16(old_gid_t gid);
  1114. asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid);
  1115. asmlinkage long sys_setuid16(old_uid_t uid);
  1116. asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid);
  1117. asmlinkage long sys_getresuid16(old_uid_t __user *ruid,
  1118. old_uid_t __user *euid, old_uid_t __user *suid);
  1119. asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid);
  1120. asmlinkage long sys_getresgid16(old_gid_t __user *rgid,
  1121. old_gid_t __user *egid, old_gid_t __user *sgid);
  1122. asmlinkage long sys_setfsuid16(old_uid_t uid);
  1123. asmlinkage long sys_setfsgid16(old_gid_t gid);
  1124. asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist);
  1125. asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist);
  1126. asmlinkage long sys_getuid16(void);
  1127. asmlinkage long sys_geteuid16(void);
  1128. asmlinkage long sys_getgid16(void);
  1129. asmlinkage long sys_getegid16(void);
  1130. #endif
  1131. /* obsolete: net/socket.c */
  1132. asmlinkage long sys_socketcall(int call, unsigned long __user *args);
  1133. /* obsolete: fs/stat.c */
  1134. asmlinkage long sys_stat(const char __user *filename,
  1135. struct __old_kernel_stat __user *statbuf);
  1136. asmlinkage long sys_lstat(const char __user *filename,
  1137. struct __old_kernel_stat __user *statbuf);
  1138. asmlinkage long sys_fstat(unsigned int fd,
  1139. struct __old_kernel_stat __user *statbuf);
  1140. asmlinkage long sys_readlink(const char __user *path,
  1141. char __user *buf, int bufsiz);
  1142. /* obsolete: fs/select.c */
  1143. asmlinkage long sys_old_select(struct sel_arg_struct __user *arg);
  1144. /* obsolete: fs/readdir.c */
  1145. asmlinkage long sys_old_readdir(unsigned int, struct old_linux_dirent __user *, unsigned int);
  1146. /* obsolete: kernel/sys.c */
  1147. asmlinkage long sys_gethostname(char __user *name, int len);
  1148. asmlinkage long sys_uname(struct old_utsname __user *);
  1149. asmlinkage long sys_olduname(struct oldold_utsname __user *);
  1150. #ifdef __ARCH_WANT_SYS_OLD_GETRLIMIT
  1151. asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *rlim);
  1152. #endif
  1153. /* obsolete: ipc */
  1154. asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,
  1155. unsigned long third, void __user *ptr, long fifth);
  1156. /* obsolete: mm/ */
  1157. asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len,
  1158. unsigned long prot, unsigned long flags,
  1159. unsigned long fd, unsigned long pgoff);
  1160. asmlinkage long sys_old_mmap(struct mmap_arg_struct __user *arg);
  1161. /*
  1162. * Not a real system call, but a placeholder for syscalls which are
  1163. * not implemented -- see kernel/sys_ni.c
  1164. */
  1165. asmlinkage long sys_ni_syscall(void);
  1166. #endif /* CONFIG_ARCH_HAS_SYSCALL_WRAPPER */
  1167. /*
  1168. * Kernel code should not call syscalls (i.e., sys_xyzyyz()) directly.
  1169. * Instead, use one of the functions which work equivalently, such as
  1170. * the ksys_xyzyyz() functions prototyped below.
  1171. */
  1172. ssize_t ksys_write(unsigned int fd, const char __user *buf, size_t count);
  1173. int ksys_fchown(unsigned int fd, uid_t user, gid_t group);
  1174. ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count);
  1175. void ksys_sync(void);
  1176. int ksys_unshare(unsigned long unshare_flags);
  1177. int ksys_setsid(void);
  1178. int ksys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
  1179. unsigned int flags);
  1180. ssize_t ksys_pread64(unsigned int fd, char __user *buf, size_t count,
  1181. loff_t pos);
  1182. ssize_t ksys_pwrite64(unsigned int fd, const char __user *buf,
  1183. size_t count, loff_t pos);
  1184. int ksys_fallocate(int fd, int mode, loff_t offset, loff_t len);
  1185. #ifdef CONFIG_ADVISE_SYSCALLS
  1186. int ksys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
  1187. #else
  1188. static inline int ksys_fadvise64_64(int fd, loff_t offset, loff_t len,
  1189. int advice)
  1190. {
  1191. return -EINVAL;
  1192. }
  1193. #endif
  1194. unsigned long ksys_mmap_pgoff(unsigned long addr, unsigned long len,
  1195. unsigned long prot, unsigned long flags,
  1196. unsigned long fd, unsigned long pgoff);
  1197. ssize_t ksys_readahead(int fd, loff_t offset, size_t count);
  1198. int ksys_ipc(unsigned int call, int first, unsigned long second,
  1199. unsigned long third, void __user * ptr, long fifth);
  1200. int compat_ksys_ipc(u32 call, int first, int second,
  1201. u32 third, u32 ptr, u32 fifth);
  1202. /*
  1203. * The following kernel syscall equivalents are just wrappers to fs-internal
  1204. * functions. Therefore, provide stubs to be inlined at the callsites.
  1205. */
  1206. extern int do_fchownat(int dfd, const char __user *filename, uid_t user,
  1207. gid_t group, int flag);
  1208. static inline long ksys_chown(const char __user *filename, uid_t user,
  1209. gid_t group)
  1210. {
  1211. return do_fchownat(AT_FDCWD, filename, user, group, 0);
  1212. }
  1213. static inline long ksys_lchown(const char __user *filename, uid_t user,
  1214. gid_t group)
  1215. {
  1216. return do_fchownat(AT_FDCWD, filename, user, group,
  1217. AT_SYMLINK_NOFOLLOW);
  1218. }
  1219. extern long do_sys_ftruncate(unsigned int fd, loff_t length, int small);
  1220. static inline long ksys_ftruncate(unsigned int fd, loff_t length)
  1221. {
  1222. return do_sys_ftruncate(fd, length, 1);
  1223. }
  1224. extern long do_sys_truncate(const char __user *pathname, loff_t length);
  1225. static inline long ksys_truncate(const char __user *pathname, loff_t length)
  1226. {
  1227. return do_sys_truncate(pathname, length);
  1228. }
  1229. static inline unsigned int ksys_personality(unsigned int personality)
  1230. {
  1231. unsigned int old = current->personality;
  1232. if (personality != 0xffffffff)
  1233. set_personality(personality);
  1234. return old;
  1235. }
  1236. /* for __ARCH_WANT_SYS_IPC */
  1237. long ksys_semtimedop(int semid, struct sembuf __user *tsops,
  1238. unsigned int nsops,
  1239. const struct __kernel_timespec __user *timeout);
  1240. long ksys_semget(key_t key, int nsems, int semflg);
  1241. long ksys_old_semctl(int semid, int semnum, int cmd, unsigned long arg);
  1242. long ksys_msgget(key_t key, int msgflg);
  1243. long ksys_old_msgctl(int msqid, int cmd, struct msqid_ds __user *buf);
  1244. long ksys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz,
  1245. long msgtyp, int msgflg);
  1246. long ksys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz,
  1247. int msgflg);
  1248. long ksys_shmget(key_t key, size_t size, int shmflg);
  1249. long ksys_shmdt(char __user *shmaddr);
  1250. long ksys_old_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
  1251. long compat_ksys_semtimedop(int semid, struct sembuf __user *tsems,
  1252. unsigned int nsops,
  1253. const struct old_timespec32 __user *timeout);
  1254. long __do_semtimedop(int semid, struct sembuf *tsems, unsigned int nsops,
  1255. const struct timespec64 *timeout,
  1256. struct ipc_namespace *ns);
  1257. int __sys_getsockopt(int fd, int level, int optname, char __user *optval,
  1258. int __user *optlen);
  1259. int __sys_setsockopt(int fd, int level, int optname, char __user *optval,
  1260. int optlen);
  1261. #endif