exec & fork in a system call

exec & fork in a system call

Post by Marx Rajanga » Fri, 19 Feb 1999 04:00:00



Hi,

  I am trying to use execve() and fork() in a system call.
 I am trying to call sys_fork and sys_exec in my system call.
 But both these expect a pointer struct to be passed to them.

  struct pt_regs * regs

  that is defined in ptrace.h. I dont know how to fill the structure
 with the values. All the fields  in this struct are register fields.

  I would appreciate if someone could direct me in a proper direction.

  BTW, I am trying to fork and exec in a system call so that I can
 execute a binary(vi/emacs) by calling it from the system call.

 Thanks for the help.

--
Marx Rajangam
Fisher 227, CS Dept,
Michigan Tech. Univ.

 
 
 

exec & fork in a system call

Post by Andreas Schwa » Sat, 20 Feb 1999 04:00:00


|>   I am trying to use execve() and fork() in a system call.
|>  I am trying to call sys_fork and sys_exec in my system call.
|>  But both these expect a pointer struct to be passed to them.
|>  
|>   struct pt_regs * regs
|>
|>   that is defined in ptrace.h. I dont know how to fill the structure
|>  with the values. All the fields  in this struct are register fields.
|>
|>   I would appreciate if someone could direct me in a proper direction.

See kernel/kmod.c for how to do it right.

--
Andreas Schwab                                      "And now for something



 
 
 

1. exec & fork in a system call

Hi,

  I am trying to use execve() and fork() in a system call.
 I am trying to call sys_fork and sys_exec in my system call.
 But both these expect a pointer struct to be passed to them.

  struct pt_regs * regs

  that is defined in ptrace.h. I dont know how to fill the structure
 with the values. All the fields  in this struct are register fields.

  I would appreciate if someone could direct me in a proper direction.

  BTW, I am trying to fork and exec in a system call so that I can
 execute a binary(vi/emacs) by calling it from the system call.

 Thanks for the help.

--
Marx Rajangam
Fisher 227, CS Dept,
Michigan Tech. Univ.

2. 3c515 NIC

3. General Fork()/Exec()/System() Call Question

4. How do I make "shortcuts" for apps in Afterstep??

5. Fork and Exec system calls

6. How are a dynamic library objects loaded?

7. Input across fork() and exec() calls

8. Gateway Rocket Video Card

9. Efficiency: fork() w/ shared libraries vs. fork()/exec()

10. rsh in a system() or fork/exec on AIX

11. system(command) = fork + exec(command)? kill parent, children?

12. system() vs. fork/exec/waitpid

13. Q: fork() & exec() question