From ab58d6203b8322bcfa253923d86c991c1f6a4294 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 22 Aug 1999 16:26:00 +0000 Subject: Update. 1999-08-21 Mark Kettenis * stdio-common/vfscanf.c [! USE_IN_LIBIO]: Add necessary definitions for MEMCPY, ISSPACE, ISDIGIT, ISXDIGIT, TOLOWER, L_, CHAR_T, UCHAR_T and WIN_T to make the code compile again when stdio is used instead of libio. * stdio-common/vfprintf.c [! USE_IN_LIBIO]: Add necessary definitions for CHAR_T, UCHAR_T, INT_T, L_, ISDIGIT, PAD and PUTC to make the code compile again when stdio is used instead of libio. (vfprintf): Only check for correct orientation if ORIENT is defined. * stdio-common/Makefile (routines): Only add vfwprintf and vfwscanf if we're using libio. 1999-08-21 Mark Kettenis * include/stdio.h [! USE_IN_LIBIO && __need_FILE]: Avoid defining any additional prototype just as we do for libio. 1999-08-21 Mark Kettenis * include/bits/xopen_lim.h: Do not define STREAM_MAX and TZNAME_MAX. These limits are not X/Open specific. * stdio-common/stdio_lim.h.in: Allow inclusion when __need_IOV_MAX is defined. 1999-08-21 Mark Kettenis * Rules: When generated stdio_lim.h, avoid defining IOV_MAX if UIO_MAXIOV is left undefined in sys/uio.h. * stdio-common/stdio_lim.h.in: Adapt for change above. 1999-08-21 Andreas Jaeger * sysdeps/unix/sysv/linux/mips/bits/sigaction.h (SA_RESETHAND): Add it. * sysdeps/mips/bits/dlfcn.h: Remove SGI specific calls, add RTLD_LOCAL. Patches by Ralf Baechle --- ChangeLog | 39 +++++++++++++++++++++++++++ Rules | 8 ++++-- include/bits/xopen_lim.h | 14 +++++----- include/stdio.h | 34 ++++++++++++----------- stdio-common/Makefile | 2 +- stdio-common/stdio_lim.h.in | 4 +-- stdio-common/vfprintf.c | 26 +++++++++++++++--- stdio-common/vfscanf.c | 11 ++++++++ sysdeps/mips/bits/dlfcn.h | 13 +++------ sysdeps/unix/sysv/linux/mips/bits/sigaction.h | 3 ++- 10 files changed, 113 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index 542f0cf..8e2b182 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,42 @@ +1999-08-21 Mark Kettenis + + * stdio-common/vfscanf.c [! USE_IN_LIBIO]: Add necessary + definitions for MEMCPY, ISSPACE, ISDIGIT, ISXDIGIT, TOLOWER, L_, + CHAR_T, UCHAR_T and WIN_T to make the code compile again when + stdio is used instead of libio. + * stdio-common/vfprintf.c [! USE_IN_LIBIO]: Add necessary + definitions for CHAR_T, UCHAR_T, INT_T, L_, ISDIGIT, PAD and PUTC + to make the code compile again when stdio is used instead of + libio. + (vfprintf): Only check for correct orientation if ORIENT is + defined. + * stdio-common/Makefile (routines): Only add vfwprintf and + vfwscanf if we're using libio. + +1999-08-21 Mark Kettenis + + * include/stdio.h [! USE_IN_LIBIO && __need_FILE]: Avoid defining + any additional prototype just as we do for libio. + +1999-08-21 Mark Kettenis + + * include/bits/xopen_lim.h: Do not define STREAM_MAX and + TZNAME_MAX. These limits are not X/Open specific. + * stdio-common/stdio_lim.h.in: Allow inclusion when __need_IOV_MAX + is defined. + +1999-08-21 Mark Kettenis + + * Rules: When generated stdio_lim.h, avoid defining IOV_MAX if + UIO_MAXIOV is left undefined in sys/uio.h. + * stdio-common/stdio_lim.h.in: Adapt for change above. + +1999-08-21 Andreas Jaeger + + * sysdeps/unix/sysv/linux/mips/bits/sigaction.h (SA_RESETHAND): Add it. + * sysdeps/mips/bits/dlfcn.h: Remove SGI specific calls, add RTLD_LOCAL. + Patches by Ralf Baechle + 1999-08-21 Ulrich Drepper * stdlib/fmtmsg.h: Don't define NULL to keep namespace clean. diff --git a/Rules b/Rules index 2a54a39..adcddc6 100644 --- a/Rules +++ b/Rules @@ -205,14 +205,18 @@ endif iov_max=`sed -n 's/^#define UIO_MAXIOV //p' $(@:st=hT)`; \ fopen_max=$${fopen_max:-16}; \ filename_max=$${filename_max:-1024}; \ - iov_max=$${iov_max:-_XOPEN_IOV_MAX}; \ + if [ -z $$iov_max ]; then \ + define_iov_max="# undef IOV_MAX"; \ + else \ + define_iov_max="# define IOV_MAX $$iov_max"; \ + fi; \ sed -e "s/@FOPEN_MAX@/$$fopen_max/" \ -e "s/@FILENAME_MAX@/$$filename_max/" \ -e "s/@L_tmpnam@/$(L_tmpnam)/" \ -e "s/@TMP_MAX@/$(TMP_MAX)/" \ -e "s/@L_ctermid@/$(L_ctermid)/" \ -e "s/@L_cuserid@/$(L_cuserid)/" \ - -e "s/@IOV_MAX@/$$iov_max/" \ + -e "s/@define_IOV_MAX@/$$define_iov_max/" \ $< > $(@:st=h.new) $(move-if-change) $(@:st=h.new) $(@:st=h) # Remove these last so that they can be examined if something went wrong. diff --git a/include/bits/xopen_lim.h b/include/bits/xopen_lim.h index 607c50b..e1f0a44 100644 --- a/include/bits/xopen_lim.h +++ b/include/bits/xopen_lim.h @@ -45,9 +45,6 @@ CHILD_MAX Maximum number of simultaneous processes per real user ID. - IOV_MAX Maximum number of `iovec' structures that one process has - available for use with `readv' or writev'. - OPEN_MAX Maximum number of files that one process can have open at anyone time. @@ -55,13 +52,14 @@ PAGE_SIZE Size of bytes of a page. PASS_MAX Maximum number of significant bytes in a password. -*/ -/* The number of streams that one process can have open at one time. */ -#define STREAM_MAX FOPEN_MAX + We only provide a fixed limit for -/* Maximum number of bytes supported for the name of a time zone. */ -#define TZNAME_MAX _POSIX_TZNAME_MAX + IOV_MAX Maximum number of `iovec' structures that one process has + available for use with `readv' or writev'. + + if this is indeed fixed by the underlying system. +*/ /* Maximum number of `iovec' structures that one process has available diff --git a/include/stdio.h b/include/stdio.h index eff125f..5a80563 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -1,9 +1,13 @@ #ifndef _STDIO_H -#ifdef USE_IN_LIBIO -#ifdef __need_FILE -# include -#else -# include +# ifdef __need_FILE +# ifdef USE_IN_LIBIO +# include +# else +# include +# endif +# else +# ifdef USE_IN_LIBIO +# include /* Now define the internal interfaces. */ extern int __fcloseall __P ((void)); @@ -24,13 +28,12 @@ extern int __vsscanf __P ((__const char *__restrict __s, _G_va_list __arg)) __attribute__ ((__format__ (__scanf__, 2, 0))); -#endif -#else -#include -#endif +# else +# include +# endif -# define __need_size_t -# include +# define __need_size_t +# include /* Generate a unique file name (and possibly open it). */ extern int __path_search __P ((char *__tmpl, size_t __tmpl_len, __const char *__dir, __const char *__pfx, @@ -38,14 +41,15 @@ extern int __path_search __P ((char *__tmpl, size_t __tmpl_len, extern int __gen_tempname __P ((char *__tmpl, int __kind)); /* The __kind argument to __gen_tempname may be one of: */ -#define __GT_FILE 0 /* create a file */ -#define __GT_BIGFILE 1 /* create a file, using open64 */ -#define __GT_DIR 2 /* create a directory */ -#define __GT_NOCREATE 3 /* just find a name not currently in use */ +# define __GT_FILE 0 /* create a file */ +# define __GT_BIGFILE 1 /* create a file, using open64 */ +# define __GT_DIR 2 /* create a directory */ +# define __GT_NOCREATE 3 /* just find a name not currently in use */ /* Print out MESSAGE on the error output and abort. */ extern void __libc_fatal __P ((__const char *__message)) __attribute__ ((__noreturn__)); +# endif #endif diff --git a/stdio-common/Makefile b/stdio-common/Makefile index 2ca21c5..75ec880 100644 --- a/stdio-common/Makefile +++ b/stdio-common/Makefile @@ -30,7 +30,6 @@ routines := \ printf_size fprintf printf snprintf sprintf asprintf dprintf \ vfscanf \ fscanf scanf sscanf \ - vfwprintf vfwscanf \ perror psignal \ tmpfile tmpfile64 tmpnam tmpnam_r tempnam tempname \ getline getw putw \ @@ -66,6 +65,7 @@ $(inst_includedir)/bits/stdio_lim.h: $(common-objpfx)bits/stdio_lim.h $(do-install) ifeq ($(stdio),libio) +routines += vfwprintf vfwscanf ifneq (,$(filter %REENTRANT, $(defines))) CPPFLAGS += -D_IO_MTSAFE_IO endif diff --git a/stdio-common/stdio_lim.h.in b/stdio-common/stdio_lim.h.in index 5527296..e80867a 100644 --- a/stdio-common/stdio_lim.h.in +++ b/stdio-common/stdio_lim.h.in @@ -16,7 +16,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if !defined _STDIO_H && !defined __need_FOPEN_MAX +#if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX # error "Never include directly; use instead." #endif @@ -37,5 +37,5 @@ #endif #if defined __need_IOV_MAX && !defined IOV_MAX -# define IOV_MAX @IOV_MAX@ +@define_IOV_MAX@ #endif diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index d45e7d9..9a8ebab 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -104,7 +104,6 @@ #else /* ! USE_IN_LIBIO */ /* This code is for use in the GNU C library. */ # include -# define PUT(F, S, N) fwrite (S, 1, N, F) # define ARGCHECK(S, Format) \ do \ { \ @@ -128,6 +127,25 @@ while (0) # define UNBUFFERED_P(s) ((s)->__buffer == NULL) +# define CHAR_T char +# define UCHAR_T unsigned char +# define INT_T int +# define L_(Str) Str +# define ISDIGIT(Ch) isdigit (Ch) + +# define PUT(F, S, N) fwrite (S, 1, N, F) +ssize_t __printf_pad __P ((FILE *, char pad, size_t n)); +# define PAD(Padchar) \ + if (width > 0) \ + { ssize_t __res = __printf_pad (s, (Padchar), width); \ + if (__res == -1) \ + { \ + done = -1; \ + goto all_done; \ + } \ + done += __res; } +# define PUTC(C, F) putc (C, F) + /* XXX These declarations should go as soon as the stdio header files have these prototypes. */ extern void __flockfile (FILE *); @@ -1155,15 +1173,17 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) /* Sanity check of arguments. */ ARGCHECK (s, format); +#ifdef ORIENT /* Check for correct orientation. */ if ( -#ifdef USE_IN_LIBIO +# ifdef USE_IN_LIBIO s->_vtable_offset == 0 && -#endif +# endif _IO_fwide (s, sizeof (CHAR_T) == 1 ? -1 : 1) != (sizeof (CHAR_T) == 1 ? -1 : 1)) /* The stream is already oriented otherwise. */ return EOF; +#endif if (UNBUFFERED_P (s)) /* Use a helper function which will allocate a local temporary buffer diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c index e7dc805..a6e3bb2 100644 --- a/stdio-common/vfscanf.c +++ b/stdio-common/vfscanf.c @@ -169,6 +169,17 @@ # define ungetc(c, s) ((void) (c != EOF && --read_in), ungetc (c, s)) # define inchar() (c == EOF ? EOF \ : ((c = getc (s)), (void) (c != EOF && ++read_in), c)) +# define MEMCPY(d, s, n) memcpy (d, s, n) +# define ISSPACE(Ch) isspace (Ch) +# define ISDIGIT(Ch) isdigit (Ch) +# define ISXDIGIT(Ch) isxdigit (Ch) +# define TOLOWER(Ch) tolower (Ch) + +# define L_(Str) Str +# define CHAR_T char +# define UCHAR_T unsigned char +# define WINT_T int + # define encode_error() do { \ funlockfile (s); \ __set_errno (EILSEQ); \ diff --git a/sysdeps/mips/bits/dlfcn.h b/sysdeps/mips/bits/dlfcn.h index 8477b53..2939d9e 100644 --- a/sysdeps/mips/bits/dlfcn.h +++ b/sysdeps/mips/bits/dlfcn.h @@ -31,12 +31,7 @@ visible as if the object were linked directly into the program. */ #define RTLD_GLOBAL 0x004 -__BEGIN_DECLS - -/* Some SGI specific calls that aren't implemented yet. */ -extern void *sgidladd __P ((__const char *, int)); -extern void *sgidlopen_version __P ((__const char *, int, __const char *, - int)); -extern char *sgigetdsoversion __P ((__const char *)); - -__END_DECLS +/* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. + The implementation does this by default and so we can define the + value to zero. */ +#define RTLD_LOCAL 0 diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h index 855fe28..8d08027 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h +++ b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h @@ -1,5 +1,5 @@ /* The proper definitions for Linux/MIPS's sigaction. - Copyright (C) 1993, 1994, 1995, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1993, 94, 95, 97, 98, 99 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 @@ -60,6 +60,7 @@ struct sigaction three arguments instead of one. */ #if defined __USE_UNIX98 || defined __USE_MISC # define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ +# define SA_RESETHAND 0x00000002 /* Reset to SIG_DFL on entry to handler. */ # define SA_RESTART 0x00000004 /* Restart syscall on signal return. */ # define SA_NODEFER 0x00000010 /* Don't automatically block the signal when its handler is being executed. */ -- cgit v1.1