RE: Seek Help !!!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



________________________________________
From: kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of seshu
Sent: Saturday, October 02, 2004 6:13 PM
To: 'Kenel Newbies'
Subject: Seek Help !!!

 
> asmlinkage int sys_fork(struct pt_regs regs).
> Which library function passes "struct pt_regs" parameter to "sys_fork" > > > after the fork() sytem call is invoked in the user process.
> Is there any other way I can implement a new system call which behaves as > the fork() system call, but can take arguments.
> It's very urgent for me. Pls help me out regarding this.
> Seshu.
 
The mentioned parameter to fork or any other system call is not passed by any library function. It's the kernel function system_call() (which is the first kernel function when we enter system call) which passes it. system_call() function takes the snap shot of the processor when we enter system call and passes this snap shot to the calling system call.

You should not change the signature of fork or any other system call, as system calls is an interface thru which user process talks to kernel. If you change the signature (declaration) of any system call (including fork), you need to change the system call invocation in library functions as well, but again as different applications would be using different libraries ..... so it is not an easy task ...... more over its not a portable thing on different linux machines ........ It's always a bad idea to change the signature of any system call.

Better would be if you implement your own system call to perform your things. For implementing the new system call, read the following link: http://www.csee.umbc.edu/courses/undergraduate/CMSC421/fall02/burt/projects/howto_add_systemcall.html

Cheers !!
Gaurav
 

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux