2005-04-17 00:20:36 +02: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-30 00:36:13 +02:00
|
|
|
#include <linux/fs.h>
|
2005-04-17 00:20:36 +02: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 08:29:24 +02:00
|
|
|
#include <linux/ipc.h>
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2008-06-07 14:34:42 +02:00
|
|
|
#include <linux/uaccess.h>
|
|
|
|
#include <linux/unistd.h>
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2008-07-21 18:04:13 +02:00
|
|
|
#include <asm/syscalls.h>
|
|
|
|
|
2006-10-02 11:18:34 +02:00
|
|
|
/*
|
|
|
|
* Do a system call from kernel instead of calling sys_execve so we
|
|
|
|
* end up with proper pt_regs.
|
|
|
|
*/
|
2010-08-18 00:52:56 +02:00
|
|
|
int kernel_execve(const char *filename,
|
|
|
|
const char *const argv[],
|
|
|
|
const char *const envp[])
|
2006-10-02 11:18:34 +02:00
|
|
|
{
|
|
|
|
long __res;
|
2010-09-02 15:01:58 +02:00
|
|
|
asm volatile ("int $0x80"
|
2006-10-02 11:18:34 +02:00
|
|
|
: "=a" (__res)
|
2010-09-02 15:01:58 +02:00
|
|
|
: "0" (__NR_execve), "b" (filename), "c" (argv), "d" (envp) : "memory");
|
2006-10-02 11:18:34 +02:00
|
|
|
return __res;
|
|
|
|
}
|