2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* This file contains various random system calls that
|
|
|
|
* have a non-standard calling sequence on the Linux/i386
|
|
|
|
* platform.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/errno.h>
|
|
|
|
#include <linux/sched.h>
|
|
|
|
#include <linux/mm.h>
|
2007-07-29 22:36:13 +00:00
|
|
|
#include <linux/fs.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <linux/smp.h>
|
|
|
|
#include <linux/sem.h>
|
|
|
|
#include <linux/msg.h>
|
|
|
|
#include <linux/shm.h>
|
|
|
|
#include <linux/stat.h>
|
|
|
|
#include <linux/syscalls.h>
|
|
|
|
#include <linux/mman.h>
|
|
|
|
#include <linux/file.h>
|
|
|
|
#include <linux/utsname.h>
|
2007-10-17 06:29:24 +00:00
|
|
|
#include <linux/ipc.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-06-07 12:34:42 +00:00
|
|
|
#include <linux/uaccess.h>
|
|
|
|
#include <linux/unistd.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-07-21 16:04:13 +00:00
|
|
|
#include <asm/syscalls.h>
|
|
|
|
|
2006-10-02 09:18:34 +00:00
|
|
|
/*
|
|
|
|
* Do a system call from kernel instead of calling sys_execve so we
|
|
|
|
* end up with proper pt_regs.
|
|
|
|
*/
|
2010-08-17 22:52:56 +00:00
|
|
|
int kernel_execve(const char *filename,
|
|
|
|
const char *const argv[],
|
|
|
|
const char *const envp[])
|
2006-10-02 09:18:34 +00:00
|
|
|
{
|
|
|
|
long __res;
|
2010-09-02 13:01:58 +00:00
|
|
|
asm volatile ("int $0x80"
|
2006-10-02 09:18:34 +00:00
|
|
|
: "=a" (__res)
|
2010-09-02 13:01:58 +00:00
|
|
|
: "0" (__NR_execve), "b" (filename), "c" (argv), "d" (envp) : "memory");
|
2006-10-02 09:18:34 +00:00
|
|
|
return __res;
|
|
|
|
}
|