Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261761AbVAHB4Y (ORCPT ); Fri, 7 Jan 2005 20:56:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261771AbVAHB4Y (ORCPT ); Fri, 7 Jan 2005 20:56:24 -0500 Received: from imf23aec.mail.bellsouth.net ([205.152.59.71]:8168 "EHLO imf23aec.mail.bellsouth.net") by vger.kernel.org with ESMTP id S261761AbVAHB4R (ORCPT ); Fri, 7 Jan 2005 20:56:17 -0500 Date: Fri, 7 Jan 2005 20:49:17 -0500 From: David Meybohm To: Chris Friesen Cc: Linux Kernel Mailing List Subject: Re: where to put kernel code to run on exec? Message-ID: <20050108014917.GA2629@localhost> Mail-Followup-To: Chris Friesen , Linux Kernel Mailing List References: <41DEAFE2.1030001@nortelnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41DEAFE2.1030001@nortelnetworks.com> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030927 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1098 Lines: 25 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/