Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do I find the source code for execve()?

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

like image 946
aml Avatar asked Jan 14 '11 09:01

aml


3 Answers

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

like image 170
metadaddy Avatar answered Nov 18 '22 16:11

metadaddy


Youmight look at sys_execve at arch/x86/kernel/process.c which calls do_execve at fs/exec.c.

like image 42
Marcus Borkenhagen Avatar answered Nov 18 '22 15:11

Marcus Borkenhagen


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.

like image 3
thkala Avatar answered Nov 18 '22 16:11

thkala