summaryrefslogtreecommitdiff
path: root/lib/execve.c
blob: 2667ebc1504567ba7ee3a0cc57abe0ee5e2644ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <asm/bug.h>
#include <asm/uaccess.h>

#define __KERNEL_SYSCALLS__
static int errno __attribute__((unused));
#include <asm/unistd.h>

#ifdef _syscall3
int kernel_execve (const char *filename, char *const argv[], char *const envp[])
								__attribute__((__weak__));
int kernel_execve (const char *filename, char *const argv[], char *const envp[])
{
	mm_segment_t fs = get_fs();
	int ret;

	WARN_ON(segment_eq(fs, USER_DS));
	ret = execve(filename, (char **)argv, (char **)envp);
	if (ret)
		ret = -errno;

	return ret;
}
#endif