glibc/setjmp/tst-setjmp.c
Ulrich Drepper cb34385453 Update.
1998-03-29 16:50  Ulrich Drepper  <drepper@cygnus.com>

	* config.make.in (ldd-rewrite-script): New variable.
	* configure.in: Substitute ldd-rewrite-script.
	* elf/Makefile: Rewrite rules to generate ldd script.
	* elf/ldd.bash.in: Allow handling of non-ELF binaries.
	* elf/ldd.sh.in: Likewise.
	* sysdeps/unix/sysv/linux/Makefile: Remove rule to install lddlibc4.
	* sysdeps/unix/sysv/linux/configure.in: Define ldd_rewrite_script to
	point to sed script for libc4 handling insertion for ix86, m68, SPARC.
	* sysdeps/unix/sysv/linux/i386/Makefile: Add rule to install lddlibc4.

1998-03-26 15:20  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* inet/rcmd.c (iruserok): Remain setuid to the local user
	while .rhosts is actually read, to make .rhosts-over-NFS work
	(PR libc/524).  Use iruserfopen() for security checks on both
	hosts.equiv and .rhosts.  General cleanup.
	(iruserfopen): New function, performs careful checking on
	hosts.equiv/.rhosts files.  Disallows all the old forbidden
	stuff plus hard links to files.

1998-03-29 09:26  Ulrich Drepper  <drepper@cygnus.com>

	* setjmp/tst-setjmp.c: Don't test __setjmp, test _setjmp instead.

1998-03-29 02:02  H.J. Lu  <hjl@gnu.org>

	* sysdeps/i386/i486/bits/string.h: Fix typos.

	* nss/nsswitch.c (__nss_lookup): Fix the bogus checking for
	"adjusted for next function".

1998-03-28 00:13  H.J. Lu  <hjl@gnu.org>

	* sysdeps/unix/sysv/linux/alpha/readdir.c (__readdir64): New
	strong alias.

	* sysdeps/unix/sysv/linux/alpha/syscalls.list (socket): Added.

	* libc.map (__ieee_get_fp_control, __ieee_set_fp_control):
	Added.  Used by libm.so on alpha.

1998-03-28  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

	* intl/bindtextdom.c [_LIBC]: Define strdup only if not yet
	defined.

1998-03-27 07:29  H.J. Lu  <hjl@gnu.org>

	* Makerules (object-suffixes-for-rules): Add .oS only for
	building shared library.
	Add ranlib rule for nonshared library.
	(rmobjs): Fix typo.

	* Makeconfig (libtype.oS, CFLAGS-.oS, CPPFLAGS-.oS): Moved
	into for shared library only.
	(CPPFLAGS-.oS): Add -DPIC.
	(libtypes): Use $(object-suffixes-for-rules) instead of
	$(object-suffixes).

1998-03-28  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/Makefile (inhibit-stdio_lim): Compile
	and install lddlibc4.

1998-03-28 09:13  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* iconvdata/gap.pl: Gobble rest of line with a scalar, not a
	hash.
	* iconvdata/gaptab.pl: Likewise.
1998-03-29 17:03:23 +00:00

118 lines
2.6 KiB
C

/* Copyright (C) 1991, 1992, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <setjmp.h>
#include <stdlib.h>
static jmp_buf env;
static int last_value = -1, lose = 0;
void
jump (int val)
{
longjmp (env, val);
}
int
main (void)
{
int value;
value = setjmp (env);
if (value != last_value + 1)
{
fputs("Shouldn't have ", stdout);
lose = 1;
}
last_value = value;
switch (value)
{
case 0:
puts("Saved environment.");
jump (0);
default:
printf ("Jumped to %d.\n", value);
if (value < 10)
jump (value + 1);
}
if (!lose && value == 10)
{
/* Do a second test, this time without `setjmp' being a macro.
This is not required by ISO C but we have this for compatibility. */
#undef setjmp
extern int setjmp (jmp_buf);
last_value = -1;
lose = 0;
value = setjmp (env);
if (value != last_value + 1)
{
fputs("Shouldn't have ", stdout);
lose = 1;
}
last_value = value;
switch (value)
{
case 0:
puts("Saved environment.");
jump (0);
default:
printf ("Jumped to %d.\n", value);
if (value < 10)
jump (value + 1);
}
}
if (!lose && value == 10)
{
/* And again for the `_setjmp' function. */
#ifndef _setjmp
extern int _setjmp (jmp_buf);
#endif
last_value = -1;
lose = 0;
value = _setjmp (env);
if (value != last_value + 1)
{
fputs("Shouldn't have ", stdout);
lose = 1;
}
last_value = value;
switch (value)
{
case 0:
puts("Saved environment.");
jump (0);
default:
printf ("Jumped to %d.\n", value);
if (value < 10)
jump (value + 1);
}
}
if (lose || value != 10)
puts ("Test FAILED!");
else
puts ("Test succeeded!");
exit (lose ? EXIT_FAILURE : EXIT_SUCCESS);
}