From mboxrd@z Thu Jan 1 00:00:00 1970 From: kkonaka@mac.com Subject: Re: makecontext(3) Date: Wed, 30 Jul 2003 09:49:29 -0400 Sender: linux-c-programming-owner@vger.kernel.org Message-ID: References: <20030729113916.GA3501@lsd.di.uminho.pt> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Return-path: In-Reply-To: <20030729113916.GA3501@lsd.di.uminho.pt> List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: luciano@lsd.di.uminho.pt, linux-c-programming@vger.kernel.org howdy thanks, > > makecontext() appear to have to be > > preceded by getcontext() to completely initialize its arg > I assume that the getcontext() is needed to get values for registers > (cs, ds, es, gs, ...). hmm., that certainly is part of the answer :) but, why makecontext() doesn't/cannot fill up some appropriate(??) values automatically into such fields? -- it looks to me the machine context makecontext() have to fabricate is simply the one to start calling the given function as one of its argument (= its second arg: "void *func()"). and it appears to me that this new machine context doesn't have anything to do with that of the caller. this make me think getcontext() may not be necessary. -- ?? (well, obviously I'm missing something) kenji