Could you give me the source code for execve()
system call (exec family). I'm working with Linux.
Asked
Active
Viewed 1.2k times
5

Alexis Wilke
- 19,179
- 10
- 84
- 156

aml
- 91
- 1
- 1
- 5
-
3man execve tells you everything you need to know. What do you mean by “give me the source code for”? Some snippet as examples of use? – Benoit Jan 14 '11 at 09:51
-
5You mean: sudo get me the source code for execve – mpe Jan 14 '11 at 12:16
4 Answers
7
execve() calls sys_execve() which calls do_execve(), which is where the action is: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=fs/exec.c#l1376

metadaddy
- 4,234
- 1
- 22
- 46
3
Youmight look at sys_execve at arch/x86/kernel/process.c which calls do_execve at fs/exec.c.

Marcus Borkenhagen
- 6,536
- 1
- 30
- 33
3
The execve()
entry point is here, in the Linux Cross-Reference page. You can follow the function references (do_execve()
is probably what you actually need) to see the source code.

thkala
- 84,049
- 23
- 157
- 201
-
2+1 for linking to LXR instead of git. The source code is far more usable as hyperlinks. – Karmastan Jan 14 '11 at 19:38
0
You can get the linux source code at the kernel page To browse inline, use the git browsing facility

neuro
- 14,948
- 3
- 36
- 59