Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] rename the provided execve functions to kernel_execve

Some architectures provide an execve function that does not set errno, but
instead returns the result code directly. Rename these to kernel_execve to
get the right semantics there. Moreover, there is no reasone for any of these
architectures to still provide __KERNEL_SYSCALLS__ or _syscallN macros, so
remove these right away.

[akpm@osdl.org: build fix]
[bunk@stusta.de: build fix]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Andi Kleen <ak@muc.de>
Acked-by: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Ian Molton <spyro@f2s.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Hirokazu Takata <takata.hirokazu@renesas.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Cc: Richard Curnow <rc@rc0.org.uk>
Cc: William Lee Irwin III <wli@holomorphy.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp>
Cc: Chris Zankel <chris@zankel.net>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Arnd Bergmann and committed by
Linus Torvalds
3db03b4a 67608567

+49 -423
+1 -2
arch/alpha/kernel/alpha_ksyms.c
··· 36 36 #include <asm/cacheflush.h> 37 37 #include <asm/vga.h> 38 38 39 - #define __KERNEL_SYSCALLS__ 40 39 #include <asm/unistd.h> 41 40 42 41 extern struct hwrpb_struct *hwrpb; ··· 115 116 EXPORT_SYMBOL(sys_exit); 116 117 EXPORT_SYMBOL(sys_write); 117 118 EXPORT_SYMBOL(sys_lseek); 118 - EXPORT_SYMBOL(execve); 119 + EXPORT_SYMBOL(kernel_execve); 119 120 EXPORT_SYMBOL(sys_setsid); 120 121 EXPORT_SYMBOL(sys_wait4); 121 122
+5 -5
arch/alpha/kernel/entry.S
··· 655 655 .end kernel_thread 656 656 657 657 /* 658 - * execve(path, argv, envp) 658 + * kernel_execve(path, argv, envp) 659 659 */ 660 660 .align 4 661 - .globl execve 662 - .ent execve 663 - execve: 661 + .globl kernel_execve 662 + .ent kernel_execve 663 + kernel_execve: 664 664 /* We can be called from a module. */ 665 665 ldgp $gp, 0($27) 666 666 lda $sp, -(32+SIZEOF_PT_REGS+8)($sp) ··· 704 704 705 705 1: lda $sp, 32+SIZEOF_PT_REGS+8($sp) 706 706 ret 707 - .end execve 707 + .end kernel_execve 708 708 709 709 710 710 /*
+2 -2
arch/arm/kernel/sys_arm.c
··· 279 279 return error; 280 280 } 281 281 282 - long execve(const char *filename, char **argv, char **envp) 282 + int kernel_execve(const char *filename, char *const argv[], char *const envp[]) 283 283 { 284 284 struct pt_regs regs; 285 285 int ret; ··· 317 317 out: 318 318 return ret; 319 319 } 320 - EXPORT_SYMBOL(execve); 320 + EXPORT_SYMBOL(kernel_execve); 321 321 322 322 /* 323 323 * Since loff_t is a 64 bit type we avoid a lot of ABI hastle
+2 -2
arch/arm26/kernel/sys_arm.c
··· 283 283 } 284 284 285 285 /* FIXME - see if this is correct for arm26 */ 286 - long execve(const char *filename, char **argv, char **envp) 286 + int kernel_execve(const char *filename, char *const argv[], char *const envp[]) 287 287 { 288 288 struct pt_regs regs; 289 289 int ret; ··· 320 320 return ret; 321 321 } 322 322 323 - EXPORT_SYMBOL(execve); 323 + EXPORT_SYMBOL(kernel_execve);
+2 -2
arch/ia64/kernel/entry.S
··· 492 492 br.ret.sptk.many rp 493 493 END(prefetch_stack) 494 494 495 - GLOBAL_ENTRY(execve) 495 + GLOBAL_ENTRY(kernel_execve) 496 496 mov r15=__NR_execve // put syscall number in place 497 497 break __BREAK_SYSCALL 498 498 br.ret.sptk.many rp 499 - END(execve) 499 + END(kernel_execve) 500 500 501 501 GLOBAL_ENTRY(clone) 502 502 mov r15=__NR_clone // put syscall number in place
+8 -1
arch/parisc/kernel/process.c
··· 368 368 return error; 369 369 } 370 370 371 - unsigned long 371 + extern int __execve(const char *filename, char *const argv[], 372 + char *const envp[], struct task_struct *task); 373 + int kernel_execve(const char *filename, char *const argv[], char *const envp[]) 374 + { 375 + return __execve(filename, argv, envp, current); 376 + } 377 + 378 + unsigned long 372 379 get_wchan(struct task_struct *p) 373 380 { 374 381 struct unwind_frame_info info;
+1 -1
arch/powerpc/kernel/misc_32.S
··· 843 843 addi r1,r1,16 844 844 blr 845 845 846 - _GLOBAL(execve) 846 + _GLOBAL(kernel_execve) 847 847 li r0,__NR_execve 848 848 sc 849 849 bnslr
+1 -1
arch/powerpc/kernel/misc_64.S
··· 556 556 557 557 #endif /* CONFIG_ALTIVEC */ 558 558 559 - _GLOBAL(execve) 559 + _GLOBAL(kernel_execve) 560 560 li r0,__NR_execve 561 561 sc 562 562 bnslr
+13
arch/um/kernel/syscall.c
··· 164 164 spin_unlock(&syscall_lock); 165 165 return(ret); 166 166 } 167 + 168 + int kernel_execve(const char *filename, char *const argv[], char *const envp[]) 169 + { 170 + mm_segment_t fs; 171 + int ret; 172 + 173 + fs = get_fs(); 174 + set_fs(KERNEL_DS); 175 + ret = um_execve(filename, argv, envp); 176 + set_fs(fs); 177 + 178 + return ret; 179 + }
+2 -2
arch/x86_64/kernel/entry.S
··· 1023 1023 * do_sys_execve asm fallback arguments: 1024 1024 * rdi: name, rsi: argv, rdx: envp, fake frame on the stack 1025 1025 */ 1026 - ENTRY(execve) 1026 + ENTRY(kernel_execve) 1027 1027 CFI_STARTPROC 1028 1028 FAKE_STACK_FRAME $0 1029 1029 SAVE_ALL ··· 1036 1036 UNFAKE_STACK_FRAME 1037 1037 ret 1038 1038 CFI_ENDPROC 1039 - ENDPROC(execve) 1039 + ENDPROC(kernel_execve) 1040 1040 1041 1041 KPROBE_ENTRY(page_fault) 1042 1042 errorentry do_page_fault
+1 -4
drivers/sbus/char/bbc_envctrl.c
··· 4 4 * Copyright (C) 2001 David S. Miller (davem@redhat.com) 5 5 */ 6 6 7 - #define __KERNEL_SYSCALLS__ 8 - static int errno; 9 - 10 7 #include <linux/kernel.h> 11 8 #include <linux/kthread.h> 12 9 #include <linux/sched.h> ··· 197 200 printk(KERN_CRIT "kenvctrld: Shutting down the system now.\n"); 198 201 199 202 shutting_down = 1; 200 - if (execve("/sbin/shutdown", argv, envp) < 0) 203 + if (kernel_execve("/sbin/shutdown", argv, envp) < 0) 201 204 printk(KERN_CRIT "envctrl: shutdown execution failed\n"); 202 205 } 203 206
+3 -4
drivers/sbus/char/envctrl.c
··· 19 19 * Daniele Bellucci <bellucda@tiscali.it> 20 20 */ 21 21 22 - #define __KERNEL_SYSCALLS__ 23 - static int errno; 24 - 25 22 #include <linux/module.h> 26 23 #include <linux/sched.h> 27 24 #include <linux/kthread.h> ··· 973 976 "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL }; 974 977 char *argv[] = { 975 978 "/sbin/shutdown", "-h", "now", NULL }; 979 + int ret; 976 980 977 981 if (inprog != 0) 978 982 return; 979 983 980 984 inprog = 1; 981 985 printk(KERN_CRIT "kenvctrld: WARNING: Shutting down the system now.\n"); 982 - if (0 > execve("/sbin/shutdown", argv, envp)) { 986 + ret = kernel_execve("/sbin/shutdown", argv, envp); 987 + if (ret < 0) { 983 988 printk(KERN_CRIT "kenvctrld: WARNING: system shutdown failed!\n"); 984 989 inprog = 0; /* unlikely to succeed, but we could try again */ 985 990 }
-69
include/asm-alpha/unistd.h
··· 580 580 #define __ARCH_WANT_SYS_OLDUMOUNT 581 581 #define __ARCH_WANT_SYS_SIGPENDING 582 582 583 - #ifdef __KERNEL_SYSCALLS__ 584 - 585 - #include <linux/compiler.h> 586 - #include <linux/types.h> 587 - #include <linux/string.h> 588 - #include <linux/signal.h> 589 - #include <linux/syscalls.h> 590 - #include <asm/ptrace.h> 591 - 592 - static inline long open(const char * name, int mode, int flags) 593 - { 594 - return sys_open(name, mode, flags); 595 - } 596 - 597 - static inline long dup(int fd) 598 - { 599 - return sys_dup(fd); 600 - } 601 - 602 - static inline long close(int fd) 603 - { 604 - return sys_close(fd); 605 - } 606 - 607 - static inline off_t lseek(int fd, off_t off, int whence) 608 - { 609 - return sys_lseek(fd, off, whence); 610 - } 611 - 612 - static inline void _exit(int value) 613 - { 614 - sys_exit(value); 615 - } 616 - 617 - #define exit(x) _exit(x) 618 - 619 - static inline long write(int fd, const char * buf, size_t nr) 620 - { 621 - return sys_write(fd, buf, nr); 622 - } 623 - 624 - static inline long read(int fd, char * buf, size_t nr) 625 - { 626 - return sys_read(fd, buf, nr); 627 - } 628 - 629 - extern int execve(char *, char **, char **); 630 - 631 - static inline long setsid(void) 632 - { 633 - return sys_setsid(); 634 - } 635 - 636 - static inline pid_t waitpid(int pid, int * wait_stat, int flags) 637 - { 638 - return sys_wait4(pid, wait_stat, flags, NULL); 639 - } 640 - 641 - asmlinkage int sys_execve(char *ufilename, char **argv, char **envp, 642 - unsigned long a3, unsigned long a4, unsigned long a5, 643 - struct pt_regs regs); 644 - asmlinkage long sys_rt_sigaction(int sig, 645 - const struct sigaction __user *act, 646 - struct sigaction __user *oact, 647 - size_t sigsetsize, 648 - void *restorer); 649 - 650 - #endif /* __KERNEL_SYSCALLS__ */ 651 - 652 583 /* "Conditional" syscalls. What we want is 653 584 654 585 __attribute__((weak,alias("sys_ni_syscall")))
-24
include/asm-arm/unistd.h
··· 549 549 #define __ARCH_WANT_SYS_SOCKETCALL 550 550 #endif 551 551 552 - #ifdef __KERNEL_SYSCALLS__ 553 - 554 - #include <linux/compiler.h> 555 - #include <linux/types.h> 556 - #include <linux/syscalls.h> 557 - 558 - extern long execve(const char *file, char **argv, char **envp); 559 - 560 - struct pt_regs; 561 - asmlinkage int sys_execve(char *filenamei, char **argv, char **envp, 562 - struct pt_regs *regs); 563 - asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, 564 - struct pt_regs *regs); 565 - asmlinkage int sys_fork(struct pt_regs *regs); 566 - asmlinkage int sys_vfork(struct pt_regs *regs); 567 - asmlinkage int sys_pipe(unsigned long *fildes); 568 - struct sigaction; 569 - asmlinkage long sys_rt_sigaction(int sig, 570 - const struct sigaction __user *act, 571 - struct sigaction __user *oact, 572 - size_t sigsetsize); 573 - 574 - #endif /* __KERNEL_SYSCALLS__ */ 575 - 576 552 /* 577 553 * "Conditional" syscalls 578 554 *
-24
include/asm-arm26/unistd.h
··· 464 464 #define __ARCH_WANT_SYS_SIGPROCMASK 465 465 #define __ARCH_WANT_SYS_RT_SIGACTION 466 466 467 - #ifdef __KERNEL_SYSCALLS__ 468 - 469 - #include <linux/compiler.h> 470 - #include <linux/types.h> 471 - #include <linux/syscalls.h> 472 - 473 - extern long execve(const char *file, char **argv, char **envp); 474 - 475 - struct pt_regs; 476 - asmlinkage int sys_execve(char *filenamei, char **argv, char **envp, 477 - struct pt_regs *regs); 478 - asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, 479 - struct pt_regs *regs); 480 - asmlinkage int sys_fork(struct pt_regs *regs); 481 - asmlinkage int sys_vfork(struct pt_regs *regs); 482 - asmlinkage int sys_pipe(unsigned long *fildes); 483 - struct sigaction; 484 - asmlinkage long sys_rt_sigaction(int sig, 485 - const struct sigaction __user *act, 486 - struct sigaction __user *oact, 487 - size_t sigsetsize); 488 - 489 - #endif /* __KERNEL_SYSCALLS__ */ 490 - 491 467 /* 492 468 * "Conditional" syscalls 493 469 *
-72
include/asm-ia64/unistd.h
··· 319 319 320 320 extern long __ia64_syscall (long a0, long a1, long a2, long a3, long a4, long nr); 321 321 322 - #ifdef __KERNEL_SYSCALLS__ 323 - 324 - #include <linux/compiler.h> 325 - #include <linux/string.h> 326 - #include <linux/signal.h> 327 - #include <asm/ptrace.h> 328 - #include <linux/stringify.h> 329 - #include <linux/syscalls.h> 330 - 331 - static inline long 332 - open (const char * name, int mode, int flags) 333 - { 334 - return sys_open(name, mode, flags); 335 - } 336 - 337 - static inline long 338 - dup (int fd) 339 - { 340 - return sys_dup(fd); 341 - } 342 - 343 - static inline long 344 - close (int fd) 345 - { 346 - return sys_close(fd); 347 - } 348 - 349 - static inline off_t 350 - lseek (int fd, off_t off, int whence) 351 - { 352 - return sys_lseek(fd, off, whence); 353 - } 354 - 355 - static inline void 356 - _exit (int value) 357 - { 358 - sys_exit(value); 359 - } 360 - 361 - #define exit(x) _exit(x) 362 - 363 - static inline long 364 - write (int fd, const char * buf, size_t nr) 365 - { 366 - return sys_write(fd, buf, nr); 367 - } 368 - 369 - static inline long 370 - read (int fd, char * buf, size_t nr) 371 - { 372 - return sys_read(fd, buf, nr); 373 - } 374 - 375 - 376 - static inline long 377 - setsid (void) 378 - { 379 - return sys_setsid(); 380 - } 381 - 382 - static inline pid_t 383 - waitpid (int pid, int * wait_stat, int flags) 384 - { 385 - return sys_wait4(pid, wait_stat, flags, NULL); 386 - } 387 - 388 - 389 - extern int execve (const char *filename, char *const av[], char *const ep[]); 390 - extern pid_t clone (unsigned long flags, void *sp); 391 - 392 - #endif /* __KERNEL_SYSCALLS__ */ 393 - 394 322 asmlinkage unsigned long sys_mmap( 395 323 unsigned long addr, unsigned long len, 396 324 int prot, int flags,
-86
include/asm-parisc/unistd.h
··· 952 952 #define __ARCH_WANT_SYS_SIGPROCMASK 953 953 #define __ARCH_WANT_SYS_RT_SIGACTION 954 954 955 - /* mmap & mmap2 take 6 arguments */ 956 - #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \ 957 - type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \ 958 - { \ 959 - return K_INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6); \ 960 - } 961 - 962 - #ifdef __KERNEL_SYSCALLS__ 963 - 964 - #include <asm/current.h> 965 - #include <linux/compiler.h> 966 - #include <linux/types.h> 967 - #include <linux/syscalls.h> 968 - 969 - static inline pid_t setsid(void) 970 - { 971 - return sys_setsid(); 972 - } 973 - 974 - static inline int write(int fd, const char *buf, off_t count) 975 - { 976 - return sys_write(fd, buf, count); 977 - } 978 - 979 - static inline int read(int fd, char *buf, off_t count) 980 - { 981 - return sys_read(fd, buf, count); 982 - } 983 - 984 - static inline off_t lseek(int fd, off_t offset, int count) 985 - { 986 - return sys_lseek(fd, offset, count); 987 - } 988 - 989 - static inline int dup(int fd) 990 - { 991 - return sys_dup(fd); 992 - } 993 - 994 - static inline int execve(char *filename, char * argv [], 995 - char * envp[]) 996 - { 997 - extern int __execve(char *, char **, char **, struct task_struct *); 998 - return __execve(filename, argv, envp, current); 999 - } 1000 - 1001 - static inline int open(const char *file, int flag, int mode) 1002 - { 1003 - return sys_open(file, flag, mode); 1004 - } 1005 - 1006 - static inline int close(int fd) 1007 - { 1008 - return sys_close(fd); 1009 - } 1010 - 1011 - static inline void _exit(int exitcode) 1012 - { 1013 - sys_exit(exitcode); 1014 - } 1015 - 1016 - static inline pid_t waitpid(pid_t pid, int *wait_stat, int options) 1017 - { 1018 - return sys_wait4(pid, wait_stat, options, NULL); 1019 - } 1020 - 1021 - asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, 1022 - unsigned long prot, unsigned long flags, 1023 - unsigned long fd, unsigned long offset); 1024 - asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len, 1025 - unsigned long prot, unsigned long flags, 1026 - unsigned long fd, unsigned long pgoff); 1027 - struct pt_regs; 1028 - asmlinkage int sys_execve(struct pt_regs *regs); 1029 - int sys_clone(unsigned long clone_flags, unsigned long usp, 1030 - struct pt_regs *regs); 1031 - int sys_vfork(struct pt_regs *regs); 1032 - int sys_pipe(int *fildes); 1033 - struct sigaction; 1034 - asmlinkage long sys_rt_sigaction(int sig, 1035 - const struct sigaction __user *act, 1036 - struct sigaction __user *oact, 1037 - size_t sigsetsize); 1038 - 1039 - #endif /* __KERNEL_SYSCALLS__ */ 1040 - 1041 955 #endif /* __ASSEMBLY__ */ 1042 956 1043 957 #undef STR
-7
include/asm-powerpc/unistd.h
··· 479 479 #endif 480 480 481 481 /* 482 - * System call prototypes. 483 - */ 484 - #ifdef __KERNEL_SYSCALLS__ 485 - extern int execve(const char *file, char **argv, char **envp); 486 - #endif /* __KERNEL_SYSCALLS__ */ 487 - 488 - /* 489 482 * "Conditional" syscalls 490 483 * 491 484 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
-28
include/asm-um/unistd.h
··· 37 37 #define __ARCH_WANT_SYS_RT_SIGSUSPEND 38 38 #endif 39 39 40 - #ifdef __KERNEL_SYSCALLS__ 41 - 42 - #include <linux/compiler.h> 43 - #include <linux/types.h> 44 - 45 - static inline int execve(const char *filename, char *const argv[], 46 - char *const envp[]) 47 - { 48 - mm_segment_t fs; 49 - int ret; 50 - 51 - fs = get_fs(); 52 - set_fs(KERNEL_DS); 53 - ret = um_execve(filename, argv, envp); 54 - set_fs(fs); 55 - 56 - if (ret >= 0) 57 - return ret; 58 - 59 - errno = -(long)ret; 60 - return -1; 61 - } 62 - 63 - int sys_execve(char *file, char **argv, char **env); 64 - 65 - #endif /* __KERNEL_SYSCALLS__ */ 66 - 67 - #undef __KERNEL_SYSCALLS__ 68 40 #include "asm/arch/unistd.h" 69 41 70 42 #endif /* _UM_UNISTD_H_*/
+6 -87
include/asm-x86_64/unistd.h
··· 620 620 #define __NR_move_pages 279 621 621 __SYSCALL(__NR_move_pages, sys_move_pages) 622 622 623 - #ifdef __KERNEL__ 624 - 625 623 #define __NR_syscall_max __NR_move_pages 624 + 625 + #ifdef __KERNEL__ 626 626 #include <linux/err.h> 627 + #endif 627 628 628 629 #ifndef __NO_STUBS 629 630 ··· 663 662 #define __ARCH_WANT_SYS_RT_SIGSUSPEND 664 663 #define __ARCH_WANT_SYS_TIME 665 664 #define __ARCH_WANT_COMPAT_SYS_TIME 666 - 667 - #ifndef __KERNEL_SYSCALLS__ 668 665 669 666 #define __syscall "syscall" 670 667 ··· 745 746 __syscall_return(type,__res); \ 746 747 } 747 748 748 - #else /* __KERNEL_SYSCALLS__ */ 749 - 750 - #include <linux/syscalls.h> 751 - #include <asm/ptrace.h> 752 - 753 - /* 754 - * we need this inline - forking from kernel space will result 755 - * in NO COPY ON WRITE (!!!), until an execve is executed. This 756 - * is no problem, but for the stack. This is handled by not letting 757 - * main() use the stack at all after fork(). Thus, no function 758 - * calls - which means inline code for fork too, as otherwise we 759 - * would use the stack upon exit from 'fork()'. 760 - * 761 - * Actually only pause and fork are needed inline, so that there 762 - * won't be any messing with the stack from main(), but we define 763 - * some others too. 764 - */ 765 - #define __NR__exit __NR_exit 766 - 767 - static inline pid_t setsid(void) 768 - { 769 - return sys_setsid(); 770 - } 771 - 772 - static inline ssize_t write(unsigned int fd, char * buf, size_t count) 773 - { 774 - return sys_write(fd, buf, count); 775 - } 776 - 777 - static inline ssize_t read(unsigned int fd, char * buf, size_t count) 778 - { 779 - return sys_read(fd, buf, count); 780 - } 781 - 782 - static inline off_t lseek(unsigned int fd, off_t offset, unsigned int origin) 783 - { 784 - return sys_lseek(fd, offset, origin); 785 - } 786 - 787 - static inline long dup(unsigned int fd) 788 - { 789 - return sys_dup(fd); 790 - } 791 - 792 - /* implemented in asm in arch/x86_64/kernel/entry.S */ 793 - extern int execve(const char *, char * const *, char * const *); 794 - 795 - static inline long open(const char * filename, int flags, int mode) 796 - { 797 - return sys_open(filename, flags, mode); 798 - } 799 - 800 - static inline long close(unsigned int fd) 801 - { 802 - return sys_close(fd); 803 - } 804 - 805 - static inline pid_t waitpid(int pid, int * wait_stat, int flags) 806 - { 807 - return sys_wait4(pid, wait_stat, flags, NULL); 808 - } 809 - 810 - extern long sys_mmap(unsigned long addr, unsigned long len, 811 - unsigned long prot, unsigned long flags, 812 - unsigned long fd, unsigned long off); 813 - 814 - extern int sys_modify_ldt(int func, void *ptr, unsigned long bytecount); 815 - 816 - asmlinkage long sys_execve(char *name, char **argv, char **envp, 817 - struct pt_regs regs); 818 - asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp, 819 - void *parent_tid, void *child_tid, 820 - struct pt_regs regs); 821 - asmlinkage long sys_fork(struct pt_regs regs); 822 - asmlinkage long sys_vfork(struct pt_regs regs); 823 - asmlinkage long sys_pipe(int *fildes); 824 - 749 + #ifdef __KERNEL__ 825 750 #ifndef __ASSEMBLY__ 826 751 827 752 #include <linux/linkage.h> ··· 762 839 size_t sigsetsize); 763 840 764 841 #endif /* __ASSEMBLY__ */ 765 - 766 - #endif /* __KERNEL_SYSCALLS__ */ 842 + #endif /* __KERNEL__ */ 843 + #endif /* __NO_STUBS */ 767 844 768 845 /* 769 846 * "Conditional" syscalls ··· 772 849 * but it doesn't work on all toolchains, so we just do it by hand 773 850 */ 774 851 #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 775 - 776 - #endif /* __NO_STUBS */ 777 - 778 - #endif /* __KERNEL__ */ 779 852 780 853 #endif /* _ASM_X86_64_UNISTD_H_ */
+2
include/linux/syscalls.h
··· 599 599 size_t len); 600 600 asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); 601 601 602 + int kernel_execve(const char *filename, char *const argv[], char *const envp[]); 603 + 602 604 #endif