hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/linux/syscalls.h
....@@ -1,11 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * syscalls.h - Linux syscall interfaces (non-arch-specific)
34 *
45 * Copyright (c) 2004 Randy Dunlap
56 * Copyright (c) 2004 Open Source Development Labs
6
- *
7
- * This file is released under the GPLv2.
8
- * See the file COPYING for more details.
97 */
108
119 #ifndef _LINUX_SYSCALLS_H
....@@ -18,8 +16,7 @@
1816 struct iocb;
1917 struct io_event;
2018 struct iovec;
21
-struct itimerspec;
22
-struct itimerval;
19
+struct __kernel_old_itimerval;
2320 struct kexec_segment;
2421 struct linux_dirent;
2522 struct linux_dirent64;
....@@ -50,17 +47,16 @@
5047 struct statfs;
5148 struct statfs64;
5249 struct statx;
53
-struct __sysctl_args;
5450 struct sysinfo;
5551 struct timespec;
56
-struct timeval;
57
-struct timex;
52
+struct __kernel_old_timeval;
53
+struct __kernel_timex;
5854 struct timezone;
5955 struct tms;
6056 struct utimbuf;
6157 struct mq_attr;
6258 struct compat_stat;
63
-struct compat_timeval;
59
+struct old_timeval32;
6460 struct robust_list_head;
6561 struct getcpu_cache;
6662 struct old_linux_dirent;
....@@ -69,6 +65,9 @@
6965 struct sigaltstack;
7066 struct rseq;
7167 union bpf_attr;
68
+struct io_uring_params;
69
+struct clone_args;
70
+struct open_how;
7271
7372 #include <linux/types.h>
7473 #include <linux/aio_abi.h>
....@@ -145,7 +144,7 @@
145144 .flags = TRACE_EVENT_FL_CAP_ANY, \
146145 }; \
147146 static struct trace_event_call __used \
148
- __attribute__((section("_ftrace_events"))) \
147
+ __section("_ftrace_events") \
149148 *__event_enter_##sname = &event_enter_##sname;
150149
151150 #define SYSCALL_TRACE_EXIT_EVENT(sname) \
....@@ -161,7 +160,7 @@
161160 .flags = TRACE_EVENT_FL_CAP_ANY, \
162161 }; \
163162 static struct trace_event_call __used \
164
- __attribute__((section("_ftrace_events"))) \
163
+ __section("_ftrace_events") \
165164 *__event_exit_##sname = &event_exit_##sname;
166165
167166 #define SYSCALL_METADATA(sname, nb, ...) \
....@@ -185,7 +184,7 @@
185184 .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \
186185 }; \
187186 static struct syscall_metadata __used \
188
- __attribute__((section("__syscalls_metadata"))) \
187
+ __section("__syscalls_metadata") \
189188 *__p_syscall_meta_##sname = &__syscall_meta_##sname;
190189
191190 static inline int is_syscall_trace_event(struct trace_event_call *tp_event)
....@@ -252,6 +251,30 @@
252251 static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
253252 #endif /* __SYSCALL_DEFINEx */
254253
254
+/* For split 64-bit arguments on 32-bit architectures */
255
+#ifdef __LITTLE_ENDIAN
256
+#define SC_ARG64(name) u32, name##_lo, u32, name##_hi
257
+#else
258
+#define SC_ARG64(name) u32, name##_hi, u32, name##_lo
259
+#endif
260
+#define SC_VAL64(type, name) ((type) name##_hi << 32 | name##_lo)
261
+
262
+#ifdef CONFIG_COMPAT
263
+#define SYSCALL32_DEFINE1 COMPAT_SYSCALL_DEFINE1
264
+#define SYSCALL32_DEFINE2 COMPAT_SYSCALL_DEFINE2
265
+#define SYSCALL32_DEFINE3 COMPAT_SYSCALL_DEFINE3
266
+#define SYSCALL32_DEFINE4 COMPAT_SYSCALL_DEFINE4
267
+#define SYSCALL32_DEFINE5 COMPAT_SYSCALL_DEFINE5
268
+#define SYSCALL32_DEFINE6 COMPAT_SYSCALL_DEFINE6
269
+#else
270
+#define SYSCALL32_DEFINE1 SYSCALL_DEFINE1
271
+#define SYSCALL32_DEFINE2 SYSCALL_DEFINE2
272
+#define SYSCALL32_DEFINE3 SYSCALL_DEFINE3
273
+#define SYSCALL32_DEFINE4 SYSCALL_DEFINE4
274
+#define SYSCALL32_DEFINE5 SYSCALL_DEFINE5
275
+#define SYSCALL32_DEFINE6 SYSCALL_DEFINE6
276
+#endif
277
+
255278 /*
256279 * Called before coming back to user-mode. Returning to user-mode with an
257280 * address limit different than USER_DS can allow to overwrite kernel memory.
....@@ -263,9 +286,9 @@
263286 return;
264287 #endif
265288
266
- if (CHECK_DATA_CORRUPTION(!segment_eq(get_fs(), USER_DS),
289
+ if (CHECK_DATA_CORRUPTION(uaccess_kernel(),
267290 "Invalid address limit on user-mode return"))
268
- force_sig(SIGKILL, current);
291
+ force_sig(SIGKILL);
269292
270293 #ifdef TIF_FSCHECK
271294 clear_thread_flag(TIF_FSCHECK);
....@@ -296,13 +319,31 @@
296319 long min_nr,
297320 long nr,
298321 struct io_event __user *events,
299
- struct timespec __user *timeout);
322
+ struct __kernel_timespec __user *timeout);
323
+asmlinkage long sys_io_getevents_time32(__u32 ctx_id,
324
+ __s32 min_nr,
325
+ __s32 nr,
326
+ struct io_event __user *events,
327
+ struct old_timespec32 __user *timeout);
300328 asmlinkage long sys_io_pgetevents(aio_context_t ctx_id,
301329 long min_nr,
302330 long nr,
303331 struct io_event __user *events,
304
- struct timespec __user *timeout,
332
+ struct __kernel_timespec __user *timeout,
305333 const struct __aio_sigset *sig);
334
+asmlinkage long sys_io_pgetevents_time32(aio_context_t ctx_id,
335
+ long min_nr,
336
+ long nr,
337
+ struct io_event __user *events,
338
+ struct old_timespec32 __user *timeout,
339
+ const struct __aio_sigset *sig);
340
+asmlinkage long sys_io_uring_setup(u32 entries,
341
+ struct io_uring_params __user *p);
342
+asmlinkage long sys_io_uring_enter(unsigned int fd, u32 to_submit,
343
+ u32 min_complete, u32 flags,
344
+ const void __user *argp, size_t argsz);
345
+asmlinkage long sys_io_uring_register(unsigned int fd, unsigned int op,
346
+ void __user *arg, unsigned int nr_args);
306347
307348 /* fs/xattr.c */
308349 asmlinkage long sys_setxattr(const char __user *path, const char __user *name,
....@@ -410,6 +451,8 @@
410451 #endif
411452 asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
412453 asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode);
454
+asmlinkage long sys_faccessat2(int dfd, const char __user *filename, int mode,
455
+ int flags);
413456 asmlinkage long sys_chdir(const char __user *filename);
414457 asmlinkage long sys_fchdir(unsigned int fd);
415458 asmlinkage long sys_chroot(const char __user *filename);
....@@ -421,7 +464,11 @@
421464 asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group);
422465 asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
423466 umode_t mode);
467
+asmlinkage long sys_openat2(int dfd, const char __user *filename,
468
+ struct open_how *how, size_t size);
424469 asmlinkage long sys_close(unsigned int fd);
470
+asmlinkage long sys_close_range(unsigned int fd, unsigned int max_fd,
471
+ unsigned int flags);
425472 asmlinkage long sys_vhangup(void);
426473
427474 /* fs/pipe.c */
....@@ -466,10 +513,16 @@
466513
467514 /* fs/select.c */
468515 asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *,
469
- fd_set __user *, struct timespec __user *,
516
+ fd_set __user *, struct __kernel_timespec __user *,
517
+ void __user *);
518
+asmlinkage long sys_pselect6_time32(int, fd_set __user *, fd_set __user *,
519
+ fd_set __user *, struct old_timespec32 __user *,
470520 void __user *);
471521 asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int,
472
- struct timespec __user *, const sigset_t __user *,
522
+ struct __kernel_timespec __user *, const sigset_t __user *,
523
+ size_t);
524
+asmlinkage long sys_ppoll_time32(struct pollfd __user *, unsigned int,
525
+ struct old_timespec32 __user *, const sigset_t __user *,
473526 size_t);
474527
475528 /* fs/signalfd.c */
....@@ -510,10 +563,19 @@
510563 const struct __kernel_itimerspec __user *utmr,
511564 struct __kernel_itimerspec __user *otmr);
512565 asmlinkage long sys_timerfd_gettime(int ufd, struct __kernel_itimerspec __user *otmr);
566
+asmlinkage long sys_timerfd_gettime32(int ufd,
567
+ struct old_itimerspec32 __user *otmr);
568
+asmlinkage long sys_timerfd_settime32(int ufd, int flags,
569
+ const struct old_itimerspec32 __user *utmr,
570
+ struct old_itimerspec32 __user *otmr);
513571
514572 /* fs/utimes.c */
515573 asmlinkage long sys_utimensat(int dfd, const char __user *filename,
516
- struct timespec __user *utimes, int flags);
574
+ struct __kernel_timespec __user *utimes,
575
+ int flags);
576
+asmlinkage long sys_utimensat_time32(unsigned int dfd,
577
+ const char __user *filename,
578
+ struct old_timespec32 __user *t, int flags);
517579
518580 /* kernel/acct.c */
519581 asmlinkage long sys_acct(const char __user *name);
....@@ -540,7 +602,10 @@
540602
541603 /* kernel/futex.c */
542604 asmlinkage long sys_futex(u32 __user *uaddr, int op, u32 val,
543
- struct timespec __user *utime, u32 __user *uaddr2,
605
+ struct __kernel_timespec __user *utime, u32 __user *uaddr2,
606
+ u32 val3);
607
+asmlinkage long sys_futex_time32(u32 __user *uaddr, int op, u32 val,
608
+ struct old_timespec32 __user *utime, u32 __user *uaddr2,
544609 u32 val3);
545610 asmlinkage long sys_get_robust_list(int pid,
546611 struct robust_list_head __user * __user *head_ptr,
....@@ -551,12 +616,14 @@
551616 /* kernel/hrtimer.c */
552617 asmlinkage long sys_nanosleep(struct __kernel_timespec __user *rqtp,
553618 struct __kernel_timespec __user *rmtp);
619
+asmlinkage long sys_nanosleep_time32(struct old_timespec32 __user *rqtp,
620
+ struct old_timespec32 __user *rmtp);
554621
555622 /* kernel/itimer.c */
556
-asmlinkage long sys_getitimer(int which, struct itimerval __user *value);
623
+asmlinkage long sys_getitimer(int which, struct __kernel_old_itimerval __user *value);
557624 asmlinkage long sys_setitimer(int which,
558
- struct itimerval __user *value,
559
- struct itimerval __user *ovalue);
625
+ struct __kernel_old_itimerval __user *value,
626
+ struct __kernel_old_itimerval __user *ovalue);
560627
561628 /* kernel/kexec.c */
562629 asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
....@@ -578,7 +645,7 @@
578645 asmlinkage long sys_timer_getoverrun(timer_t timer_id);
579646 asmlinkage long sys_timer_settime(timer_t timer_id, int flags,
580647 const struct __kernel_itimerspec __user *new_setting,
581
- struct itimerspec __user *old_setting);
648
+ struct __kernel_itimerspec __user *old_setting);
582649 asmlinkage long sys_timer_delete(timer_t timer_id);
583650 asmlinkage long sys_clock_settime(clockid_t which_clock,
584651 const struct __kernel_timespec __user *tp);
....@@ -589,6 +656,20 @@
589656 asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags,
590657 const struct __kernel_timespec __user *rqtp,
591658 struct __kernel_timespec __user *rmtp);
659
+asmlinkage long sys_timer_gettime32(timer_t timer_id,
660
+ struct old_itimerspec32 __user *setting);
661
+asmlinkage long sys_timer_settime32(timer_t timer_id, int flags,
662
+ struct old_itimerspec32 __user *new,
663
+ struct old_itimerspec32 __user *old);
664
+asmlinkage long sys_clock_settime32(clockid_t which_clock,
665
+ struct old_timespec32 __user *tp);
666
+asmlinkage long sys_clock_gettime32(clockid_t which_clock,
667
+ struct old_timespec32 __user *tp);
668
+asmlinkage long sys_clock_getres_time32(clockid_t which_clock,
669
+ struct old_timespec32 __user *tp);
670
+asmlinkage long sys_clock_nanosleep_time32(clockid_t which_clock, int flags,
671
+ struct old_timespec32 __user *rqtp,
672
+ struct old_timespec32 __user *rmtp);
592673
593674 /* kernel/printk.c */
594675 asmlinkage long sys_syslog(int type, char __user *buf, int len);
....@@ -613,7 +694,9 @@
613694 asmlinkage long sys_sched_get_priority_max(int policy);
614695 asmlinkage long sys_sched_get_priority_min(int policy);
615696 asmlinkage long sys_sched_rr_get_interval(pid_t pid,
616
- struct timespec __user *interval);
697
+ struct __kernel_timespec __user *interval);
698
+asmlinkage long sys_sched_rr_get_interval_time32(pid_t pid,
699
+ struct old_timespec32 __user *interval);
617700
618701 /* kernel/signal.c */
619702 asmlinkage long sys_restart_syscall(void);
....@@ -634,7 +717,11 @@
634717 asmlinkage long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize);
635718 asmlinkage long sys_rt_sigtimedwait(const sigset_t __user *uthese,
636719 siginfo_t __user *uinfo,
637
- const struct timespec __user *uts,
720
+ const struct __kernel_timespec __user *uts,
721
+ size_t sigsetsize);
722
+asmlinkage long sys_rt_sigtimedwait_time32(const sigset_t __user *uthese,
723
+ siginfo_t __user *uinfo,
724
+ const struct old_timespec32 __user *uts,
638725 size_t sigsetsize);
639726 asmlinkage long sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo);
640727
....@@ -674,11 +761,12 @@
674761 asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache);
675762
676763 /* kernel/time.c */
677
-asmlinkage long sys_gettimeofday(struct timeval __user *tv,
764
+asmlinkage long sys_gettimeofday(struct __kernel_old_timeval __user *tv,
678765 struct timezone __user *tz);
679
-asmlinkage long sys_settimeofday(struct timeval __user *tv,
766
+asmlinkage long sys_settimeofday(struct __kernel_old_timeval __user *tv,
680767 struct timezone __user *tz);
681
-asmlinkage long sys_adjtimex(struct timex __user *txc_p);
768
+asmlinkage long sys_adjtimex(struct __kernel_timex __user *txc_p);
769
+asmlinkage long sys_adjtimex_time32(struct old_timex32 __user *txc_p);
682770
683771 /* kernel/timer.c */
684772 asmlinkage long sys_getpid(void);
....@@ -697,9 +785,18 @@
697785 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);
698786 asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification);
699787 asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat);
788
+asmlinkage long sys_mq_timedreceive_time32(mqd_t mqdes,
789
+ char __user *u_msg_ptr,
790
+ unsigned int msg_len, unsigned int __user *u_msg_prio,
791
+ const struct old_timespec32 __user *u_abs_timeout);
792
+asmlinkage long sys_mq_timedsend_time32(mqd_t mqdes,
793
+ const char __user *u_msg_ptr,
794
+ unsigned int msg_len, unsigned int msg_prio,
795
+ const struct old_timespec32 __user *u_abs_timeout);
700796
701797 /* ipc/msg.c */
702798 asmlinkage long sys_msgget(key_t key, int msgflg);
799
+asmlinkage long sys_old_msgctl(int msqid, int cmd, struct msqid_ds __user *buf);
703800 asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf);
704801 asmlinkage long sys_msgrcv(int msqid, struct msgbuf __user *msgp,
705802 size_t msgsz, long msgtyp, int msgflg);
....@@ -709,14 +806,19 @@
709806 /* ipc/sem.c */
710807 asmlinkage long sys_semget(key_t key, int nsems, int semflg);
711808 asmlinkage long sys_semctl(int semid, int semnum, int cmd, unsigned long arg);
809
+asmlinkage long sys_old_semctl(int semid, int semnum, int cmd, unsigned long arg);
712810 asmlinkage long sys_semtimedop(int semid, struct sembuf __user *sops,
713811 unsigned nsops,
714812 const struct __kernel_timespec __user *timeout);
813
+asmlinkage long sys_semtimedop_time32(int semid, struct sembuf __user *sops,
814
+ unsigned nsops,
815
+ const struct old_timespec32 __user *timeout);
715816 asmlinkage long sys_semop(int semid, struct sembuf __user *sops,
716817 unsigned nsops);
717818
718819 /* ipc/shm.c */
719820 asmlinkage long sys_shmget(key_t key, size_t size, int flag);
821
+asmlinkage long sys_old_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
720822 asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
721823 asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg);
722824 asmlinkage long sys_shmdt(char __user *shmaddr);
....@@ -778,6 +880,9 @@
778880 int __user *, unsigned long);
779881 #endif
780882 #endif
883
+
884
+asmlinkage long sys_clone3(struct clone_args __user *uargs, size_t size);
885
+
781886 asmlinkage long sys_execve(const char __user *filename,
782887 const char __user *const __user *argv,
783888 const char __user *const __user *envp);
....@@ -798,6 +903,9 @@
798903 asmlinkage long sys_mincore(unsigned long start, size_t len,
799904 unsigned char __user * vec);
800905 asmlinkage long sys_madvise(unsigned long start, size_t len, int behavior);
906
+asmlinkage long sys_process_madvise(int pidfd, const struct iovec __user *vec,
907
+ size_t vlen, int behavior, unsigned int flags);
908
+asmlinkage long sys_process_mrelease(int pidfd, unsigned int flags);
801909 asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
802910 unsigned long prot, unsigned long pgoff,
803911 unsigned long flags);
....@@ -829,7 +937,10 @@
829937 asmlinkage long sys_accept4(int, struct sockaddr __user *, int __user *, int);
830938 asmlinkage long sys_recvmmsg(int fd, struct mmsghdr __user *msg,
831939 unsigned int vlen, unsigned flags,
832
- struct timespec __user *timeout);
940
+ struct __kernel_timespec __user *timeout);
941
+asmlinkage long sys_recvmmsg_time32(int fd, struct mmsghdr __user *msg,
942
+ unsigned int vlen, unsigned flags,
943
+ struct old_timespec32 __user *timeout);
833944
834945 asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr,
835946 int options, struct rusage __user *ru);
....@@ -847,7 +958,9 @@
847958 struct file_handle __user *handle,
848959 int flags);
849960 asmlinkage long sys_clock_adjtime(clockid_t which_clock,
850
- struct timex __user *tx);
961
+ struct __kernel_timex __user *tx);
962
+asmlinkage long sys_clock_adjtime32(clockid_t which_clock,
963
+ struct old_timex32 __user *tx);
851964 asmlinkage long sys_syncfs(int fd);
852965 asmlinkage long sys_setns(int fd, int nstype);
853966 asmlinkage long sys_pidfd_open(pid_t pid, unsigned int flags);
....@@ -879,7 +992,7 @@
879992 int newdfd, const char __user *newname,
880993 unsigned int flags);
881994 asmlinkage long sys_seccomp(unsigned int op, unsigned int flags,
882
- const char __user *uargs);
995
+ void __user *uargs);
883996 asmlinkage long sys_getrandom(char __user *buf, size_t count,
884997 unsigned int flags);
885998 asmlinkage long sys_memfd_create(const char __user *uname_ptr, unsigned int flags);
....@@ -888,7 +1001,7 @@
8881001 const char __user *const __user *argv,
8891002 const char __user *const __user *envp, int flags);
8901003 asmlinkage long sys_userfaultfd(int flags);
891
-asmlinkage long sys_membarrier(int cmd, int flags);
1004
+asmlinkage long sys_membarrier(int cmd, unsigned int flags, int cpu_id);
8921005 asmlinkage long sys_mlock2(unsigned long start, size_t len, int flags);
8931006 asmlinkage long sys_copy_file_range(int fd_in, loff_t __user *off_in,
8941007 int fd_out, loff_t __user *off_out,
....@@ -907,9 +1020,19 @@
9071020 unsigned mask, struct statx __user *buffer);
9081021 asmlinkage long sys_rseq(struct rseq __user *rseq, uint32_t rseq_len,
9091022 int flags, uint32_t sig);
1023
+asmlinkage long sys_open_tree(int dfd, const char __user *path, unsigned flags);
1024
+asmlinkage long sys_move_mount(int from_dfd, const char __user *from_path,
1025
+ int to_dfd, const char __user *to_path,
1026
+ unsigned int ms_flags);
1027
+asmlinkage long sys_fsopen(const char __user *fs_name, unsigned int flags);
1028
+asmlinkage long sys_fsconfig(int fs_fd, unsigned int cmd, const char __user *key,
1029
+ const void __user *value, int aux);
1030
+asmlinkage long sys_fsmount(int fs_fd, unsigned int flags, unsigned int ms_flags);
1031
+asmlinkage long sys_fspick(int dfd, const char __user *path, unsigned int flags);
9101032 asmlinkage long sys_pidfd_send_signal(int pidfd, int sig,
9111033 siginfo_t __user *info,
9121034 unsigned int flags);
1035
+asmlinkage long sys_pidfd_getfd(int pidfd, int fd, unsigned int flags);
9131036
9141037 /*
9151038 * Architecture-specific system calls
....@@ -958,8 +1081,6 @@
9581081 asmlinkage long sys_rename(const char __user *oldname,
9591082 const char __user *newname);
9601083 asmlinkage long sys_symlink(const char __user *old, const char __user *new);
961
-asmlinkage long sys_utimes(char __user *filename,
962
- struct timeval __user *utimes);
9631084 #if defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_COMPAT_STAT64)
9641085 asmlinkage long sys_stat64(const char __user *filename,
9651086 struct stat64 __user *statbuf);
....@@ -988,17 +1109,29 @@
9881109 asmlinkage long sys_alarm(unsigned int seconds);
9891110 asmlinkage long sys_getpgrp(void);
9901111 asmlinkage long sys_pause(void);
991
-asmlinkage long sys_time(time_t __user *tloc);
1112
+asmlinkage long sys_time(__kernel_old_time_t __user *tloc);
1113
+asmlinkage long sys_time32(old_time32_t __user *tloc);
1114
+#ifdef __ARCH_WANT_SYS_UTIME
9921115 asmlinkage long sys_utime(char __user *filename,
9931116 struct utimbuf __user *times);
1117
+asmlinkage long sys_utimes(char __user *filename,
1118
+ struct __kernel_old_timeval __user *utimes);
1119
+asmlinkage long sys_futimesat(int dfd, const char __user *filename,
1120
+ struct __kernel_old_timeval __user *utimes);
1121
+#endif
1122
+asmlinkage long sys_futimesat_time32(unsigned int dfd,
1123
+ const char __user *filename,
1124
+ struct old_timeval32 __user *t);
1125
+asmlinkage long sys_utime32(const char __user *filename,
1126
+ struct old_utimbuf32 __user *t);
1127
+asmlinkage long sys_utimes_time32(const char __user *filename,
1128
+ struct old_timeval32 __user *t);
9941129 asmlinkage long sys_creat(const char __user *pathname, umode_t mode);
9951130 asmlinkage long sys_getdents(unsigned int fd,
9961131 struct linux_dirent __user *dirent,
9971132 unsigned int count);
998
-asmlinkage long sys_futimesat(int dfd, const char __user *filename,
999
- struct timeval __user *utimes);
10001133 asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
1001
- fd_set __user *exp, struct timeval __user *tvp);
1134
+ fd_set __user *exp, struct __kernel_old_timeval __user *tvp);
10021135 asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,
10031136 int timeout);
10041137 asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events,
....@@ -1010,13 +1143,13 @@
10101143 asmlinkage long sys_bdflush(int func, long data);
10111144 asmlinkage long sys_oldumount(char __user *name);
10121145 asmlinkage long sys_uselib(const char __user *library);
1013
-asmlinkage long sys_sysctl(struct __sysctl_args __user *args);
10141146 asmlinkage long sys_sysfs(int option,
10151147 unsigned long arg1, unsigned long arg2);
10161148 asmlinkage long sys_fork(void);
10171149
10181150 /* obsolete: kernel/time/time.c */
1019
-asmlinkage long sys_stime(time_t __user *tptr);
1151
+asmlinkage long sys_stime(__kernel_old_time_t __user *tptr);
1152
+asmlinkage long sys_stime32(old_time32_t __user *tptr);
10201153
10211154 /* obsolete: kernel/signal.c */
10221155 asmlinkage long sys_sigpending(old_sigset_t __user *uset);
....@@ -1129,20 +1262,8 @@
11291262 * Instead, use one of the functions which work equivalently, such as
11301263 * the ksys_xyzyyz() functions prototyped below.
11311264 */
1132
-
1133
-int ksys_mount(char __user *dev_name, char __user *dir_name, char __user *type,
1134
- unsigned long flags, void __user *data);
1135
-int ksys_umount(char __user *name, int flags);
1136
-int ksys_dup(unsigned int fildes);
1137
-int ksys_chroot(const char __user *filename);
11381265 ssize_t ksys_write(unsigned int fd, const char __user *buf, size_t count);
1139
-int ksys_chdir(const char __user *filename);
1140
-int ksys_fchmod(unsigned int fd, umode_t mode);
11411266 int ksys_fchown(unsigned int fd, uid_t user, gid_t group);
1142
-int ksys_getdents64(unsigned int fd, struct linux_dirent64 __user *dirent,
1143
- unsigned int count);
1144
-int ksys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
1145
-off_t ksys_lseek(unsigned int fd, off_t offset, unsigned int whence);
11461267 ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count);
11471268 void ksys_sync(void);
11481269 int ksys_unshare(unsigned long unshare_flags);
....@@ -1167,73 +1288,15 @@
11671288 unsigned long prot, unsigned long flags,
11681289 unsigned long fd, unsigned long pgoff);
11691290 ssize_t ksys_readahead(int fd, loff_t offset, size_t count);
1291
+int ksys_ipc(unsigned int call, int first, unsigned long second,
1292
+ unsigned long third, void __user * ptr, long fifth);
1293
+int compat_ksys_ipc(u32 call, int first, int second,
1294
+ u32 third, u32 ptr, u32 fifth);
11701295
11711296 /*
11721297 * The following kernel syscall equivalents are just wrappers to fs-internal
11731298 * functions. Therefore, provide stubs to be inlined at the callsites.
11741299 */
1175
-extern long do_unlinkat(int dfd, struct filename *name);
1176
-
1177
-static inline long ksys_unlink(const char __user *pathname)
1178
-{
1179
- return do_unlinkat(AT_FDCWD, getname(pathname));
1180
-}
1181
-
1182
-extern long do_rmdir(int dfd, const char __user *pathname);
1183
-
1184
-static inline long ksys_rmdir(const char __user *pathname)
1185
-{
1186
- return do_rmdir(AT_FDCWD, pathname);
1187
-}
1188
-
1189
-extern long do_mkdirat(int dfd, const char __user *pathname, umode_t mode);
1190
-
1191
-static inline long ksys_mkdir(const char __user *pathname, umode_t mode)
1192
-{
1193
- return do_mkdirat(AT_FDCWD, pathname, mode);
1194
-}
1195
-
1196
-extern long do_symlinkat(const char __user *oldname, int newdfd,
1197
- const char __user *newname);
1198
-
1199
-static inline long ksys_symlink(const char __user *oldname,
1200
- const char __user *newname)
1201
-{
1202
- return do_symlinkat(oldname, AT_FDCWD, newname);
1203
-}
1204
-
1205
-extern long do_mknodat(int dfd, const char __user *filename, umode_t mode,
1206
- unsigned int dev);
1207
-
1208
-static inline long ksys_mknod(const char __user *filename, umode_t mode,
1209
- unsigned int dev)
1210
-{
1211
- return do_mknodat(AT_FDCWD, filename, mode, dev);
1212
-}
1213
-
1214
-extern int do_linkat(int olddfd, const char __user *oldname, int newdfd,
1215
- const char __user *newname, int flags);
1216
-
1217
-static inline long ksys_link(const char __user *oldname,
1218
- const char __user *newname)
1219
-{
1220
- return do_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0);
1221
-}
1222
-
1223
-extern int do_fchmodat(int dfd, const char __user *filename, umode_t mode);
1224
-
1225
-static inline int ksys_chmod(const char __user *filename, umode_t mode)
1226
-{
1227
- return do_fchmodat(AT_FDCWD, filename, mode);
1228
-}
1229
-
1230
-extern long do_faccessat(int dfd, const char __user *filename, int mode);
1231
-
1232
-static inline long ksys_access(const char __user *filename, int mode)
1233
-{
1234
- return do_faccessat(AT_FDCWD, filename, mode);
1235
-}
1236
-
12371300 extern int do_fchownat(int dfd, const char __user *filename, uid_t user,
12381301 gid_t group, int flag);
12391302
....@@ -1252,7 +1315,7 @@
12521315
12531316 extern long do_sys_ftruncate(unsigned int fd, loff_t length, int small);
12541317
1255
-static inline long ksys_ftruncate(unsigned int fd, unsigned long length)
1318
+static inline long ksys_ftruncate(unsigned int fd, loff_t length)
12561319 {
12571320 return do_sys_ftruncate(fd, length, 1);
12581321 }
....@@ -1267,17 +1330,6 @@
12671330 static inline int ksys_close(unsigned int fd)
12681331 {
12691332 return __close_fd(current->files, fd);
1270
-}
1271
-
1272
-extern long do_sys_open(int dfd, const char __user *filename, int flags,
1273
- umode_t mode);
1274
-
1275
-static inline long ksys_open(const char __user *filename, int flags,
1276
- umode_t mode)
1277
-{
1278
- if (force_o_largefile())
1279
- flags |= O_LARGEFILE;
1280
- return do_sys_open(AT_FDCWD, filename, flags, mode);
12811333 }
12821334
12831335 extern long do_sys_truncate(const char __user *pathname, loff_t length);
....@@ -1297,4 +1349,27 @@
12971349 return old;
12981350 }
12991351
1352
+/* for __ARCH_WANT_SYS_IPC */
1353
+long ksys_semtimedop(int semid, struct sembuf __user *tsops,
1354
+ unsigned int nsops,
1355
+ const struct __kernel_timespec __user *timeout);
1356
+long ksys_semget(key_t key, int nsems, int semflg);
1357
+long ksys_old_semctl(int semid, int semnum, int cmd, unsigned long arg);
1358
+long ksys_msgget(key_t key, int msgflg);
1359
+long ksys_old_msgctl(int msqid, int cmd, struct msqid_ds __user *buf);
1360
+long ksys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz,
1361
+ long msgtyp, int msgflg);
1362
+long ksys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz,
1363
+ int msgflg);
1364
+long ksys_shmget(key_t key, size_t size, int shmflg);
1365
+long ksys_shmdt(char __user *shmaddr);
1366
+long ksys_old_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
1367
+long compat_ksys_semtimedop(int semid, struct sembuf __user *tsems,
1368
+ unsigned int nsops,
1369
+ const struct old_timespec32 __user *timeout);
1370
+
1371
+int __sys_getsockopt(int fd, int level, int optname, char __user *optval,
1372
+ int __user *optlen);
1373
+int __sys_setsockopt(int fd, int level, int optname, char __user *optval,
1374
+ int optlen);
13001375 #endif