From f2fad0ae26d274bd203ba350a66b6f2bec3f6740 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sun, 21 Nov 2004 11:37:07 +0000 Subject: [PATCH] Updated to fedora-glibc-20041121T1116 --- ChangeLog | 18 +++++ fedora/branch.mk | 4 +- misc/syslog.c | 14 ++-- signal/signal.h | 38 ++++++----- sysdeps/unix/sysv/linux/sh/sys/procfs.h | 115 ++++++++++++++++++++++++++++++++ time/tzfile.c | 23 ++++--- 6 files changed, 174 insertions(+), 38 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/sh/sys/procfs.h diff --git a/ChangeLog b/ChangeLog index 956684e507..50df131fd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,23 @@ 2004-11-20 Ulrich Drepper + * time/tzfile.c (__tzfile_read): Avoid open for checking whether + the file we already use changed. + + * misc/syslog.c: Remove !USE_IN_LIBIO code. + +2004-11-20 Jakub Jelinek + + * signal/signal.h (__sysv_signal, sysv_signal, signal, bsd_signal, + ssignal): Remove __nonnull attribute. + +2004-11-20 Kaz Kojima + + * sysdeps/unix/sysv/linux/sh/sys/procfs.h: New file. + +2004-11-20 Ulrich Drepper + + * signal/signal.h: Add nonnull attributes. + * signal/signal.h: Add deprecated attributes to sigstack, sigpause, sigblock, sigsetmask, siggetmask. diff --git a/fedora/branch.mk b/fedora/branch.mk index dda0e2564a..072780bdb9 100644 --- a/fedora/branch.mk +++ b/fedora/branch.mk @@ -1,5 +1,5 @@ # This file is updated automatically by Makefile. glibc-branch := fedora glibc-base := HEAD -fedora-sync-date := 2004-11-20 09:49 UTC -fedora-sync-tag := fedora-glibc-20041120T0949 +fedora-sync-date := 2004-11-21 11:16 UTC +fedora-sync-tag := fedora-glibc-20041121T1116 diff --git a/misc/syslog.c b/misc/syslog.c index 38d5a8e5f5..6916356da7 100644 --- a/misc/syslog.c +++ b/misc/syslog.c @@ -56,10 +56,8 @@ static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94"; #include #endif -#ifdef USE_IN_LIBIO -# include -# define ftell(s) INTUSE(_IO_ftell) (s) -#endif +#include +#define ftell(s) INTUSE(_IO_ftell) (s) static int LogType = SOCK_DGRAM; /* type of socket connection */ static int LogFile = -1; /* fd for log */ @@ -187,16 +185,12 @@ vsyslog(pri, fmt, ap) __fsetlocking (f, FSETLOCKING_BYCALLER); prioff = fprintf (f, "<%d>", pri); (void) time (&now); -#ifdef USE_IN_LIBIO f->_IO_write_ptr += __strftime_l (f->_IO_write_ptr, - f->_IO_write_end - f->_IO_write_ptr, + f->_IO_write_end + - f->_IO_write_ptr, "%h %e %T ", __localtime_r (&now, &now_tm), &_nl_C_locobj); -#else - f->__bufp += strftime (f->__bufp, f->__put_limit - f->__bufp, - "%h %e %T ", __localtime_r (&now, &now_tm)); -#endif msgoff = ftell (f); if (LogTag == NULL) LogTag = __progname; diff --git a/signal/signal.h b/signal/signal.h index 76c0f67a8f..ed39328efb 100644 --- a/signal/signal.h +++ b/signal/signal.h @@ -89,7 +89,8 @@ extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler) By default `signal' has the BSD semantic. */ __BEGIN_NAMESPACE_STD #ifdef __USE_BSD -extern __sighandler_t signal (int __sig, __sighandler_t __handler) __THROW; +extern __sighandler_t signal (int __sig, __sighandler_t __handler) + __THROW; #else /* Make sure the used `signal' implementation is the SVID version. */ # ifdef __REDIRECT_NTH @@ -105,7 +106,8 @@ __END_NAMESPACE_STD #ifdef __USE_XOPEN /* The X/Open definition of `signal' conflicts with the BSD version. So they defined another function `bsd_signal'. */ -extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler) __THROW; +extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler) + __THROW; #endif /* Send signal SIG to process number PID. If PID is zero, @@ -129,7 +131,8 @@ __END_NAMESPACE_STD #ifdef __USE_SVID /* SVID names for the same things. */ -extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) __THROW; +extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) + __THROW; extern int gsignal (int __sig) __THROW; #endif /* Use SVID. */ @@ -210,31 +213,32 @@ typedef __sighandler_t sig_t; # endif /* Clear all signals from SET. */ -extern int sigemptyset (sigset_t *__set) __THROW; +extern int sigemptyset (sigset_t *__set) __THROW __nonnull ((1)); /* Set all signals in SET. */ -extern int sigfillset (sigset_t *__set) __THROW; +extern int sigfillset (sigset_t *__set) __THROW __nonnull ((1)); /* Add SIGNO to SET. */ -extern int sigaddset (sigset_t *__set, int __signo) __THROW; +extern int sigaddset (sigset_t *__set, int __signo) __THROW __nonnull ((1)); /* Remove SIGNO from SET. */ -extern int sigdelset (sigset_t *__set, int __signo) __THROW; +extern int sigdelset (sigset_t *__set, int __signo) __THROW __nonnull ((1)); /* Return 1 if SIGNO is in SET, 0 if not. */ -extern int sigismember (__const sigset_t *__set, int __signo) __THROW; +extern int sigismember (__const sigset_t *__set, int __signo) + __THROW __nonnull ((1)); # ifdef __USE_GNU /* Return non-empty value is SET is not empty. */ -extern int sigisemptyset (__const sigset_t *__set) __THROW; +extern int sigisemptyset (__const sigset_t *__set) __THROW __nonnull ((1)); /* Build new signal set by combining the two inputs set using logical AND. */ extern int sigandset (sigset_t *__set, __const sigset_t *__left, - __const sigset_t *__right) __THROW; + __const sigset_t *__right) __THROW __nonnull ((1, 2, 3)); /* Build new signal set by combining the two inputs set using logical OR. */ extern int sigorset (sigset_t *__set, __const sigset_t *__left, - __const sigset_t *__right) __THROW; + __const sigset_t *__right) __THROW __nonnull ((1, 2, 3)); # endif /* GNU */ /* Get the system-specific definitions of `struct sigaction' @@ -250,21 +254,22 @@ extern int sigprocmask (int __how, __const sigset_t *__restrict __set, This function is a cancellation point and therefore not marked with __THROW. */ -extern int sigsuspend (__const sigset_t *__set); +extern int sigsuspend (__const sigset_t *__set) __nonnull ((1)); /* Get and/or set the action for signal SIG. */ extern int sigaction (int __sig, __const struct sigaction *__restrict __act, struct sigaction *__restrict __oact) __THROW; /* Put in SET all signals that are blocked and waiting to be delivered. */ -extern int sigpending (sigset_t *__set) __THROW; +extern int sigpending (sigset_t *__set) __THROW __nonnull ((1)); /* Select any of pending signals from SET or wait for any to arrive. This function is a cancellation point and therefore not marked with __THROW. */ -extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig); +extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig) + __nonnull ((1, 2)); # ifdef __USE_POSIX199309 /* Select any of pending signals from SET and place information in INFO. @@ -272,7 +277,7 @@ extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig); This function is a cancellation point and therefore not marked with __THROW. */ extern int sigwaitinfo (__const sigset_t *__restrict __set, - siginfo_t *__restrict __info); + siginfo_t *__restrict __info) __nonnull ((1)); /* Select any of pending signals from SET and place information in INFO. Wait the time specified by TIMEOUT if no signal is pending. @@ -281,7 +286,8 @@ extern int sigwaitinfo (__const sigset_t *__restrict __set, __THROW. */ extern int sigtimedwait (__const sigset_t *__restrict __set, siginfo_t *__restrict __info, - __const struct timespec *__restrict __timeout); + __const struct timespec *__restrict __timeout) + __nonnull ((1)); /* Send signal SIG to the process PID. Associate data in VAL with the signal. */ diff --git a/sysdeps/unix/sysv/linux/sh/sys/procfs.h b/sysdeps/unix/sysv/linux/sh/sys/procfs.h new file mode 100644 index 0000000000..8651ccb346 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h @@ -0,0 +1,115 @@ +/* Copyright (C) 1996, 1997, 1999, 2004 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _SYS_PROCFS_H +#define _SYS_PROCFS_H 1 + +/* This is somehow modelled after the file of the same name on SysVr4 + systems. It provides a definition of the core file format for ELF + used on Linux. */ + +#include +#include +#include +#include +#include +#include +#include + +__BEGIN_DECLS + +struct elf_siginfo + { + int si_signo; /* Signal number. */ + int si_code; /* Extra code. */ + int si_errno; /* Errno. */ + }; + +/* Definitions to generate Intel SVR4-like core files. These mostly + have the same names as the SVR4 types with "elf_" tacked on the + front to prevent clashes with linux definitions, and the typedef + forms have been avoided. This is mostly like the SVR4 structure, + but more Linuxy, with things that Linux does not support and which + gdb doesn't really use excluded. Fields present but not used are + marked with "XXX". */ +struct elf_prstatus + { +#if 0 + long int pr_flags; /* XXX Process flags. */ + short int pr_why; /* XXX Reason for process halt. */ + short int pr_what; /* XXX More detailed reason. */ +#endif + struct elf_siginfo pr_info; /* Info associated with signal. */ + short int pr_cursig; /* Current signal. */ + unsigned long int pr_sigpend; /* Set of pending signals. */ + unsigned long int pr_sighold; /* Set of held signals. */ +#if 0 + struct sigaltstack pr_altstack; /* Alternate stack info. */ + struct sigaction pr_action; /* Signal action for current sig. */ +#endif + __pid_t pr_pid; + __pid_t pr_ppid; + __pid_t pr_pgrp; + __pid_t pr_sid; + struct timeval pr_utime; /* User time. */ + struct timeval pr_stime; /* System time. */ + struct timeval pr_cutime; /* Cumulative user time. */ + struct timeval pr_cstime; /* Cumulative system time. */ +#if 0 + long int pr_instr; /* Current instruction. */ +#endif + elf_gregset_t pr_reg; /* GP registers. */ + int pr_fpvalid; /* True if math copro being used. */ + }; + + +#define ELF_PRARGSZ (80) /* Number of chars for args */ + +struct elf_prpsinfo + { + char pr_state; /* Numeric process state. */ + char pr_sname; /* Char for pr_state. */ + char pr_zomb; /* Zombie. */ + char pr_nice; /* Nice val. */ + unsigned long int pr_flag; /* Flags. */ + unsigned short int pr_uid; + unsigned short int pr_gid; + int pr_pid, pr_ppid, pr_pgrp, pr_sid; + /* Lots missing */ + char pr_fname[16]; /* Filename of executable. */ + char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ + }; + +/* Addresses. */ +typedef void *psaddr_t; + +/* Register sets. Linux has different names. */ +typedef elf_gregset_t prgregset_t; +typedef elf_fpregset_t prfpregset_t; + +/* We don't have any differences between processes and threads, + therefore habe only ine PID type. */ +typedef __pid_t lwpid_t; + + +typedef struct elf_prstatus prstatus_t; +typedef struct elf_prpsinfo prpsinfo_t; + +__END_DECLS + +#endif /* sys/procfs.h */ diff --git a/time/tzfile.c b/time/tzfile.c index 48c1e4d790..e95fd55f36 100644 --- a/time/tzfile.c +++ b/time/tzfile.c @@ -149,27 +149,30 @@ __tzfile_read (const char *file, size_t extra, char **extrap) file = new; } + /* If we were already using tzfile, check whether the file changed. */ + struct stat64 st; + if (was_using_tzfile + && stat64 (file, &st) == 0 + && tzfile_ino == st.st_ino && tzfile_dev == st.st_dev + && tzfile_mtime == st.st_mtime) + { + /* Nothing to do. */ + __use_tzfile = 1; + return; + } + /* Note the file is opened with cancellation in the I/O functions disabled. */ f = fopen (file, "rc"); if (f == NULL) goto ret_free_transitions; - /* Get information about the file. */ - struct stat64 st; + /* Get information about the file we are actually using. */ if (fstat64 (fileno (f), &st) != 0) { fclose (f); goto ret_free_transitions; } - if (was_using_tzfile && tzfile_ino == st.st_ino && tzfile_dev == st.st_dev - && tzfile_mtime == st.st_mtime) - { - /* It's the same file. No further work needed. */ - fclose (f); - __use_tzfile = 1; - return; - } free ((void *) transitions); transitions = NULL; -- 2.11.4.GIT