+2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ * modules/argmatch, modules/argp, modules/closeout, modules/error,
+ modules/exclude, modules/getdate, modules/getline,
+ modules/getndelim2, modules/getpass, modules/getpass-gnu,
+ modules/getusershell, modules/linebuffer, modules/md5,
+ modules/mountlist, modules/posixtm, modules/readtokens,
+ modules/readutmp, modules/regex, modules/sha1,
+ modules/version-etc, modules/yesno:
+ Remove dependency on unlocked-io.
+
2004-10-04 Bruno Haible <bruno@clisp.org>
* modules/README: New file.
* gnulib-tool (func_all_modules, func_verify_module): modules/README is
not a module.
-2004-10-01 Simon Josefsson <jas@extundo.com>
+2004-10-04 Simon Josefsson <jas@extundo.com>
* modules/memmem: New file.
* tests/test-memmem.c: New file.
-2004-10-01 Simon Josefsson <jas@extundo.com>
-
- * memmem.h: New file.
- * memmem.c: New file, taken from glibc.
+2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
-2004-10-03 Paul Eggert <eggert@cs.ucla.edu>
+ * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
+ getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
+ md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
+ regex.c, sha1.c, version-etc.c, yesno.c:
+ Include "unlocked-io.h" only if USE_UNLOCKED_IO.
+ * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
+ the includer's responsibility.
Sync from coreutils.
* .cppi-disable: Add getopt_.h, getopt_int.h.
* .cvsignore: Add getopt.h.
+2004-10-04 Simon Josefsson <jas@extundo.com>
+
+ * memmem.h: New file.
+ * memmem.c: New file, taken from glibc.
+
2004-10-02 Jim Meyering <jim@meyering.net>
* dirfd.h, getpagesize.h: Add copyright notice.
#include "exit.h"
#include "quotearg.h"
#include "quote.h"
-#include "unlocked-io.h"
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
/* When reporting an invalid argument, show nonprinting characters
by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use
#include "error.h"
#include "exitfail.h"
#include "quotearg.h"
-#include "unlocked-io.h"
#include "__fpending.h"
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
static const char *file_name;
/* Set the file name to be reported in the event an error is detected
# define mbsrtowcs __mbsrtowcs
#endif
-#if !_LIBC
+#ifdef USE_UNLOCKED_IO
# include "unlocked-io.h"
#endif
#include "exclude.h"
#include "fnmatch.h"
-#include "unlocked-io.h"
#include "xalloc.h"
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
#if STDC_HEADERS || (! defined isascii && ! HAVE_ISASCII)
# define IN_CTYPE_DOMAIN(c) true
#else
#include <string.h>
-#include "unlocked-io.h"
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
# define __attribute__(x)
#include <stdlib.h>
#include <stddef.h>
-#include "unlocked-io.h"
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
#include <limits.h>
#if HAVE_INTTYPES_H
-/* Copyright (C) 1992-2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2001, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
#if _LIBC
# define flockfile(s) _IO_flockfile (s)
# define funlockfile(s) _IO_funlockfile (s)
-#else
+#elif USE_UNLOCKED_IO
# include "unlocked-io.h"
#endif
/* getusershell.c -- Return names of valid user shells.
- Copyright (C) 1991, 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
+
+ Copyright (C) 1991, 1997, 2000, 2001, 2003, 2004 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
-#include "unlocked-io.h"
+
#include "xalloc.h"
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define IN_CTYPE_DOMAIN(c) 1
#else
/* linebuffer.c -- read arbitrarily long lines
- Copyright (C) 1986, 1991, 1998, 1999, 2001, 2003 Free Software
- Foundation, Inc.
+ Copyright (C) 1986, 1991, 1998, 1999, 2001, 2003, 2004 Free
+ Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <string.h>
#include <sys/types.h>
#include "linebuffer.h"
-#include "unlocked-io.h"
#include "xalloc.h"
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
/* Initialize linebuffer LINEBUFFER for use. */
void
#include <stddef.h>
#include <string.h>
-#include "unlocked-io.h"
+#ifdef USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
#ifdef _LIBC
# include <endian.h>
#endif
#include "mountlist.h"
-#include "unlocked-io.h"
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
#endif
#include "posixtm.h"
-#include "unlocked-io.h"
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
/* ISDIGIT differs from isdigit, as follows:
- Its arg may be any int or unsigned int; it need not be an unsigned char.
#include <string.h>
#include <stdbool.h>
-#include "unlocked-io.h"
#include "xalloc.h"
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
#define STREQ(a,b) ((a) == (b) || ((a) && (b) && *(a) == *(b) \
&& strcmp(a, b) == 0))
#include <stdlib.h>
#include "readutmp.h"
-#include "unlocked-io.h"
#include "xalloc.h"
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
/* Copy UT->ut_name into storage obtained from malloc. Then remove any
trailing spaces from the copy, NUL terminate it, and return the copy. */
# undef INSIDE_RECURSION
# endif
#endif
-#include "unlocked-io.h"
+
+#ifdef USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
#ifdef INSIDE_RECURSION
/* Common operations on the compiled pattern. */
#include <stddef.h>
#include <string.h>
-#include "unlocked-io.h"
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
/*
Not-swap is a macro that does an endian swap on architectures that are
/* Prefer faster, non-thread-safe stdio functions if available.
- Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Written by Jim Meyering. */
#ifndef UNLOCKED_IO_H
-# define UNLOCKED_IO_H 1
-
-# ifndef USE_UNLOCKED_IO
-# define USE_UNLOCKED_IO 1
-# endif
-
-# if USE_UNLOCKED_IO
+#define UNLOCKED_IO_H 1
/* These are wrappers for functions/macros from the GNU C library, and
from other C libraries supporting POSIX's optional thread-safe functions.
the *_unlocked functions directly. On hosts that lack those
functions, invoke the non-thread-safe versions instead. */
-# include <stdio.h>
-
-# if HAVE_DECL_CLEARERR_UNLOCKED
-# undef clearerr
-# define clearerr(x) clearerr_unlocked (x)
-# else
-# define clearerr_unlocked(x) clearerr (x)
-# endif
-# if HAVE_DECL_FEOF_UNLOCKED
-# undef feof
-# define feof(x) feof_unlocked (x)
-# else
-# define feof_unlocked(x) feof (x)
-# endif
-# if HAVE_DECL_FERROR_UNLOCKED
-# undef ferror
-# define ferror(x) ferror_unlocked (x)
-# else
-# define ferror_unlocked(x) ferror (x)
-# endif
-# if HAVE_DECL_FFLUSH_UNLOCKED
-# undef fflush
-# define fflush(x) fflush_unlocked (x)
-# else
-# define fflush_unlocked(x) fflush (x)
-# endif
-# if HAVE_DECL_FGETS_UNLOCKED
-# undef fgets
-# define fgets(x,y,z) fgets_unlocked (x,y,z)
-# else
-# define fgets_unlocked(x,y,z) fgets (x,y,z)
-# endif
-# if HAVE_DECL_FPUTC_UNLOCKED
-# undef fputc
-# define fputc(x,y) fputc_unlocked (x,y)
-# else
-# define fputc_unlocked(x,y) fputc (x,y)
-# endif
-# if HAVE_DECL_FPUTS_UNLOCKED
-# undef fputs
-# define fputs(x,y) fputs_unlocked (x,y)
-# else
-# define fputs_unlocked(x,y) fputs (x,y)
-# endif
-# if HAVE_DECL_FREAD_UNLOCKED
-# undef fread
-# define fread(w,x,y,z) fread_unlocked (w,x,y,z)
-# else
-# define fread_unlocked(w,x,y,z) fread (w,x,y,z)
-# endif
-# if HAVE_DECL_FWRITE_UNLOCKED
-# undef fwrite
-# define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
-# else
-# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
-# endif
-# if HAVE_DECL_GETC_UNLOCKED
-# undef getc
-# define getc(x) getc_unlocked (x)
-# else
-# define getc_unlocked(x) getc (x)
-# endif
-# if HAVE_DECL_GETCHAR_UNLOCKED
-# undef getchar
-# define getchar() getchar_unlocked ()
-# else
-# define getchar_unlocked() getchar ()
-# endif
-# if HAVE_DECL_PUTC_UNLOCKED
-# undef putc
-# define putc(x,y) putc_unlocked (x,y)
-# else
-# define putc_unlocked(x,y) putc (x,y)
-# endif
-# if HAVE_DECL_PUTCHAR_UNLOCKED
-# undef putchar
-# define putchar(x) putchar_unlocked (x)
-# else
-# define putchar_unlocked(x) putchar (x)
-# endif
-
-# undef flockfile
-# define flockfile(x) ((void) 0)
-
-# undef ftrylockfile
-# define ftrylockfile(x) 0
-
-# undef funlockfile
-# define funlockfile(x) ((void) 0)
-
-# endif /* USE_UNLOCKED_IO */
+#include <stdio.h>
+
+#if HAVE_DECL_CLEARERR_UNLOCKED
+# undef clearerr
+# define clearerr(x) clearerr_unlocked (x)
+#else
+# define clearerr_unlocked(x) clearerr (x)
+#endif
+
+#if HAVE_DECL_FEOF_UNLOCKED
+# undef feof
+# define feof(x) feof_unlocked (x)
+#else
+# define feof_unlocked(x) feof (x)
+#endif
+
+#if HAVE_DECL_FERROR_UNLOCKED
+# undef ferror
+# define ferror(x) ferror_unlocked (x)
+#else
+# define ferror_unlocked(x) ferror (x)
+#endif
+
+#if HAVE_DECL_FFLUSH_UNLOCKED
+# undef fflush
+# define fflush(x) fflush_unlocked (x)
+#else
+# define fflush_unlocked(x) fflush (x)
+#endif
+
+#if HAVE_DECL_FGETS_UNLOCKED
+# undef fgets
+# define fgets(x,y,z) fgets_unlocked (x,y,z)
+#else
+# define fgets_unlocked(x,y,z) fgets (x,y,z)
+#endif
+
+#if HAVE_DECL_FPUTC_UNLOCKED
+# undef fputc
+# define fputc(x,y) fputc_unlocked (x,y)
+#else
+# define fputc_unlocked(x,y) fputc (x,y)
+#endif
+
+#if HAVE_DECL_FPUTS_UNLOCKED
+# undef fputs
+# define fputs(x,y) fputs_unlocked (x,y)
+#else
+# define fputs_unlocked(x,y) fputs (x,y)
+#endif
+
+#if HAVE_DECL_FREAD_UNLOCKED
+# undef fread
+# define fread(w,x,y,z) fread_unlocked (w,x,y,z)
+#else
+# define fread_unlocked(w,x,y,z) fread (w,x,y,z)
+#endif
+
+#if HAVE_DECL_FWRITE_UNLOCKED
+# undef fwrite
+# define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
+#else
+# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
+#endif
+
+#if HAVE_DECL_GETC_UNLOCKED
+# undef getc
+# define getc(x) getc_unlocked (x)
+#else
+# define getc_unlocked(x) getc (x)
+#endif
+
+#if HAVE_DECL_GETCHAR_UNLOCKED
+# undef getchar
+# define getchar() getchar_unlocked ()
+#else
+# define getchar_unlocked() getchar ()
+#endif
+
+#if HAVE_DECL_PUTC_UNLOCKED
+# undef putc
+# define putc(x,y) putc_unlocked (x,y)
+#else
+# define putc_unlocked(x,y) putc (x,y)
+#endif
+
+#if HAVE_DECL_PUTCHAR_UNLOCKED
+# undef putchar
+# define putchar(x) putchar_unlocked (x)
+#else
+# define putchar_unlocked(x) putchar (x)
+#endif
+
+#undef flockfile
+#define flockfile(x) ((void) 0)
+
+#undef ftrylockfile
+#define ftrylockfile(x) 0
+
+#undef funlockfile
+#define funlockfile(x) ((void) 0)
+
#endif /* UNLOCKED_IO_H */
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-#include "unlocked-io.h"
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
-#include "unlocked-io.h"
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
/* Read one line from standard input
and return nonzero if that line begins with y or Y,
-2004-10-01 Simon Josefsson <jas@extundo.com>
+2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ * unlocked-io.m4: Add copyright notice.
+ (gl_FUNC_GLIBC_UNLOCKED_IO): Define USE_UNLOCKED_IO.
+
+2004-10-04 Simon Josefsson <jas@extundo.com>
* memmem.m4: New file.
-#serial 9
+# unlocked-io.m4 serial 10
+
+# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+# Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program 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 General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
dnl From Jim Meyering.
dnl
AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO],
[
+ AC_DEFINE([USE_UNLOCKED_IO], 1,
+ [Define to 1 if you want getc etc. to use unlocked I/O if available.
+ Unlocked I/O can improve performance in unithreaded apps,
+ but it is not safe for multithreaded apps.])
+
dnl Persuade glibc and Solaris <stdio.h> to declare
dnl fgets_unlocked(), fputs_unlocked() etc.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
error
quotearg
quote
-unlocked-io
exit
exitfail
lib/argp-pvh.c
lib/argp-xinl.c
m4/argp.m4
-m4/unlocked-io.m4
Depends-on:
alloca
m4/closeout.m4
Depends-on:
-unlocked-io
gettext
error
quotearg
m4/strerror_r.m4
Depends-on:
-unlocked-io
gettext
configure.ac:
Depends-on:
xalloc
strcase
-unlocked-io
fnmatch-gnu
stdbool
gettime
mktime
alloca
-unlocked-io
configure.ac:
gl_GETDATE
m4/ssize_t.m4
Depends-on:
-unlocked-io
configure.ac:
AM_FUNC_GETLINE
m4/ssize_t.m4
Depends-on:
-unlocked-io
configure.ac:
gl_GETNDELIM2
m4/getpass.m4
Depends-on:
-unlocked-io
getline
stdbool
m4/getpass.m4
Depends-on:
-unlocked-io
getline
stdbool
Depends-on:
xalloc
-unlocked-io
configure.ac:
gl_PREREQ_GETUSERSHELL
Depends-on:
xalloc
-unlocked-io
configure.ac:
m4/uint32_t.m4
Depends-on:
-unlocked-io
configure.ac:
gl_MD5
Depends-on:
xalloc
-unlocked-io
configure.ac:
gl_MOUNTLIST
Depends-on:
mktime
-unlocked-io
configure.ac:
gl_POSIXTM
Depends-on:
xalloc
-unlocked-io
configure.ac:
gl_READTOKENS
Depends-on:
xalloc
-unlocked-io
configure.ac:
gl_READUTMP
Depends-on:
alloca
-unlocked-io
gettext
restrict
m4/sha1.m4
Depends-on:
-unlocked-io
md5
configure.ac:
lib/version-etc.c
Depends-on:
-unlocked-io
gettext
configure.ac:
m4/yesno.m4
Depends-on:
-unlocked-io
rpmatch
configure.ac: