* stdlib/tst-setcontext.c (main): Add a test for setcontext.
This commit is contained in:
Ulrich Drepper 2001-04-07 20:39:34 +00:00
parent 4ee87eccd9
commit 232fdf8cab
3 changed files with 21 additions and 0 deletions

View File

@ -1,5 +1,7 @@
2001-04-07 Ulrich Drepper <drepper@redhat.com>
* stdlib/tst-setcontext.c (main): Add a test for setcontext.
* sysdeps/unix/sysv/linux/i386/getcontext.S: New file.
* sysdeps/unix/sysv/linux/i386/setcontext.S: New file.
* sysdeps/unix/sysv/linux/i386/makecontext.S: New file.

3
NEWS
View File

@ -38,6 +38,9 @@ Version 2.2.3
* Martin Schwidefsky <schwidefsky@de.ibm.com> implemented the setcontext
family of functions for Linux/S390.
* Ulrich Drepper <drepper@redhat.com> implemented the setcontext family
of functions for Linux/x86.
Version 2.2.2

View File

@ -71,6 +71,8 @@ f2 (void)
was_in_f2 = 1;
}
volatile int global;
int
main (void)
{
@ -85,6 +87,20 @@ main (void)
printf ("%s: getcontext: %m\n", __FUNCTION__);
exit (1);
}
/* Play some tricks with this context. */
if (++global == 1)
if (setcontext (&ctx[1]) != 0)
{
printf ("%s: setcontext: %m\n", __FUNCTION__);
exit (1);
}
if (global != 2)
{
printf ("%s: 'global' not incremented twice\n", __FUNCTION__);
exit (1);
}
ctx[1].uc_stack.ss_sp = st1;
ctx[1].uc_stack.ss_size = sizeof st1;
ctx[1].uc_link = &ctx[0];