From dc97c227c95dd521594f1eaa472399b9fba03b2a Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 17 Jul 2012 10:05:55 +0200 Subject: setcontext: Clarify termination when uc_link is the null pointer. --- ChangeLog | 8 ++++++++ manual/setjmp.texi | 3 ++- stdlib/tst-makecontext.c | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6c1cc5a40..fce46177e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-07-17 Thomas Schwinge + Andreas Krebbel + + * manual/setjmp.texi (setcontext): Clarify normal process + termination when uc_link is the null pointer. + * stdlib/tst-makecontext.c (cf): Exercise this: remove explicit + exit call. + 2012-07-16 Andreas Schwab * stdlib/bug-getcontext.c (do_test): Don't test FE_ALL_EXCEPT in diff --git a/manual/setjmp.texi b/manual/setjmp.texi index a5a7ce6523..f13ac7b00e 100644 --- a/manual/setjmp.texi +++ b/manual/setjmp.texi @@ -354,7 +354,8 @@ specified parameters passed. If this function returns execution is resumed in the context which was referenced by the @code{uc_link} element of the context structure passed to @code{makecontext} at the time of the call. If @code{uc_link} was a null pointer the application -terminates in this case. +terminates normally with an exit status value of @code{EXIT_SUCCESS} +(@pxref{Program Termination}). Since the context contains information about the stack no two threads should use the same context at the same time. The result in most cases diff --git a/stdlib/tst-makecontext.c b/stdlib/tst-makecontext.c index 31859007d0..eb6e89bda8 100644 --- a/stdlib/tst-makecontext.c +++ b/stdlib/tst-makecontext.c @@ -35,7 +35,9 @@ cf (int i) printf ("i %d thr %d\n", i, thr); exit (1); } - exit (0); + + /* Since uc_link below has been set to NULL, setcontext is supposed to + terminate the process normally after this function returns. */ } int -- cgit 1.4.1