linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luciano Miguel Ferreira Rocha <luciano@lsd.di.uminho.pt>
To: kkonaka@mac.com
Cc: linux-c-programming@vger.kernel.org
Subject: Re: makecontext(3)
Date: Tue, 29 Jul 2003 12:39:16 +0100	[thread overview]
Message-ID: <20030729113916.GA3501@lsd.di.uminho.pt> (raw)
In-Reply-To: <la1xwao4i1.wl@mac.com>

On Mon, Jul 28, 2003 at 03:06:30PM -0400, kkonaka@mac.com wrote:
> on the surface(?) calls to makecontext() appear to have to be 
> preceded by getcontext() to completely initialize its arg: ucontext_t
> struct (that is, if I comment out getcontext() calls from a
> program like the below, it causes SEGV). why is it the case?
> kenji

Hello,

From the manual page:
       The makecontext() function modifies  the  context  pointed  to  by  ucp
       (which was obtained from a call to getcontext()).  Before calling make-
       context(), one should allocate a new stack for this context,  assigning
       to   ucp->uc_stack,  and  define  a  successor  context,  assigning  to
       ucp->uc_link. 

I assume that the getcontext() is needed to get values for registers
(cs, ds, es, gs, ...).

Regards,
Luciano Rocha

  reply	other threads:[~2003-07-29 11:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-28 19:06 makecontext(3) kkonaka
2003-07-29 11:39 ` Luciano Miguel Ferreira Rocha [this message]
2003-07-30 13:49   ` makecontext(3) kkonaka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030729113916.GA3501@lsd.di.uminho.pt \
    --to=luciano@lsd.di.uminho.pt \
    --cc=kkonaka@mac.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).