Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: jtensin@my-dejanews.com
Subject: Problem with makecontext()
Date: 1999/03/26	[thread overview]
Message-ID: <7dgr3h$d61$1@nnrp1.dejanews.com> (raw)

Greetings, all.

I have trouble calling makecontext() using Alpha/OSF1. For example,
the following "minimum" code just gives me a core dump on Alpha while
runs fine on Sparc/SunOs. Could someone help me out here? Many thanks
in advance.

-Jeff

/* cc min.c */
#include <stdlib.h>
#include <ucontext.h>

void *
do_nothing (void *arg)
{
   return NULL;
}

int
main ()
{
   ucontext_t *t;

   if ( !(t=(ucontext_t *)malloc(sizeof(ucontext_t))) ) {
      printf("error: malloc failed!\n");
      return -1;
   }

   if ( getcontext(t) != 0 ) {
      printf("error: getcontext failed!\n");
      return -1;
   }
   makecontext(t, (void (*)())do_nothing, 2, 1);
   return 1;

}

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    



             reply	other threads:[~1999-03-26  5:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-26  5:00 jtensin [this message]
1999-03-29  5:00 ` Problem with makecontext() Jeff Denham
1999-03-29  5:00   ` jtensin
1999-03-29  5:00     ` Jeff Denham
read-only archive

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