+1998-02-24 15:12 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makeconfig: Filter out frame-pointer effecting options when
+ compiling profiling or debugging code.
+ * config.h.in (internal_function): Don't define here if PROF is
+ defined.
+ * gmon/gmon.c (__moncontrol): Don't change state if already in error
+ state.
+ (__monstartup): If calloc fails set error state and mark array as
+ not allocated.
+ (_mcleanup): Don't call write_gmon if in error state. Don't try
+ to free array if not successfully allocated.
+
+ * elf/dl-load.c (STRING): Define to __STRING to enble expansion.
+ Include elf.h to get macro definitions.
+ Use __ELF?NATIVE?CLASS in message, not __ELF_WORDSIZE.
+
+1998-02-24 09:40 Ulrich Drepper <drepper@cygnus.com>
+
+ * elf/ldd.sh.in: Add compatibility for broken old shells.
+ * elf/ldd.bash.in: Likewise.
+
+1998-02-24 08:11 H.J. Lu <hjl@gnu.org>
+
+ * sunrpc/rpc_main.c (open_input): Check pipe return error.
+
+ * time/clocktest.c (main): Check signal return error.
+
+1998-02-24 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * iconv/Makefile ($(inst_bindir)/iconv): Correct typo, add
+ "/" and use do-install-program. Reported by Mark M. Kettenis.
+ (subdir_install): Likewise.
+
+1998-02-22 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
+
+ * sunrpc/rpc_sample.c: Fix typo.
+
+ * nscd/connections.c: Use locale.
+ * nscd/grpcache.c: Add debug messages, gidtbl should get the
+ calloc result.
+ * nscd/nscd.c: Check if init functions fails.
+ * nscd/nscd_conf.c: Allow disabling of group cache.
+ * nscd/nscd_getgr_r.c: Fix return code if group not found.
+ * nscd/pwdcache.c: Fix debug messages.
+
+1998-02-22 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * libc.map: Add __monstartup and _mcleanup for profiling support.
+
+1998-02-20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * libc.map: Export __getpagesize, for binary compatibility with
+ 2.0.
+
+1998-02-21 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * posix/globtest.sh: Use --library-path instead of
+ LD_LIBRARY_PATH.
+ * localedata/sort-test.sh: Likewise.
+ * localedata/tst-fmon.sh: Likewise. Avoid useless use of cat.
+
+1998-02-22 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * sysdeps/unix/sysv/linux/sigaction.c: Translate between struct
+ sigaction and struct kernel_sigaction for __syscall_rt_sigaction.
+ * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
+
+ * sysdeps/unix/sysv/linux/kernel_sigaction.h (struct
+ kernel_sigaction): Define.
+ * sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h (struct
+ kernel_sigaction): Define.
+
+1998-02-23 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * math/libm-test.c: Change epsilons for libm-ieee754.
+
+1998-02-23 12:33 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/i386/__longjmp.S: Fix race condition.
+ Reported by Bruno Haible <haible@ilog.fr>.
+
1998-02-20 18:43 Ulrich Drepper <drepper@cygnus.com>
* hesiod/hesiod.c: Pretty print. Don't use __ protected names.
CPPFLAGS = $(+includes) $(defines) -include $(..)include/libc-symbols.h \
$(sysdep-CPPFLAGS) $(CPPFLAGS-$(suffix $@)) $(CPPFLAGS-$(<F)) \
$(CPPFLAGS-$(@F))
-override CFLAGS = $(+cflags) $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) \
- $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
+override CFLAGS = $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
+ $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
# This is the macro that the implicit linking rules use.
object-suffixes :=
ifeq (yes,$(build-static))
CPPFLAGS-.o = $(pic-default)
+CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
libtype.o := lib%.a
object-suffixes += .o
endif
# The PIC object files are named foo.os.
object-suffixes += .os
CPPFLAGS-.os = -DPIC
-CFLAGS-.os = $(pic-ccflag)
+CFLAGS-.os = $(filter %frame-pointer,$(+cflags)) $(pic-ccflag)
libtype.os := lib%_pic.a
# This can be changed by a sysdep makefile
pic-ccflag = -fPIC
object-suffixes += .og
CPPFLAGS-.og = $(pic-default)
CFLAGS-.og = -g
-CFLAGS-.o = -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES
-CFLAGS-.os += $(CFLAGS-.o)
+CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES
+CFLAGS-.os += -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES
libtype.og = lib%_g.a
endif
ifeq (yes,$(build-bounded))
/* Defined to some form of __attribute__ ((...)) if the compiler supports
a different, more efficient calling convention. */
-#ifdef USE_REGPARMS
+#if defined USE_REGPARMS && !defined PROF
# define internal_function __attribute__ ((regparm (3), stdcall))
#endif
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <elf.h>
#include <errno.h>
#include <fcntl.h>
#include <link.h>
#define byteorder ELFDATANONE
#endif
-#define STRING(x) #x
+#define STRING(x) __STRING (x)
#ifdef MAP_ANON
/* The fd is not examined when using MAP_ANON. */
#define ELF32_CLASS ELFCLASS32
#define ELF64_CLASS ELFCLASS64
if (header->e_ident[EI_CLASS] != ELFW(CLASS))
- LOSE ("ELF file class not " STRING(__ELF_WORDSIZE) "-bit");
+ LOSE ("ELF file class not " STRING(__ELF_NATIVE_CLASS) "-bit");
if (header->e_ident[EI_DATA] != byteorder)
LOSE ("ELF file data encoding not " byteorder_name);
if (header->e_ident[EI_VERSION] != EV_CURRENT)
{
struct gmonparam *p = &_gmonparam;
+ /* Don't change the state if we ran into an error. */
+ if (p->state == GMON_PROF_ERROR)
+ return;
+
if (mode)
{
/* start */
cp = calloc (p->kcountsize + p->fromssize + p->tossize, 1);
if (! cp)
{
- ERR(_("monstartup: out of memory\n"));
+ ERR("monstartup: out of memory\n");
+ p->tos = NULL;
+ p->state = GMON_PROF_ERROR;
return;
}
p->tos = (struct tostruct *)cp;
void
_mcleanup (void)
{
- __moncontrol (0);
+ __moncontrol (0);
+ if (_gmonparam.state != GMON_PROF_ERROR)
write_gmon ();
- /* free the memory. */
+ /* free the memory. */
+ if (_gmonparam.tos != NULL)
free (_gmonparam.tos);
}
__malloc_initialize_hook; __free_hook; __malloc_hook; __realloc_hook;
__memalign_hook; __after_morecore_hook;
__malloc_initialized; __default_morecore; __morecore; __sbrk;
+ __getpagesize;
# functions with required interface outside normal name space
_exit; __ivaliduser; __open_catalog;
__register_frame; __register_frame_table; __deregister_frame;
__register_frame_info; __deregister_frame_info;
+ # Profiling support
+ __monstartup; _mcleanup;
+
# variables in normal name space
argp_err_exit_status; argp_program_bug_address; argp_program_version;
argp_program_version_hook;
cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
cn=locales/$cns
fn=charmaps/`echo $l | sed 's/.*[.]\([^.]*\)/\1/'`
- LD_LIBRARY_PATH=$common_objpfx I18NPATH=./locales ${common_objpfx}elf/ld.so \
+ I18NPATH=./locales ${common_objpfx}elf/ld.so --library-path $common_objpfx \
${common_objpfx}locale/localedef --quiet -i $cn -f $fn \
${common_objpfx}localedata/$cns
done
status=0
for l in $lang; do
cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
- LOCPATH=$common_objpfx/localedata LC_ALL=$cns \
- LD_LIBRARY_PATH=$common_objpfx $common_objpfx/elf/ld.so \
- $common_objpfx/localedata/collate-test $id < $cns.in \
- > $common_objpfx/localedata/$cns.out || status=1
- cmp -s $cns.in $common_objpfx/localedata/$cns.out || status=1
+ LOCPATH=${common_objpfx}localedata LC_ALL=$cns \
+ ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+ ${common_objpfx}localedata/collate-test $id < $cns.in \
+ > ${common_objpfx}localedata/$cns.out || status=1
+ cmp -s $cns.in ${common_objpfx}localedata/$cns.out || status=1
- LOCPATH=$common_objpfx/localedata LC_ALL=$cns \
- LD_LIBRARY_PATH=$common_objpfx $common_objpfx/elf/ld.so \
- $common_objpfx/localedata/xfrm-test $id < $cns.in \
- > $common_objpfx/localedata/$cns.xout || status=1
- cmp -s $cns.in $common_objpfx/localedata/$cns.xout || status=1
+ LOCPATH=${common_objpfx}localedata LC_ALL=$cns \
+ ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+ ${common_objpfx}localedata/xfrm-test $id < $cns.in \
+ > ${common_objpfx}localedata/$cns.xout || status=1
+ cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || status=1
done
exit $status
cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
cn=locales/$cns
fn=charmaps/`echo $l | sed 's/.*[.]\([^.]*\)/\1/'`
- LD_LIBRARY_PATH=$common_objpfx I18NPATH=./locales \
- ${common_objpfx}elf/ld.so ${common_objpfx}locale/localedef \
+ I18NPATH=./locales \
+ ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+ ${common_objpfx}locale/localedef \
--quiet -i $cn -f $fn ${common_objpfx}localedata/$cns
done
# Run the tests.
IFS=" " # This is a TAB
-cat $datafile |
while read locale format value expect; do
if [ -n "$format" ]; then
LOCPATH=${common_objpfx}localedata \
- LD_LIBRARY_PATH=$common_objpfx \
- ${common_objpfx}elf/ld.so ${common_objpfx}localedata/tst-fmon \
+ ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+ ${common_objpfx}localedata/tst-fmon \
"$locale" "$format" "$value" "$expect"
if [ $? -eq 0 ]; then
if [ $DEBUG -eq 1 ]; then
exit 1
fi
fi
-done
+done < $datafile
exit $?
# Local Variables:
check ("asin (1.0) == pi/2", FUNC(asin) (1.0), M_PI_2l);
check ("asin (-1.0) == -pi/2", FUNC(asin) (-1.0), -M_PI_2l);
check_eps ("asin (0.7) == 0.775397496...", FUNC(asin) (0.7),
- 0.7753974966107530637L, CHOOSE(7e-17L, 2e-16, 0));
+ 0.7753974966107530637L, CHOOSE(7e-17L, 2e-16, 2e-7));
}
check_isinfn ("asinh(-inf) == -inf", FUNC(asinh) (minus_infty));
#endif
check_eps ("asinh(0.7) == 0.652666566...", FUNC(asinh) (0.7),
- 0.652666566082355786L, CHOOSE(4e-17L, 0, 0));
+ 0.652666566082355786L, CHOOSE(4e-17L, 0, 6e-8));
}
check ("tanh (-inf) == -1", FUNC(tanh) (minus_infty), -1);
#endif
check_eps ("tanh (0.7) == 0.6043677771...", FUNC(tanh) (0.7),
- 0.60436777711716349631L, CHOOSE(3e-17L, 0, 0));
+ 0.60436777711716349631L, CHOOSE(3e-17L, 0, 6e-8));
}
result = FUNC(cexp) (BUILD_COMPLEX (0.7, 1.2));
check_eps ("real(cexp(0.7 + i 1.2)) == 0.72969...", __real__ result,
- 0.7296989091503236012L, CHOOSE(6e-17L, 0, 2e-7));
+ 0.7296989091503236012L, CHOOSE(6e-17L, 2e-16, 2e-7));
check_eps ("imag(cexp(0.7 + i 1.2)) == 1.87689...", __imag__ result,
1.8768962328348102821L, CHOOSE(2e-16L, 0, 3e-7));
result = FUNC(ctanh) (BUILD_COMPLEX (0.7, 1.2));
check_eps ("real(ctanh(0.7 + i 1.2)) == 1.34721...", __real__ result,
- 1.3472197399061191630L, CHOOSE(4e-17L, 6e-17, 2e-7));
+ 1.3472197399061191630L, CHOOSE(4e-17L, 3e-16, 2e-7));
check_eps ("imag(ctanh(0.7 + i 1.2)) == -0.47786...", __imag__ result,
- 0.4778641038326365540L, CHOOSE(9e-17L, 6e-17, 0));
+ 0.4778641038326365540L, CHOOSE(9e-17L, 6e-17, 9e-8));
result = FUNC(ctanh) (BUILD_COMPLEX (-2, -3));
check_eps ("real(ctanh(-2 - i 3)) == -0.96538...", __real__ result,
if (sock[conn] == 0)
{
- dbg_log ("bad connection id on send response [%d|%d]",
+ dbg_log (_("bad connection id on send response [%d|%d]"),
conn, sock[conn]);
return;
}
grptbl = calloc (modulo, sizeof (grphash));
if (grptbl == NULL)
return -1;
- calloc (modulo, sizeof (grphash));
+ gidtbl = calloc (modulo, sizeof (grphash));
if (gidtbl == NULL)
return -1;
negtbl = calloc (modulo, sizeof (neghash));
unsigned long int hash = __nis_hash (grp->gr_name,
strlen (grp->gr_name)) % modulo;
+ if (debug_flag)
+ dbg_log (_("grp_add_cache (%s)"), grp->gr_name);
+
work = &grptbl[hash];
if (grptbl[hash].grp == NULL)
neghash *work;
unsigned long int hash = __nis_hash (key, strlen (key)) % modulo;
+ if (debug_flag)
+ dbg_log (_("grp_add_netgache (%s|%ld)"), key, hash);
+
work = &negtbl[hash];
if (negtbl[hash].key == NULL)
- negtbl[hash].key = strdup (key);
+ {
+ negtbl[hash].key = strdup (key);
+ negtbl[hash].next = NULL;
+ }
else
{
while (work->next != NULL)
neghash *work;
unsigned long int hash = __nis_hash (key, strlen (key)) % modulo;
+ if (debug_flag)
+ dbg_log (_("grp_cache_search_neg (%s|%ld)"), key, hash);
+
work = &negtbl[hash];
while (work->key != NULL)
cache_getgrnam (void *v_param)
{
param_t *param = (param_t *)v_param;
- struct group *grp, resultbuf;
+ struct group *grp;
pthread_rwlock_rdlock (&grplock);
grp = cache_search_name (param->key);
/* I don't like it to hold the read only lock longer, but it is
necessary to avoid to much malloc/free/strcpy. */
- if (grp)
+ if (grp != NULL)
{
if (debug_flag)
dbg_log (_("Found \"%s\" in cache !"), param->key);
}
else
{
+ int status;
int buflen = 1024;
char *buffer = calloc (1, buflen);
- int status;
+ struct group resultbuf;
if (debug_flag)
dbg_log (_("Doesn't found \"%s\" in cache !"), param->key);
{
param_t *param = (param_t *)v_param;
+ if (debug_flag)
+ dbg_log (_("\tgroup cache is disabled\n"));
+
gr_send_disabled (param->conn);
return NULL;
}
/* Parse and process arguments. */
argp_parse (&argp, argc, argv, 0, &remaining, NULL);
- if (remaining != 0)
+ if (remaining != argc)
{
error (0, 0, gettext ("wrong number of arguments"));
argp_help (&argp, stdout, ARGP_HELP_SEE, program_invocation_short_name);
/* Create first sockets */
init_sockets ();
/* Init databases */
- cache_pwdinit ();
- cache_grpinit ();
+ if ((cache_pwdinit () < 0) || (cache_grpinit () < 0))
+ {
+ fputs (_("Not enough memory\n"), stderr);
+ return 1;
+ }
/* Handle incoming requests */
handle_requests ();
if (strcmp (arg1, "passwd") == 0
&& strcmp (arg2, "no") == 0)
disabled_passwd = 1;
+ else if (strcmp (arg1, "group") == 0
+ && strcmp (arg2, "no") == 0)
+ disabled_group = 1;
+ else
+ dbg_log (_("service %s is not supported"), arg1);
}
else if (strcmp (entry, "logfile") == 0)
{
return 1;
}
}
+ close (sock);
+ return 0;
+ }
+ else
+ {
+ close (sock);
+ return -1;
}
- close (sock);
- return 0;
}
strlen (pwd->pw_name)) % modulo;
if (debug_flag)
- dbg_log (_("add_cache (%s)"), pwd->pw_name);
+ dbg_log (_("pwd_add_cache (%s)"), pwd->pw_name);
work = &pwdtbl[hash];
unsigned long int hash = __nis_hash (key, strlen (key)) % modulo;
if (debug_flag)
- dbg_log (_("add_netgache (%s|%ld)"), key, hash);
+ dbg_log (_("pwd_add_netgache (%s|%ld)"), key, hash);
work = &negtbl[hash];
work->next->key = strdup (key);
work = work->next;
}
- /* Set a pointer from the pwuid hash table to the pwname hash table */
+
time (&work->create);
return 0;
neghash *work;
unsigned long int hash = __nis_hash (key, strlen (key)) % modulo;
- work = &negtbl[hash];
-
if (debug_flag)
- dbg_log (_("cache_search_neg (%s|%ld)"), key, hash);
+ dbg_log (_("pwd_cache_search_neg (%s|%ld)"), key, hash);
+
+ work = &negtbl[hash];
while (work->key != NULL)
{
void *
cache_getpwnam (void *v_param)
{
+ struct passwd *pwd;
param_t *param = (param_t *)v_param;
- struct passwd *pwd, resultbuf;
pthread_rwlock_rdlock (&pwdlock);
pwd = cache_search_name (param->key);
close_socket (param->conn);
pthread_rwlock_unlock (&pwdlock);
- pwd = &resultbuf;
}
else
{
int status;
int buflen = 1024;
- char *buffer = malloc (buflen);
+ char *buffer = calloc (1, buflen);
+ struct passwd resultbuf;
if (debug_flag)
dbg_log (_("Doesn't found \"%s\" in cache !"), param->key);
{
param_t *param = (param_t *)v_param;
+ if (debug_flag)
+ dbg_log (_("\tpasswd cache is disabled\n"));
+
pw_send_disabled (param->conn);
return NULL;
}
# Run some tests.
result=0
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*" |
+${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
+${common_objpfx}posix/globtest "$testdir" "*" |
sort > $testout
cat <<"EOF" | cmp - $testout || result=1
`dir1'
not NULL
EOF
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*/*" |
+${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
+${common_objpfx}posix/globtest "$testdir" "*/*" |
sort > $testout
cat <<"EOF" | cmp - $testout || result=1
`dir1/file1_1'
not NULL
EOF
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*/1" |
+${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
+${common_objpfx}posix/globtest "$testdir" "*/1" |
sort > $testout
cat <<"EOF" | cmp - $testout || result=1
GLOB_NOMATCH
NULL
EOF
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*/*1_1" |
+${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
+${common_objpfx}posix/globtest "$testdir" "*/*1_1" |
sort > $testout
cat <<"EOF" | cmp - $testout || result=1
`dir1/file1_1'
not NULL
EOF
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*/file1_1" |
+${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
+${common_objpfx}posix/globtest "$testdir" "*/file1_1" |
sort > $testout
cat <<"EOF" | cmp - $testout || result=1
`dir1/file1_1'
not NULL
EOF
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*-/*" |
+${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
+${common_objpfx}posix/globtest "$testdir" "*-/*" |
sort > $testout
cat <<"EOF" | cmp - $testout || result=1
GLOB_NOMATCH
NULL
EOF
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*-" |
+${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
+${common_objpfx}posix/globtest "$testdir" "*-" |
sort > $testout
cat <<"EOF" | cmp - $testout || result=1
GLOB_NOMATCH
f_print(fout, "\txdr_free (xdr_result, result);\n");
f_print(fout,
"\n\t/*\n\t * Insert additional freeing code here, if needed\n\t */\n");
- f_print(fout, "\n\treturn 0;\n}\n");
+ f_print(fout, "\n\treturn 1;\n}\n");
}
}
}
/* longjmp for i386.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 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
ENTRY (__longjmp)
movl 4(%esp), %ecx /* User's jmp_buf in %ecx. */
movl 8(%esp), %eax /* Second argument is return value. */
+ /* Save the return address now. */
+ movl (JB_PC*4)(%ecx), %edx
/* Restore registers. */
movl (JB_BX*4)(%ecx), %ebx
movl (JB_SI*4)(%ecx), %esi
movl (JB_BP*4)(%ecx), %ebp
movl (JB_SP*4)(%ecx), %esp
/* Jump to saved PC. */
- movl (JB_PC*4)(%ecx), %ecx
- jmp *%ecx
+ jmp *%edx
END (__longjmp)
unsigned long sa_mask;
unsigned int sa_flags;
};
+
+/* This is the sigaction structure from the Linux 2.1.68 kernel. */
+
+struct kernel_sigaction {
+ __sighandler_t k_sa_handler;
+ unsigned int sa_flags;
+ sigset_t sa_mask;
+};
#include <kernel_sigaction.h>
-extern int __syscall_rt_sigaction (int, const struct sigaction *,
- struct sigaction *, size_t);
+extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *,
+ struct kernel_sigaction *, size_t);
/* The variable is shared between all wrappers around signal handling
functions which have RT equivalents. */
/* First try the RT signals. */
if (!__libc_missing_rt_sigs)
{
- struct sigaction nact, *nactp;
+ struct kernel_sigaction kact, koact;
if (act)
{
- nact.sa_handler = act->sa_handler;
- memcpy (&nact.sa_mask, &act->sa_mask, sizeof (sigset_t));
- nact.sa_flags = act->sa_flags;
+ kact.k_sa_handler = act->sa_handler;
+ memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
+ kact.sa_flags = act->sa_flags;
- nact.sa_restorer = ((act->sa_flags & SA_NOMASK)
+ kact.sa_restorer = ((act->sa_flags & SA_NOMASK)
? &&restore_nomask : &&restore);
- nactp = &nact;
}
- else
- nactp = NULL;
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- result = __syscall_rt_sigaction (sig, nactp, oact, _NSIG / 8);
+ result = __syscall_rt_sigaction (sig, act ? &kact : NULL,
+ oact ? &koact : NULL, _NSIG / 8);
if (result >= 0 || errno != ENOSYS)
- return result;
+ {
+ if (oact && result >= 0)
+ {
+ oact->sa_handler = koact.k_sa_handler;
+ memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
+ oact->sa_flags = koact.sa_flags;
+ oact->sa_restorer = koact.sa_restorer;
+ }
+ return result;
+ }
__libc_missing_rt_sigs = 1;
}
unsigned long sa_flags;
void (*sa_restorer) __P ((void));
};
+
+/* This is the sigaction structure from the Linux 2.1.68 kernel. */
+
+struct kernel_sigaction {
+ __sighandler_t k_sa_handler;
+ unsigned long sa_flags;
+ void (*sa_restorer) __P ((void));
+ sigset_t sa_mask;
+};
extern int __syscall_sigaction (int, const struct old_kernel_sigaction *,
struct old_kernel_sigaction *);
-extern int __syscall_rt_sigaction (int, const struct sigaction *,
- struct sigaction *, size_t);
+extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *,
+ struct kernel_sigaction *, size_t);
/* The variable is shared between all wrappers around signal handling
functions which have RT equivalents. */
struct sigaction *oact;
{
struct old_kernel_sigaction k_sigact, k_osigact;
- int error;
+ int result;
/* First try the RT signals. */
if (!__libc_missing_rt_sigs)
{
+ struct kernel_sigaction kact, koact;
+
+ if (act)
+ {
+ kact.k_sa_handler = act->sa_handler;
+ memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
+ kact.sa_flags = act->sa_flags;
+#ifdef HAVE_SA_RESTORER
+ kact.sa_restorer = act->sa_restorer;
+#endif
+ }
+
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- int result = __syscall_rt_sigaction (sig, act, oact, _NSIG / 8);
+ result = __syscall_rt_sigaction (sig, act ? &kact : 0,
+ oact ? &koact : 0, _NSIG / 8);
if (result >= 0 || errno != ENOSYS)
- return result;
+ {
+ if (oact && result >= 0)
+ {
+ oact->sa_handler = koact.k_sa_handler;
+ memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
+ oact->sa_flags = koact.sa_flags;
+#ifdef HAVE_SA_RESTORER
+ oact->sa_restorer = koact.sa_restorer;
+#endif
+ }
+ return result;
+ }
__libc_missing_rt_sigs = 1;
}
k_sigact.sa_restorer = act->sa_restorer;
#endif
}
- error = __syscall_sigaction (sig, act ? &k_sigact : 0,
+ result = __syscall_sigaction (sig, act ? &k_sigact : 0,
oact ? &k_osigact : 0);
- if (oact && error >= 0)
+ if (oact && result >= 0)
{
oact->sa_handler = k_osigact.k_sa_handler;
oact->sa_mask.__val[0] = k_osigact.sa_mask;
oact->sa_restorer = k_osigact.sa_restorer;
#endif
}
- return error;
+ return result;
}
weak_alias (__sigaction, sigaction)