Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Problem with makecontext()
@ 1999-03-26  5:00 jtensin
  1999-03-29  5:00 ` Jeff Denham
  0 siblings, 1 reply; 4+ messages in thread
From: jtensin @ 1999-03-26  5:00 UTC (permalink / 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    



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

end of thread, other threads:[~1999-03-29  5:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-26  5:00 Problem with makecontext() jtensin
1999-03-29  5:00 ` Jeff Denham
1999-03-29  5:00   ` jtensin
1999-03-29  5:00     ` Jeff Denham

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