public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* where to put kernel code to run on exec?
@ 2005-01-07 15:50 Chris Friesen
  2005-01-08  1:49 ` David Meybohm
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Friesen @ 2005-01-07 15:50 UTC (permalink / raw)
  To: Linux Kernel Mailing List


I've added a field to the task struct to keep track of whether or not 
the process wants to be notified of various events.  On exec() I'd like 
to clear this field.

I'm having problems finding a nice clean place to put the code to clear 
it.  The obvious choice would be in the last bit of the success path in 
do_execve(), but there's nothing similar there already, so I'm probably 
missing something.

Is there some standard place to put code to run on a successful call to 
exec()?

Chris

Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: where to put kernel code to run on exec?
  2005-01-07 15:50 where to put kernel code to run on exec? Chris Friesen
@ 2005-01-08  1:49 ` David Meybohm
  0 siblings, 0 replies; 2+ messages in thread
From: David Meybohm @ 2005-01-08  1:49 UTC (permalink / raw)
  To: Chris Friesen; +Cc: Linux Kernel Mailing List

On Fri, Jan 07, 2005 at 09:50:58AM -0600, Chris Friesen wrote:
> 
> I've added a field to the task struct to keep track of whether or not 
> the process wants to be notified of various events.  On exec() I'd like 
> to clear this field.
> 
> I'm having problems finding a nice clean place to put the code to clear 
> it.  The obvious choice would be in the last bit of the success path in 
> do_execve(), but there's nothing similar there already, so I'm probably 
> missing something.
> 
> Is there some standard place to put code to run on a successful call to 
> exec()?

What about in flush_old_exec()?  Any place after exec_mmap() looks good.
If the exec fails after that point, the process has to be killed,
because all the old memory space is gone.  In that case you don't have
to worry about clearing the field because the process is gone.

Dave

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-08  1:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-07 15:50 where to put kernel code to run on exec? Chris Friesen
2005-01-08  1:49 ` David Meybohm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox