5

Could you give me the source code for execve() system call (exec family). I'm working with Linux.

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
aml
  • 91
  • 1
  • 1
  • 5
  • 3
    man 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
  • 5
    You mean: sudo get me the source code for execve – mpe Jan 14 '11 at 12:16

4 Answers4

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
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