aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-02-25 01:23:32 +0000
committerRoland McGrath <roland@gnu.org>1995-02-25 01:23:32 +0000
commit22a1292a42facff7597f3336a91eea57db9709e6 (patch)
tree90182d921edc7ecb39254237386f7a2a07d7e64b
parente66f63fb6364729aad510f5b3feb8a046775ec1a (diff)
downloadglibc-22a1292a42facff7597f3336a91eea57db9709e6.tar.xz
glibc-22a1292a42facff7597f3336a91eea57db9709e6.zip
* io/Makefile (routines): Add euidaccess.
* sysdeps/mach/hurd/euidaccess.c: New file. * sysdeps/stub/euidaccess.c: New file. * posix/unistd.h [__USE_GNU] (euidaccess): Declare it. * dirent/Makefile (routines): Add dirfd. * sysdeps/stub/dirfd.c: New file. * sysdeps/unix/dirfd.c: New file. * sysdeps/unix/dirstream.h (_DIR_dirfd): New macro. * dirent/dirent.h (dirfd): Declare new function. Define as macro _DIR_dirfd if that is defined. * sysdeps/mach/hurd/dirstream.h (DIR): Replace `__port' member with `void *__fd'. * sysdeps/mach/hurd/opendir.c: Use DIRP->__fd instead of DIRP->__port. Open the file with `open'; set FD_CLOEXEC on the fd. * sysdeps/mach/hurd/closedir.c: Likewise. * sysdeps/mach/hurd/readdir.c: Likewise. * sysdeps/mach/hurd/dirfd.c: New file. * posix/Makefile (glob/configure): Do cvs commit if there is a CVS directory. (glob/ChangeLog): Likewise. * locale/locale.h (LC_*): Use small integers instead of bit masks.
-rw-r--r--ChangeLog25
-rw-r--r--NEWS5
-rw-r--r--dirent/Makefile2
-rw-r--r--dirent/dirent.h9
-rw-r--r--io/Makefile2
-rw-r--r--locale/locale.h20
-rw-r--r--manual/memory.texi4
-rw-r--r--posix/Makefile2
-rwxr-xr-xposix/glob/configure1562
-rw-r--r--posix/unistd.h8
-rw-r--r--sysdeps/mach/hurd/closedir.c16
-rw-r--r--sysdeps/mach/hurd/dirfd.c39
-rw-r--r--sysdeps/mach/hurd/dirstream.h5
-rw-r--r--sysdeps/mach/hurd/euidaccess.c58
-rw-r--r--sysdeps/mach/hurd/opendir.c22
-rw-r--r--sysdeps/mach/hurd/readdir.c9
-rw-r--r--sysdeps/stub/dirfd.c30
-rw-r--r--sysdeps/stub/euidaccess.c38
-rw-r--r--sysdeps/unix/dirfd.c28
-rw-r--r--sysdeps/unix/dirstream.h4
20 files changed, 1279 insertions, 609 deletions
diff --git a/ChangeLog b/ChangeLog
index de130afdd0..a9668d19ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,30 @@
Fri Feb 24 14:40:48 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+ * io/Makefile (routines): Add euidaccess.
+ * sysdeps/mach/hurd/euidaccess.c: New file.
+ * sysdeps/stub/euidaccess.c: New file.
+ * posix/unistd.h [__USE_GNU] (euidaccess): Declare it.
+
+ * dirent/Makefile (routines): Add dirfd.
+ * sysdeps/stub/dirfd.c: New file.
+ * sysdeps/unix/dirfd.c: New file.
+ * sysdeps/unix/dirstream.h (_DIR_dirfd): New macro.
+ * dirent/dirent.h (dirfd): Declare new function. Define as macro
+ _DIR_dirfd if that is defined.
+ * sysdeps/mach/hurd/dirstream.h (DIR): Replace `__port' member
+ with `void *__fd'.
+ * sysdeps/mach/hurd/opendir.c: Use DIRP->__fd instead of DIRP->__port.
+ Open the file with `open'; set FD_CLOEXEC on the fd.
+ * sysdeps/mach/hurd/closedir.c: Likewise.
+ * sysdeps/mach/hurd/readdir.c: Likewise.
+ * sysdeps/mach/hurd/dirfd.c: New file.
+
+ * posix/Makefile (glob/configure): Do cvs commit if there is a CVS
+ directory.
+ (glob/ChangeLog): Likewise.
+
+ * locale/locale.h (LC_*): Use small integers instead of bit masks.
+
* stdio/bug4.c: Put temporary files in /tmp.
* stdio/bug3.c: Likewise.
* stdio/bug5.c: Likewise.
diff --git a/NEWS b/NEWS
index dfc213c78f..cc2b89fa32 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes. 17 February 1995
+GNU C Library NEWS -- history of user-visible changes. 24 February 1995
Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
See the end for copying conditions.
@@ -63,6 +63,9 @@ Version 1.10
numbers as indicated by the locale. In the default "C" locale, numbers
are not grouped; but locales for specific countries will define the
usual conventions (i.e. separate thousands with `,' in the US locale).
+
+* New function `euidaccess' checks allowed access to a file like `access',
+ but using the effective IDs instead of the real IDs.
Version 1.09
diff --git a/dirent/Makefile b/dirent/Makefile
index ed3335ce1b..02352768d0 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -24,7 +24,7 @@ subdir := dirent
headers := dirent.h dirstream.h
routines := opendir closedir readdir rewinddir \
seekdir telldir scandir alphasort \
- getdents
+ getdents dirfd
distribute := direct.h
tests := list tst-seekdir
diff --git a/dirent/dirent.h b/dirent/dirent.h
index b102a4786c..88a6fc867e 100644
--- a/dirent/dirent.h
+++ b/dirent/dirent.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1993, 1994, 1995 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
@@ -96,6 +96,13 @@ extern void rewinddir __P ((DIR * __dirp));
#if defined(__USE_BSD) || defined(__USE_MISC)
+/* Return the file descriptor used by DIRP. */
+extern int dirfd __P ((DIR *__dirp));
+
+#if defined (__OPTIMIZE__) && defined (_DIR_dirfd)
+#define dirfd(dirp) _DIR_dirfd (dirp)
+#endif
+
#ifndef MAXNAMLEN
/* Get the definitions of the POSIX.1 limits. */
#include <posix1_lim.h>
diff --git a/io/Makefile b/io/Makefile
index 639f6b75bb..c484e4024f 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -31,7 +31,7 @@ routines := \
mkfifo \
stat fstat lstat \
umask chmod fchmod mkdir \
- open close read write lseek access \
+ open close read write lseek access euidaccess \
fcntl flock lockf \
dup dup2 pipe \
creat \
diff --git a/locale/locale.h b/locale/locale.h
index 80f9f90e7b..1fc867a9d4 100644
--- a/locale/locale.h
+++ b/locale/locale.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995 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
@@ -28,16 +28,14 @@ Cambridge, MA 02139, USA. */
__BEGIN_DECLS
/* These are the possibilities for the first argument to setlocale.
- Note that although they are bit masks, they cannot be OR'd together
- to form a new argument to pass. They must be used one at a time. */
-#define LC_COLLATE (1 << 0)
-#define LC_CTYPE (1 << 1)
-#define LC_MONETARY (1 << 2)
-#define LC_NUMERIC (1 << 3)
-#define LC_TIME (1 << 4)
-#define LC_RESPONSE (1 << 5)
-#define LC_ALL (LC_COLLATE|LC_CTYPE|LC_MONETARY|LC_NUMERIC|LC_TIME|\
- LC_RESPONSE)
+ The code assumes that LC_ALL is the highest value, and zero the lowest. */
+#define LC_COLLATE 0
+#define LC_CTYPE 1
+#define LC_MONETARY 2
+#define LC_NUMERIC 3
+#define LC_TIME 4
+#define LC_MESSAGES 5
+#define LC_ALL 6
/* Structure giving information about numeric and monetary notation. */
diff --git a/manual/memory.texi b/manual/memory.texi
index 9269380e1d..de543ec684 100644
--- a/manual/memory.texi
+++ b/manual/memory.texi
@@ -451,7 +451,7 @@ however---BSD does not provide any way to free such blocks.
@comment malloc.h stdlib.h
@comment BSD
-@deftypefun {void *} memalign (size_t @var{size}, size_t @var{boundary})
+@deftypefun {void *} memalign (size_t @var{boundary}, size_t @var{size})
The @code{memalign} function allocates a block of @var{size} bytes whose
address is a multiple of @var{boundary}. The @var{boundary} must be a
power of two! The function @code{memalign} works by calling
@@ -469,7 +469,7 @@ as the value of the second argument. It is implemented like this:
void *
valloc (size_t size)
@{
- return memalign (size, getpagesize ());
+ return memalign (getpagesize (), size);
@}
@end smallexample
@c !!! xref getpagesize
diff --git a/posix/Makefile b/posix/Makefile
index ae4c1a5fb0..34fe4bb162 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -70,11 +70,13 @@ glob/%.h: %.h
glob/configure: glob/configure.in
cd glob; autoconf $(ACFLAGS)
+ test -d CVS && cvs commit -m'Regenerated: autoconf $(ACFLAGS) $<' $@
glob/ChangeLog: ../ChangeLog
changelog-extract --regexp 'posix/(glob|fnmatch).*' < $< > $@.new
chmod a-w $@.new
mv -f $@.new $@
+ test -d CVS && cvs commit -mRegenerated $@
%.Z: %
compress -c $< > $@-tmp
diff --git a/posix/glob/configure b/posix/glob/configure
index 38315221a1..d82e6dd909 100755
--- a/posix/glob/configure
+++ b/posix/glob/configure
@@ -1,64 +1,41 @@
-#!/bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 1.11
-# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
-
-# This configure script 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 script 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+#! /bin/sh
-# Save the original args to write them into config.status later.
-configure_args="$*"
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.1.2
+# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
-# Only options that might do something get documented.
-ac_usage="Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
---build=BUILD configure for building on BUILD [BUILD=HOST]
---disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
---enable-FEATURE[=ARG] include FEATURE [ARG=yes]
---exec-prefix=PREFIX install host dependent files in PREFIX [/usr/local]
---help print this message
---host=HOST configure for HOST [guessed]
---prefix=PREFIX install host independent files in PREFIX [/usr/local]
---quiet, --silent do not print \`checking for...' messages
---srcdir=DIR find the sources in DIR [configure dir or ..]
---target=TARGET configure for TARGET [TARGET=HOST]
---verbose print results of checks
---version print the version of autoconf that created configure
---with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
---without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
---x-includes=DIR X include files are in DIR
---x-libraries=DIR X library files are in DIR"
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
-exec_prefix=
+cache_file=./config.cache
+exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
-norecursion=
-prefix=
-program_prefix=
-program_suffix=
-program_transform_name=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
silent=
+site=
srcdir=
target=NONE
verbose=
-x_includes=
-x_libraries=
+x_includes=NONE
+x_libraries=NONE
+
+# Initialize some other variables.
+subdirs=
ac_prev=
for ac_option
@@ -71,14 +48,13 @@ do
continue
fi
- # Accept (but ignore some of) the important Cygnus configure
- # options, so we can diagnose typos.
-
case "$ac_option" in
-*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) ac_optarg= ;;
esac
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
case "$ac_option" in
-build | --build | --buil | --bui | --bu | --b)
@@ -86,20 +62,27 @@ do
-build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
build="$ac_optarg" ;;
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
-disable-* | --disable-*)
ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that aren't valid shell variable names.
+ # Reject names that are not valid shell variable names.
if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- echo "configure: $ac_feature: invalid feature name" >&2; exit 1
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
eval "enable_${ac_feature}=no" ;;
-enable-* | --enable-*)
ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that aren't valid shell variable names.
+ # Reject names that are not valid shell variable names.
if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- echo "configure: $ac_feature: invalid feature name" >&2; exit 1
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
case "$ac_option" in
@@ -108,7 +91,6 @@ do
esac
eval "enable_${ac_feature}='$ac_optarg'" ;;
- # For backward compatibility, recognize -exec-prefix and --exec_prefix.
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
@@ -119,11 +101,42 @@ do
exec_prefix="$ac_optarg" ;;
-gas | --gas | --ga | --g)
- with_gas=yes ;; # Obsolete; use --with-gas.
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
-help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
cat << EOF
-$ac_usage
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=PREFIX install architecture-dependent files in PREFIX
+ [same as prefix]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+--enable and --with options recognized:$ac_help
EOF
exit 0 ;;
@@ -133,15 +146,16 @@ EOF
host="$ac_optarg" ;;
-nfp | --nfp | --nf)
- with_fp=no ;; # Obsolete; use --without-fp.
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c)
no_create=yes ;;
- -norecursion | --norecursion | --norecursio | --norecursi \
- | --norecurs | --norecur | --norecu | --norec | --nore | --nor)
- norecursion=yes ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
@@ -183,6 +197,11 @@ EOF
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -197,14 +216,14 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 1.11"
+ echo "configure generated by autoconf version 2.1.2"
exit 0 ;;
-with-* | --with-*)
ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that aren't valid shell variable names.
+ # Reject names that are not valid shell variable names.
if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- echo "configure: $ac_package: invalid package name" >&2; exit 1
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
fi
ac_package=`echo $ac_package| sed 's/-/_/g'`
case "$ac_option" in
@@ -215,14 +234,16 @@ EOF
-without-* | --without-*)
ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that aren't valid shell variable names.
+ # Reject names that are not valid shell variable names.
if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- echo "configure: $ac_package: invalid package name" >&2; exit 1
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
fi
ac_package=`echo $ac_package| sed 's/-/_/g'`
eval "with_${ac_package}=no" ;;
- --x) with_x=yes ;; # Obsolete; use --with-x.
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
@@ -238,15 +259,15 @@ EOF
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries="$ac_optarg" ;;
- -*) echo "configure: $ac_option: invalid option; use --help to show usage" >&2; exit 1
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
;;
*)
if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" >&2
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
fi
if test "x$nonopt" != xNONE; then
- echo "configure: can only configure for one host and one target at a time" >&2; exit 1
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
fi
nonopt="$ac_option"
;;
@@ -255,31 +276,53 @@ EOF
done
if test -n "$ac_prev"; then
- echo "configure: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" >&2; exit 1
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
fi
+exec 5>./config.log
-trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
-trap 'rm -fr confdefs* $ac_clean_files' 0
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
-# Save the original args if we used an alternate arg parser.
-ac_configure_temp="${configure_args-$*}"
-# Strip out --no-create and --norecursion so they don't pile up.
-configure_args=
-for ac_arg in $ac_configure_temp; do
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for a