supermin-5.2.2/ 0000775 0001750 0001750 00000000000 14210411766 010367 5 0000000 0000000 supermin-5.2.2/html/ 0000775 0001750 0001750 00000000000 14210411766 011333 5 0000000 0000000 supermin-5.2.2/html/pod.css 0000664 0001750 0001750 00000004716 12057146704 012563 0000000 0000000 /* CSS to make pod2html files look a little bit better. */
body {
margin-left: 4em;
}
body p, body ul, ol, body dl {
margin-left: 2em;
width: 31em;
}
pre {
width: 31em;
}
li {
padding-bottom: 0.5em;
}
/* Code sections. */
pre {
background-color: #f8f8f8;
color: rgb(204,0,0);
font-weight: 550;
border-left: 6px solid rgb(204,64,64);
padding: 6px;
margin-left: 1em;
font-size: 120%;
}
/* Bold, italic in man pages. */
b, strong {
color: rgb(204,0,0);
}
i, em {
color: rgb(204,0,0);
}
/* Name heading. */
body > h1:first-of-type {
display: none;
}
body > h1:first-of-type + p {
font-size: 125%;
font-weight: bold;
color: rgb(204,0,0);
margin-left: -32px;
}
/* Warning heading in man pages. */
a[name="warning"] {
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-radius-topleft: 5px;
border-radius-topright: 5px;
color: white;
background-color: rgb(204,0,0);
}
a[name="warning"]:before {
content: "\00a0\00a0\00a0";
}
a[name="warning"]:after {
content: "\00a0\00a0\00a0";
}
/* Put the index on the right hand side in a floating box. */
div[name="index"] {
float: right;
width: 18em;
border-left: 3em solid white;
background-color: #fcfcfc;
margin-top: 32px;
padding-top: 0px;
margin-left: 1em;
padding-left: 1em;
padding-right: 1em;
font-size: 90%;
}
div[name="index"] a[href] {
text-decoration: none;
}
div[name="index"] a[href]:hover {
text-decoration: underline;
}
div[name="index"] a[href]:before {
content: '#\00a0';
color: rgb(204,0,0);
font-size: x-small;
}
div[name="index"] > ul {
width: 17em;
list-style: none;
margin-left: 0px;
margin-right: 0px;
padding-left: 0px;
padding-right: 0px;
}
div[name="index"] > ul > li {
margin-bottom: 0.5em;
}
div[name="index"] > ul ul {
width: 16em;
list-style: none;
margin-left: 0px;
margin-right: 0px;
padding-left: 0px;
padding-right: 0px;
margin-bottom: 0.5em;
}
div[name="index"] > ul > ul li {
display: inline;
margin-right: 1em;
}
/*
div[name="index"] > ul > ul li:after {
color: #ccc;
content: '\2014';
}
*/
/* Get rid of those horrible
's :-( */
hr { display: none; }
/* Demote 's and set rest of headers relative. */
h1 {
font-size: 100%;
color: black;
border-bottom: solid 1px rgb(204,0,0);
}
h2 {
font-size: 95%;
border-bottom: none;
}
h3 {
font-size: 90%;
}
h4 {
font-size: 85%;
}
supermin-5.2.2/lib/ 0000775 0001750 0001750 00000000000 14210411766 011135 5 0000000 0000000 supermin-5.2.2/lib/.gitignore 0000664 0001750 0001750 00000000204 13057324165 013045 0000000 0000000
/assure.h
/*.c
/flexmember.h
/getprogname.c
/getprogname.h
/*.h
/*.h.in
/limits.in.h
/Makefile.am
/stdalign.in.h
/sys
/*.valgrind
supermin-5.2.2/lib/Makefile.am 0000664 0001750 0001750 00000157234 13057324250 013124 0000000 0000000 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file 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 3 of the License, or
# (at your option) any later version.
#
# This file 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 file. If not, see .
#
# As a special exception to the GNU General Public License,
# this file may be distributed as part of a program that
# contains a configuration script generated by Autoconf, under
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-conditional-dependencies --no-libtool --macro-prefix=gl fts sys_types
AUTOMAKE_OPTIONS = 1.9.6 gnits
SUBDIRS =
noinst_HEADERS =
noinst_LIBRARIES =
noinst_LTLIBRARIES =
EXTRA_DIST =
BUILT_SOURCES =
SUFFIXES =
MOSTLYCLEANFILES = core *.stackdump
MOSTLYCLEANDIRS =
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
AM_CPPFLAGS =
AM_CFLAGS =
noinst_LIBRARIES += libgnu.a
libgnu_a_SOURCES =
libgnu_a_LIBADD = $(gl_LIBOBJS)
libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
EXTRA_libgnu_a_SOURCES =
## begin gnulib module absolute-header
# Use this preprocessor expression to decide whether #include_next works.
# Do not rely on a 'configure'-time test for this, since the expression
# might appear in an installed header, which is used by some other compiler.
HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER)
## end gnulib module absolute-header
## begin gnulib module assure
EXTRA_DIST += assure.h
## end gnulib module assure
## begin gnulib module at-internal
EXTRA_DIST += openat-priv.h openat-proc.c
EXTRA_libgnu_a_SOURCES += openat-proc.c
## end gnulib module at-internal
## begin gnulib module bitrotate
libgnu_a_SOURCES += bitrotate.h bitrotate.c
## end gnulib module bitrotate
## begin gnulib module chdir-long
EXTRA_DIST += chdir-long.c chdir-long.h
EXTRA_libgnu_a_SOURCES += chdir-long.c
## end gnulib module chdir-long
## begin gnulib module cloexec
libgnu_a_SOURCES += cloexec.c
EXTRA_DIST += cloexec.h
## end gnulib module cloexec
## begin gnulib module close
EXTRA_DIST += close.c
EXTRA_libgnu_a_SOURCES += close.c
## end gnulib module close
## begin gnulib module closedir
EXTRA_DIST += closedir.c dirent-private.h
EXTRA_libgnu_a_SOURCES += closedir.c
## end gnulib module closedir
## begin gnulib module cycle-check
libgnu_a_SOURCES += cycle-check.c
EXTRA_DIST += cycle-check.h
## end gnulib module cycle-check
## begin gnulib module dev-ino
EXTRA_DIST += dev-ino.h
## end gnulib module dev-ino
## begin gnulib module dirent
BUILT_SOURCES += dirent.h
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
-e 's/@''GNULIB_OPENDIR''@/$(GNULIB_OPENDIR)/g' \
-e 's/@''GNULIB_READDIR''@/$(GNULIB_READDIR)/g' \
-e 's/@''GNULIB_REWINDDIR''@/$(GNULIB_REWINDDIR)/g' \
-e 's/@''GNULIB_CLOSEDIR''@/$(GNULIB_CLOSEDIR)/g' \
-e 's/@''GNULIB_DIRFD''@/$(GNULIB_DIRFD)/g' \
-e 's/@''GNULIB_FDOPENDIR''@/$(GNULIB_FDOPENDIR)/g' \
-e 's/@''GNULIB_SCANDIR''@/$(GNULIB_SCANDIR)/g' \
-e 's/@''GNULIB_ALPHASORT''@/$(GNULIB_ALPHASORT)/g' \
-e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
-e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
-e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
-e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
-e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
-e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
-e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
-e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
-e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
-e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
-e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
-e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
-e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/dirent.in.h; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += dirent.h dirent.h-t
EXTRA_DIST += dirent.in.h
## end gnulib module dirent
## begin gnulib module dirent-safer
libgnu_a_SOURCES += opendir-safer.c
EXTRA_DIST += dirent--.h dirent-safer.h
## end gnulib module dirent-safer
## begin gnulib module dirfd
EXTRA_DIST += dirfd.c
EXTRA_libgnu_a_SOURCES += dirfd.c
## end gnulib module dirfd
## begin gnulib module dirname-lgpl
libgnu_a_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c
EXTRA_DIST += dirname.h
## end gnulib module dirname-lgpl
## begin gnulib module dosname
EXTRA_DIST += dosname.h
## end gnulib module dosname
## begin gnulib module dup
EXTRA_DIST += dup.c
EXTRA_libgnu_a_SOURCES += dup.c
## end gnulib module dup
## begin gnulib module dup2
EXTRA_DIST += dup2.c
EXTRA_libgnu_a_SOURCES += dup2.c
## end gnulib module dup2
## begin gnulib module errno
BUILT_SOURCES += $(ERRNO_H)
# We need the following in order to create when the system
# doesn't have one that is POSIX compliant.
if GL_GENERATE_ERRNO_H
errno.h: errno.in.h $(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
-e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
-e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
-e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
-e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
-e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
-e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
< $(srcdir)/errno.in.h; \
} > $@-t && \
mv $@-t $@
else
errno.h: $(top_builddir)/config.status
rm -f $@
endif
MOSTLYCLEANFILES += errno.h errno.h-t
EXTRA_DIST += errno.in.h
## end gnulib module errno
## begin gnulib module error
EXTRA_DIST += error.c error.h
EXTRA_libgnu_a_SOURCES += error.c
## end gnulib module error
## begin gnulib module exitfail
libgnu_a_SOURCES += exitfail.c
EXTRA_DIST += exitfail.h
## end gnulib module exitfail
## begin gnulib module fchdir
EXTRA_DIST += fchdir.c
EXTRA_libgnu_a_SOURCES += fchdir.c
## end gnulib module fchdir
## begin gnulib module fcntl
EXTRA_DIST += fcntl.c
EXTRA_libgnu_a_SOURCES += fcntl.c
## end gnulib module fcntl
## begin gnulib module fcntl-h
BUILT_SOURCES += fcntl.h
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
-e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
-e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
-e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
-e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
-e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
-e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
-e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
-e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
-e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/fcntl.in.h; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += fcntl.h fcntl.h-t
EXTRA_DIST += fcntl.in.h
## end gnulib module fcntl-h
## begin gnulib module fcntl-safer
libgnu_a_SOURCES += creat-safer.c open-safer.c
EXTRA_DIST += fcntl--.h fcntl-safer.h
## end gnulib module fcntl-safer
## begin gnulib module fd-hook
libgnu_a_SOURCES += fd-hook.c
EXTRA_DIST += fd-hook.h
## end gnulib module fd-hook
## begin gnulib module fdopendir
EXTRA_DIST += fdopendir.c
EXTRA_libgnu_a_SOURCES += fdopendir.c
## end gnulib module fdopendir
## begin gnulib module filename
EXTRA_DIST += filename.h
## end gnulib module filename
## begin gnulib module filenamecat-lgpl
libgnu_a_SOURCES += filenamecat-lgpl.c
EXTRA_DIST += filenamecat.h
## end gnulib module filenamecat-lgpl
## begin gnulib module flexmember
EXTRA_DIST += flexmember.h
## end gnulib module flexmember
## begin gnulib module fstat
EXTRA_DIST += fstat.c
EXTRA_libgnu_a_SOURCES += fstat.c
## end gnulib module fstat
## begin gnulib module fts
EXTRA_DIST += fts-cycle.c fts.c fts_.h
EXTRA_libgnu_a_SOURCES += fts-cycle.c fts.c
## end gnulib module fts
## begin gnulib module getcwd-lgpl
EXTRA_DIST += getcwd-lgpl.c
EXTRA_libgnu_a_SOURCES += getcwd-lgpl.c
## end gnulib module getcwd-lgpl
## begin gnulib module getdtablesize
EXTRA_DIST += getdtablesize.c
EXTRA_libgnu_a_SOURCES += getdtablesize.c
## end gnulib module getdtablesize
## begin gnulib module getprogname
libgnu_a_SOURCES += getprogname.h getprogname.c
## end gnulib module getprogname
## begin gnulib module gettext-h
libgnu_a_SOURCES += gettext.h
## end gnulib module gettext-h
## begin gnulib module gettimeofday
EXTRA_DIST += gettimeofday.c
EXTRA_libgnu_a_SOURCES += gettimeofday.c
## end gnulib module gettimeofday
## begin gnulib module hash
libgnu_a_SOURCES += hash.c
EXTRA_DIST += hash.h
## end gnulib module hash
## begin gnulib module i-ring
libgnu_a_SOURCES += i-ring.c
EXTRA_DIST += i-ring.h
## end gnulib module i-ring
## begin gnulib module intprops
EXTRA_DIST += intprops.h
## end gnulib module intprops
## begin gnulib module limits-h
BUILT_SOURCES += $(LIMITS_H)
# We need the following in order to create when the system
# doesn't have one that is compatible with GNU.
if GL_GENERATE_LIMITS_H
limits.h: limits.in.h $(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \
< $(srcdir)/limits.in.h; \
} > $@-t && \
mv $@-t $@
else
limits.h: $(top_builddir)/config.status
rm -f $@
endif
MOSTLYCLEANFILES += limits.h limits.h-t
EXTRA_DIST += limits.in.h
## end gnulib module limits-h
## begin gnulib module lstat
EXTRA_DIST += lstat.c
EXTRA_libgnu_a_SOURCES += lstat.c
## end gnulib module lstat
## begin gnulib module malloc-posix
EXTRA_DIST += malloc.c
EXTRA_libgnu_a_SOURCES += malloc.c
## end gnulib module malloc-posix
## begin gnulib module memchr
EXTRA_DIST += memchr.c memchr.valgrind
EXTRA_libgnu_a_SOURCES += memchr.c
## end gnulib module memchr
## begin gnulib module mempcpy
EXTRA_DIST += mempcpy.c
EXTRA_libgnu_a_SOURCES += mempcpy.c
## end gnulib module mempcpy
## begin gnulib module memrchr
EXTRA_DIST += memrchr.c
EXTRA_libgnu_a_SOURCES += memrchr.c
## end gnulib module memrchr
## begin gnulib module msvc-inval
EXTRA_DIST += msvc-inval.c msvc-inval.h
EXTRA_libgnu_a_SOURCES += msvc-inval.c
## end gnulib module msvc-inval
## begin gnulib module msvc-nothrow
EXTRA_DIST += msvc-nothrow.c msvc-nothrow.h
EXTRA_libgnu_a_SOURCES += msvc-nothrow.c
## end gnulib module msvc-nothrow
## begin gnulib module open
EXTRA_DIST += open.c
EXTRA_libgnu_a_SOURCES += open.c
## end gnulib module open
## begin gnulib module openat
EXTRA_DIST += openat.c
EXTRA_libgnu_a_SOURCES += openat.c
## end gnulib module openat
## begin gnulib module openat-die
libgnu_a_SOURCES += openat-die.c
## end gnulib module openat-die
## begin gnulib module openat-h
EXTRA_DIST += openat.h
## end gnulib module openat-h
## begin gnulib module openat-safer
libgnu_a_SOURCES += openat-safer.c
EXTRA_DIST += fcntl--.h fcntl-safer.h
## end gnulib module openat-safer
## begin gnulib module opendir
EXTRA_DIST += dirent-private.h opendir.c
EXTRA_libgnu_a_SOURCES += opendir.c
## end gnulib module opendir
## begin gnulib module pathmax
EXTRA_DIST += pathmax.h
## end gnulib module pathmax
## begin gnulib module readdir
EXTRA_DIST += dirent-private.h readdir.c
EXTRA_libgnu_a_SOURCES += readdir.c
## end gnulib module readdir
## begin gnulib module realloc-posix
EXTRA_DIST += realloc.c
EXTRA_libgnu_a_SOURCES += realloc.c
## end gnulib module realloc-posix
## begin gnulib module same-inode
EXTRA_DIST += same-inode.h
## end gnulib module same-inode
## begin gnulib module save-cwd
libgnu_a_SOURCES += save-cwd.c
EXTRA_DIST += save-cwd.h
## end gnulib module save-cwd
## begin gnulib module snippet/_Noreturn
# Because this Makefile snippet defines a variable used by other
# gnulib Makefile snippets, it must be present in all Makefile.am that
# need it. This is ensured by the applicability 'all' defined above.
_NORETURN_H=$(top_srcdir)/./snippet/_Noreturn.h
EXTRA_DIST += $(top_srcdir)/./snippet/_Noreturn.h
## end gnulib module snippet/_Noreturn
## begin gnulib module snippet/arg-nonnull
# The BUILT_SOURCES created by this Makefile snippet are not used via #include
# statements but through direct file reference. Therefore this snippet must be
# present in all Makefile.am that need it. This is ensured by the applicability
# 'all' defined above.
BUILT_SOURCES += arg-nonnull.h
# The arg-nonnull.h that gets inserted into generated .h files is the same as
# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
# off.
arg-nonnull.h: $(top_srcdir)/./snippet/arg-nonnull.h
$(AM_V_GEN)rm -f $@-t $@ && \
sed -n -e '/GL_ARG_NONNULL/,$$p' \
< $(top_srcdir)/./snippet/arg-nonnull.h \
> $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
ARG_NONNULL_H=arg-nonnull.h
EXTRA_DIST += $(top_srcdir)/./snippet/arg-nonnull.h
## end gnulib module snippet/arg-nonnull
## begin gnulib module snippet/c++defs
# The BUILT_SOURCES created by this Makefile snippet are not used via #include
# statements but through direct file reference. Therefore this snippet must be
# present in all Makefile.am that need it. This is ensured by the applicability
# 'all' defined above.
BUILT_SOURCES += c++defs.h
# The c++defs.h that gets inserted into generated .h files is the same as
# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
c++defs.h: $(top_srcdir)/./snippet/c++defs.h
$(AM_V_GEN)rm -f $@-t $@ && \
sed -n -e '/_GL_CXXDEFS/,$$p' \
< $(top_srcdir)/./snippet/c++defs.h \
> $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += c++defs.h c++defs.h-t
CXXDEFS_H=c++defs.h
EXTRA_DIST += $(top_srcdir)/./snippet/c++defs.h
## end gnulib module snippet/c++defs
## begin gnulib module snippet/warn-on-use
BUILT_SOURCES += warn-on-use.h
# The warn-on-use.h that gets inserted into generated .h files is the same as
# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
# off.
warn-on-use.h: $(top_srcdir)/./snippet/warn-on-use.h
$(AM_V_GEN)rm -f $@-t $@ && \
sed -n -e '/^.ifndef/,$$p' \
< $(top_srcdir)/./snippet/warn-on-use.h \
> $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
WARN_ON_USE_H=warn-on-use.h
EXTRA_DIST += $(top_srcdir)/./snippet/warn-on-use.h
## end gnulib module snippet/warn-on-use
## begin gnulib module stat
EXTRA_DIST += stat.c
EXTRA_libgnu_a_SOURCES += stat.c
## end gnulib module stat
## begin gnulib module stdalign
BUILT_SOURCES += $(STDALIGN_H)
# We need the following in order to create when the system
# doesn't have one that works.
if GL_GENERATE_STDALIGN_H
stdalign.h: stdalign.in.h $(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/stdalign.in.h; \
} > $@-t && \
mv $@-t $@
else
stdalign.h: $(top_builddir)/config.status
rm -f $@
endif
MOSTLYCLEANFILES += stdalign.h stdalign.h-t
EXTRA_DIST += stdalign.in.h
## end gnulib module stdalign
## begin gnulib module stdbool
BUILT_SOURCES += $(STDBOOL_H)
# We need the following in order to create when the system
# doesn't have one that works.
if GL_GENERATE_STDBOOL_H
stdbool.h: stdbool.in.h $(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
} > $@-t && \
mv $@-t $@
else
stdbool.h: $(top_builddir)/config.status
rm -f $@
endif
MOSTLYCLEANFILES += stdbool.h stdbool.h-t
EXTRA_DIST += stdbool.in.h
## end gnulib module stdbool
## begin gnulib module stddef
BUILT_SOURCES += $(STDDEF_H)
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
if GL_GENERATE_STDDEF_H
stddef.h: stddef.in.h $(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
-e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
-e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
-e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
< $(srcdir)/stddef.in.h; \
} > $@-t && \
mv $@-t $@
else
stddef.h: $(top_builddir)/config.status
rm -f $@
endif
MOSTLYCLEANFILES += stddef.h stddef.h-t
EXTRA_DIST += stddef.in.h
## end gnulib module stddef
## begin gnulib module stdint
BUILT_SOURCES += $(STDINT_H)
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
if GL_GENERATE_STDINT_H
stdint.h: stdint.in.h $(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
-e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \
-e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
-e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
-e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
-e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
-e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
-e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
-e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
-e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
-e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
-e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
-e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
-e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
-e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
-e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
-e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
-e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
-e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
-e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
-e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
-e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
-e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
-e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
< $(srcdir)/stdint.in.h; \
} > $@-t && \
mv $@-t $@
else
stdint.h: $(top_builddir)/config.status
rm -f $@
endif
MOSTLYCLEANFILES += stdint.h stdint.h-t
EXTRA_DIST += stdint.in.h
## end gnulib module stdint
## begin gnulib module stdio
BUILT_SOURCES += stdio.h
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
-e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
-e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \
-e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
-e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
-e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
-e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
-e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
-e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
-e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
-e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
-e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
-e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
-e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
-e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
-e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
-e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
-e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
-e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
-e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
-e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
-e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
-e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
-e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
-e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
-e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
-e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
-e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
-e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
-e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
-e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
-e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
-e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
-e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
-e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
-e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
-e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
-e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
-e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
-e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
-e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
-e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
-e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
-e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
-e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
-e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
-e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
-e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
-e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
< $(srcdir)/stdio.in.h | \
sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
-e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
-e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
-e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
-e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
-e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
-e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
-e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
-e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
-e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
-e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
-e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
-e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
-e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
-e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
-e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
-e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
-e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
-e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
-e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
-e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
-e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
-e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
-e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
-e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
-e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
-e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
-e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
-e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
-e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
-e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
-e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
-e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
-e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
-e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
-e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
-e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdio.h stdio.h-t
EXTRA_DIST += stdio.in.h
## end gnulib module stdio
## begin gnulib module stdlib
BUILT_SOURCES += stdlib.h
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
$(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
-e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \
-e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \
-e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \
-e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \
-e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \
-e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \
-e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \
-e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \
-e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \
-e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \
-e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \
-e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \
-e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \
-e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \
-e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \
-e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
-e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
-e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
-e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \
-e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
-e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
-e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
-e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
-e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
-e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \
-e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
-e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
-e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
-e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \
-e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \
-e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \
-e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \
-e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \
< $(srcdir)/stdlib.in.h | \
sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
-e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
-e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
-e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
-e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
-e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
-e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
-e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
-e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
-e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
-e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
-e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
-e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \
-e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
-e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
-e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
-e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
-e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
-e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
-e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
-e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
-e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
-e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
-e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
-e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
-e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
-e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
-e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
-e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
-e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
-e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
-e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
-e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
-e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
-e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _Noreturn/r $(_NORETURN_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdlib.h stdlib.h-t
EXTRA_DIST += stdlib.in.h
## end gnulib module stdlib
## begin gnulib module strdup-posix
EXTRA_DIST += strdup.c
EXTRA_libgnu_a_SOURCES += strdup.c
## end gnulib module strdup-posix
## begin gnulib module strerror
EXTRA_DIST += strerror.c
EXTRA_libgnu_a_SOURCES += strerror.c
## end gnulib module strerror
## begin gnulib module strerror-override
EXTRA_DIST += strerror-override.c strerror-override.h
EXTRA_libgnu_a_SOURCES += strerror-override.c
## end gnulib module strerror-override
## begin gnulib module string
BUILT_SOURCES += string.h
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
-e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
-e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
-e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
-e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
-e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
-e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
-e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
-e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
-e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
-e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
-e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
-e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
-e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
-e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
-e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
-e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
-e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
-e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
-e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
-e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
-e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
-e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
-e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
-e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
-e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
-e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
-e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
-e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
-e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
-e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
-e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
-e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
-e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
-e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
-e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
-e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
-e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
< $(srcdir)/string.in.h | \
sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
-e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
-e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
-e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
-e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
-e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
-e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
-e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
-e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
-e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
-e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
-e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
-e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
-e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
-e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
-e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
-e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
-e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
-e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
-e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
-e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
-e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
-e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
-e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
-e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
-e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
-e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
-e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
-e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
-e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
-e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
-e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
-e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
< $(srcdir)/string.in.h; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += string.h string.h-t
EXTRA_DIST += string.in.h
## end gnulib module string
## begin gnulib module sys_stat
BUILT_SOURCES += sys/stat.h
# We need the following in order to create when the system
# has one that is incomplete.
sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
-e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
-e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \
-e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \
-e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \
-e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \
-e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \
-e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \
-e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \
-e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \
-e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \
-e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \
-e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \
-e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \
-e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \
-e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
-e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
-e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
-e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
-e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
-e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
-e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \
-e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
-e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
-e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
-e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
-e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
-e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
-e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
-e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
-e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
-e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
-e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
-e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
-e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/sys_stat.in.h; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
MOSTLYCLEANDIRS += sys
EXTRA_DIST += sys_stat.in.h
## end gnulib module sys_stat
## begin gnulib module sys_time
BUILT_SOURCES += sys/time.h
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
-e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
-e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
-e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
-e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
-e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
-e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/sys_time.in.h; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += sys/time.h sys/time.h-t
EXTRA_DIST += sys_time.in.h
## end gnulib module sys_time
## begin gnulib module sys_types
BUILT_SOURCES += sys/types.h
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
sys/types.h: sys_types.in.h $(top_builddir)/config.status
$(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
-e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
< $(srcdir)/sys_types.in.h; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += sys/types.h sys/types.h-t
EXTRA_DIST += sys_types.in.h
## end gnulib module sys_types
## begin gnulib module time
BUILT_SOURCES += time.h
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
-e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
-e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
-e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
-e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
-e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
-e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
-e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \
-e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
-e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
-e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
-e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
-e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \
-e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
-e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
-e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
-e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
-e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
-e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/time.in.h; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += time.h time.h-t
EXTRA_DIST += time.in.h
## end gnulib module time
## begin gnulib module unistd
BUILT_SOURCES += unistd.h
libgnu_a_SOURCES += unistd.c
# We need the following in order to create an empty placeholder for
# when the system doesn't have one.
unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
-e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
-e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \
-e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
-e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
-e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \
-e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \
-e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \
-e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \
-e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \
-e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \
-e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \
-e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \
-e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \
-e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \
-e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \
-e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \
-e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \
-e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \
-e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \
-e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
-e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
-e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
-e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
-e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
-e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
-e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
-e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \
-e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \
-e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \
-e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \
-e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \
-e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \
-e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \
-e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \
-e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \
-e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \
-e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \
-e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \
-e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \
-e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \
-e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \
-e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
-e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
-e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \
-e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
-e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \
-e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \
-e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \
-e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \
-e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
< $(srcdir)/unistd.in.h | \
sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
-e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
-e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
-e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
-e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
-e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
-e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
-e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \
-e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
-e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
-e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
-e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
-e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
-e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
-e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
-e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
-e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
-e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
-e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \
-e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
-e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
-e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
-e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
-e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
-e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \
-e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
-e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
-e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
-e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
-e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
-e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
-e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
-e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
-e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
-e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \
-e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
-e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
-e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
-e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
-e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
-e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
| \
sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
-e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
-e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
-e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
-e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
-e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
-e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \
-e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
-e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
-e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
-e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
-e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
-e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
-e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
-e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
-e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
-e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
-e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
-e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \
-e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
-e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
-e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
-e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
-e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
-e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
-e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
-e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
-e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += unistd.h unistd.h-t
EXTRA_DIST += unistd.in.h
## end gnulib module unistd
## begin gnulib module unistd-safer
libgnu_a_SOURCES += dup-safer.c fd-safer.c pipe-safer.c
EXTRA_DIST += unistd--.h unistd-safer.h
## end gnulib module unistd-safer
## begin gnulib module verify
EXTRA_DIST += verify.h
## end gnulib module verify
## begin gnulib module xalloc-oversized
EXTRA_DIST += xalloc-oversized.h
## end gnulib module xalloc-oversized
mostlyclean-local: mostlyclean-generic
@for dir in '' $(MOSTLYCLEANDIRS); do \
if test -n "$$dir" && test -d $$dir; then \
echo "rmdir $$dir"; rmdir $$dir; \
fi; \
done; \
:
supermin-5.2.2/lib/Makefile.in 0000664 0001750 0001750 00000320403 14210411375 013120 0000000 0000000 # Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file 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 3 of the License, or
# (at your option) any later version.
#
# This file 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 file. If not, see .
#
# As a special exception to the GNU General Public License,
# this file may be distributed as part of a program that
# contains a configuration script generated by Autoconf, under
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-conditional-dependencies --no-libtool --macro-prefix=gl fts sys_types
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = lib
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
$(top_srcdir)/m4/absolute-header.m4 \
$(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/close.m4 \
$(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/cycle-check.m4 \
$(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \
$(top_srcdir)/m4/dirent-safer.m4 $(top_srcdir)/m4/dirent_h.m4 \
$(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
$(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \
$(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/errno_h.m4 \
$(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/extensions.m4 \
$(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fchdir.m4 \
$(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl-safer.m4 \
$(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
$(top_srcdir)/m4/fdopendir.m4 $(top_srcdir)/m4/filenamecat.m4 \
$(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/fstat.m4 \
$(top_srcdir)/m4/fts.m4 $(top_srcdir)/m4/getcwd.m4 \
$(top_srcdir)/m4/getdtablesize.m4 \
$(top_srcdir)/m4/getprogname.m4 \
$(top_srcdir)/m4/gettimeofday.m4 \
$(top_srcdir)/m4/gnulib-common.m4 \
$(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/i-ring.m4 \
$(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/largefile.m4 \
$(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/longlong.m4 \
$(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/malloc.m4 \
$(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mempcpy.m4 \
$(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mmap-anon.m4 \
$(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \
$(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
$(top_srcdir)/m4/ocaml.m4 $(top_srcdir)/m4/off_t.m4 \
$(top_srcdir)/m4/onceonly.m4 $(top_srcdir)/m4/open.m4 \
$(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/opendir.m4 \
$(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/readdir.m4 \
$(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/save-cwd.m4 \
$(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \
$(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdbool.m4 \
$(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \
$(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
$(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
$(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/sys_socket_h.m4 \
$(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
$(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/time_h.m4 \
$(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
$(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/wchar_t.m4 \
$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LIBRARIES = $(noinst_LIBRARIES)
LTLIBRARIES = $(noinst_LTLIBRARIES)
AM_V_AR = $(am__v_AR_@AM_V@)
am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
am__v_AR_0 = @echo " AR " $@;
am__v_AR_1 =
libgnu_a_AR = $(AR) $(ARFLAGS)
am__DEPENDENCIES_1 =
am_libgnu_a_OBJECTS = bitrotate.$(OBJEXT) cloexec.$(OBJEXT) \
cycle-check.$(OBJEXT) opendir-safer.$(OBJEXT) \
dirname-lgpl.$(OBJEXT) basename-lgpl.$(OBJEXT) \
stripslash.$(OBJEXT) exitfail.$(OBJEXT) creat-safer.$(OBJEXT) \
open-safer.$(OBJEXT) fd-hook.$(OBJEXT) \
filenamecat-lgpl.$(OBJEXT) getprogname.$(OBJEXT) \
hash.$(OBJEXT) i-ring.$(OBJEXT) openat-die.$(OBJEXT) \
openat-safer.$(OBJEXT) save-cwd.$(OBJEXT) unistd.$(OBJEXT) \
dup-safer.$(OBJEXT) fd-safer.$(OBJEXT) pipe-safer.$(OBJEXT)
libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/basename-lgpl.Po \
./$(DEPDIR)/bitrotate.Po ./$(DEPDIR)/chdir-long.Po \
./$(DEPDIR)/cloexec.Po ./$(DEPDIR)/close.Po \
./$(DEPDIR)/closedir.Po ./$(DEPDIR)/creat-safer.Po \
./$(DEPDIR)/cycle-check.Po ./$(DEPDIR)/dirfd.Po \
./$(DEPDIR)/dirname-lgpl.Po ./$(DEPDIR)/dup-safer.Po \
./$(DEPDIR)/dup.Po ./$(DEPDIR)/dup2.Po ./$(DEPDIR)/error.Po \
./$(DEPDIR)/exitfail.Po ./$(DEPDIR)/fchdir.Po \
./$(DEPDIR)/fcntl.Po ./$(DEPDIR)/fd-hook.Po \
./$(DEPDIR)/fd-safer.Po ./$(DEPDIR)/fdopendir.Po \
./$(DEPDIR)/filenamecat-lgpl.Po ./$(DEPDIR)/fstat.Po \
./$(DEPDIR)/fts-cycle.Po ./$(DEPDIR)/fts.Po \
./$(DEPDIR)/getcwd-lgpl.Po ./$(DEPDIR)/getdtablesize.Po \
./$(DEPDIR)/getprogname.Po ./$(DEPDIR)/gettimeofday.Po \
./$(DEPDIR)/hash.Po ./$(DEPDIR)/i-ring.Po ./$(DEPDIR)/lstat.Po \
./$(DEPDIR)/malloc.Po ./$(DEPDIR)/memchr.Po \
./$(DEPDIR)/mempcpy.Po ./$(DEPDIR)/memrchr.Po \
./$(DEPDIR)/msvc-inval.Po ./$(DEPDIR)/msvc-nothrow.Po \
./$(DEPDIR)/open-safer.Po ./$(DEPDIR)/open.Po \
./$(DEPDIR)/openat-die.Po ./$(DEPDIR)/openat-proc.Po \
./$(DEPDIR)/openat-safer.Po ./$(DEPDIR)/openat.Po \
./$(DEPDIR)/opendir-safer.Po ./$(DEPDIR)/opendir.Po \
./$(DEPDIR)/pipe-safer.Po ./$(DEPDIR)/readdir.Po \
./$(DEPDIR)/realloc.Po ./$(DEPDIR)/save-cwd.Po \
./$(DEPDIR)/stat.Po ./$(DEPDIR)/strdup.Po \
./$(DEPDIR)/strerror-override.Po ./$(DEPDIR)/strerror.Po \
./$(DEPDIR)/stripslash.Po ./$(DEPDIR)/unistd.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES)
DIST_SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
APT_GET = @APT_GET@
AR = @AR@
ARFLAGS = @ARFLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COM_ERR_CFLAGS = @COM_ERR_CFLAGS@
COM_ERR_LIBS = @COM_ERR_LIBS@
CPIO = @CPIO@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DNF = @DNF@
DPKG = @DPKG@
DPKG_DEB = @DPKG_DEB@
DPKG_DIVERT = @DPKG_DIVERT@
DPKG_QUERY = @DPKG_QUERY@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
ENOLINK_VALUE = @ENOLINK_VALUE@
EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
ERRNO_H = @ERRNO_H@
EXEEXT = @EXEEXT@
EXT2FS_CFLAGS = @EXT2FS_CFLAGS@
EXT2FS_LIBS = @EXT2FS_LIBS@
FAKEROOT = @FAKEROOT@
GAWK = @GAWK@
GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
GNULIB_ATOLL = @GNULIB_ATOLL@
GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
GNULIB_CHDIR = @GNULIB_CHDIR@
GNULIB_CHOWN = @GNULIB_CHOWN@
GNULIB_CLOSE = @GNULIB_CLOSE@
GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
GNULIB_DIRFD = @GNULIB_DIRFD@
GNULIB_DPRINTF = @GNULIB_DPRINTF@
GNULIB_DUP = @GNULIB_DUP@
GNULIB_DUP2 = @GNULIB_DUP2@
GNULIB_DUP3 = @GNULIB_DUP3@
GNULIB_ENVIRON = @GNULIB_ENVIRON@
GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
GNULIB_FCHDIR = @GNULIB_FCHDIR@
GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
GNULIB_FCLOSE = @GNULIB_FCLOSE@
GNULIB_FCNTL = @GNULIB_FCNTL@
GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
GNULIB_FDOPEN = @GNULIB_FDOPEN@
GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
GNULIB_FFLUSH = @GNULIB_FFLUSH@
GNULIB_FFSL = @GNULIB_FFSL@
GNULIB_FFSLL = @GNULIB_FFSLL@
GNULIB_FGETC = @GNULIB_FGETC@
GNULIB_FGETS = @GNULIB_FGETS@
GNULIB_FOPEN = @GNULIB_FOPEN@
GNULIB_FPRINTF = @GNULIB_FPRINTF@
GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
GNULIB_FPURGE = @GNULIB_FPURGE@
GNULIB_FPUTC = @GNULIB_FPUTC@
GNULIB_FPUTS = @GNULIB_FPUTS@
GNULIB_FREAD = @GNULIB_FREAD@
GNULIB_FREOPEN = @GNULIB_FREOPEN@
GNULIB_FSCANF = @GNULIB_FSCANF@
GNULIB_FSEEK = @GNULIB_FSEEK@
GNULIB_FSEEKO = @GNULIB_FSEEKO@
GNULIB_FSTAT = @GNULIB_FSTAT@
GNULIB_FSTATAT = @GNULIB_FSTATAT@
GNULIB_FSYNC = @GNULIB_FSYNC@
GNULIB_FTELL = @GNULIB_FTELL@
GNULIB_FTELLO = @GNULIB_FTELLO@
GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
GNULIB_FWRITE = @GNULIB_FWRITE@
GNULIB_GETC = @GNULIB_GETC@
GNULIB_GETCHAR = @GNULIB_GETCHAR@
GNULIB_GETCWD = @GNULIB_GETCWD@
GNULIB_GETDELIM = @GNULIB_GETDELIM@
GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
GNULIB_GETLINE = @GNULIB_GETLINE@
GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
GNULIB_GRANTPT = @GNULIB_GRANTPT@
GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
GNULIB_ISATTY = @GNULIB_ISATTY@
GNULIB_LCHMOD = @GNULIB_LCHMOD@
GNULIB_LCHOWN = @GNULIB_LCHOWN@
GNULIB_LINK = @GNULIB_LINK@
GNULIB_LINKAT = @GNULIB_LINKAT@
GNULIB_LSEEK = @GNULIB_LSEEK@
GNULIB_LSTAT = @GNULIB_LSTAT@
GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
GNULIB_MBSCHR = @GNULIB_MBSCHR@
GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
GNULIB_MBSLEN = @GNULIB_MBSLEN@
GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
GNULIB_MBSSEP = @GNULIB_MBSSEP@
GNULIB_MBSSPN = @GNULIB_MBSSPN@
GNULIB_MBSSTR = @GNULIB_MBSSTR@
GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
GNULIB_MBTOWC = @GNULIB_MBTOWC@
GNULIB_MEMCHR = @GNULIB_MEMCHR@
GNULIB_MEMMEM = @GNULIB_MEMMEM@
GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
GNULIB_MKFIFO = @GNULIB_MKFIFO@
GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
GNULIB_MKNOD = @GNULIB_MKNOD@
GNULIB_MKNODAT = @GNULIB_MKNODAT@
GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
GNULIB_MKTIME = @GNULIB_MKTIME@
GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
GNULIB_OPEN = @GNULIB_OPEN@
GNULIB_OPENAT = @GNULIB_OPENAT@
GNULIB_OPENDIR = @GNULIB_OPENDIR@
GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@
GNULIB_PCLOSE = @GNULIB_PCLOSE@
GNULIB_PERROR = @GNULIB_PERROR@
GNULIB_PIPE = @GNULIB_PIPE@
GNULIB_PIPE2 = @GNULIB_PIPE2@
GNULIB_POPEN = @GNULIB_POPEN@
GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
GNULIB_PREAD = @GNULIB_PREAD@
GNULIB_PRINTF = @GNULIB_PRINTF@
GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
GNULIB_PTSNAME = @GNULIB_PTSNAME@
GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_QSORT_R = @GNULIB_QSORT_R@
GNULIB_RANDOM = @GNULIB_RANDOM@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READ = @GNULIB_READ@
GNULIB_READDIR = @GNULIB_READDIR@
GNULIB_READLINK = @GNULIB_READLINK@
GNULIB_READLINKAT = @GNULIB_READLINKAT@
GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
GNULIB_REALPATH = @GNULIB_REALPATH@
GNULIB_REMOVE = @GNULIB_REMOVE@
GNULIB_RENAME = @GNULIB_RENAME@
GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
GNULIB_RMDIR = @GNULIB_RMDIR@
GNULIB_RPMATCH = @GNULIB_RPMATCH@
GNULIB_SCANDIR = @GNULIB_SCANDIR@
GNULIB_SCANF = @GNULIB_SCANF@
GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
GNULIB_SETENV = @GNULIB_SETENV@
GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
GNULIB_SLEEP = @GNULIB_SLEEP@
GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
GNULIB_STAT = @GNULIB_STAT@
GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
GNULIB_STPCPY = @GNULIB_STPCPY@
GNULIB_STPNCPY = @GNULIB_STPNCPY@
GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
GNULIB_STRDUP = @GNULIB_STRDUP@
GNULIB_STRERROR = @GNULIB_STRERROR@
GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
GNULIB_STRNCAT = @GNULIB_STRNCAT@
GNULIB_STRNDUP = @GNULIB_STRNDUP@
GNULIB_STRNLEN = @GNULIB_STRNLEN@
GNULIB_STRPBRK = @GNULIB_STRPBRK@
GNULIB_STRPTIME = @GNULIB_STRPTIME@
GNULIB_STRSEP = @GNULIB_STRSEP@
GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
GNULIB_STRSTR = @GNULIB_STRSTR@
GNULIB_STRTOD = @GNULIB_STRTOD@
GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
GNULIB_STRTOLL = @GNULIB_STRTOLL@
GNULIB_STRTOULL = @GNULIB_STRTOULL@
GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
GNULIB_SYMLINK = @GNULIB_SYMLINK@
GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
GNULIB_TIMEGM = @GNULIB_TIMEGM@
GNULIB_TIME_R = @GNULIB_TIME_R@
GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
GNULIB_TMPFILE = @GNULIB_TMPFILE@
GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
GNULIB_UNLINK = @GNULIB_UNLINK@
GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
GNULIB_UNSETENV = @GNULIB_UNSETENV@
GNULIB_USLEEP = @GNULIB_USLEEP@
GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
GNULIB_VFSCANF = @GNULIB_VFSCANF@
GNULIB_VPRINTF = @GNULIB_VPRINTF@
GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
GNULIB_VSCANF = @GNULIB_VSCANF@
GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
GNULIB_WCTOMB = @GNULIB_WCTOMB@
GNULIB_WRITE = @GNULIB_WRITE@
GNULIB__EXIT = @GNULIB__EXIT@
GREP = @GREP@
HAVE_ALPHASORT = @HAVE_ALPHASORT@
HAVE_ATOLL = @HAVE_ATOLL@
HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
HAVE_CHOWN = @HAVE_CHOWN@
HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
HAVE_DIRENT_H = @HAVE_DIRENT_H@
HAVE_DPRINTF = @HAVE_DPRINTF@
HAVE_DUP2 = @HAVE_DUP2@
HAVE_DUP3 = @HAVE_DUP3@
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
HAVE_FACCESSAT = @HAVE_FACCESSAT@
HAVE_FCHDIR = @HAVE_FCHDIR@
HAVE_FCHMODAT = @HAVE_FCHMODAT@
HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
HAVE_FCNTL = @HAVE_FCNTL@
HAVE_FDATASYNC = @HAVE_FDATASYNC@
HAVE_FDOPENDIR = @HAVE_FDOPENDIR@
HAVE_FFSL = @HAVE_FFSL@
HAVE_FFSLL = @HAVE_FFSLL@
HAVE_FSEEKO = @HAVE_FSEEKO@
HAVE_FSTATAT = @HAVE_FSTATAT@
HAVE_FSYNC = @HAVE_FSYNC@
HAVE_FTELLO = @HAVE_FTELLO@
HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
HAVE_FUTIMENS = @HAVE_FUTIMENS@
HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
HAVE_GETGROUPS = @HAVE_GETGROUPS@
HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
HAVE_GETLOGIN = @HAVE_GETLOGIN@
HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
HAVE_GRANTPT = @HAVE_GRANTPT@
HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
HAVE_LCHMOD = @HAVE_LCHMOD@
HAVE_LCHOWN = @HAVE_LCHOWN@
HAVE_LINK = @HAVE_LINK@
HAVE_LINKAT = @HAVE_LINKAT@
HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
HAVE_LSTAT = @HAVE_LSTAT@
HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
HAVE_MBSLEN = @HAVE_MBSLEN@
HAVE_MEMCHR = @HAVE_MEMCHR@
HAVE_MEMPCPY = @HAVE_MEMPCPY@
HAVE_MKDIRAT = @HAVE_MKDIRAT@
HAVE_MKDTEMP = @HAVE_MKDTEMP@
HAVE_MKFIFO = @HAVE_MKFIFO@
HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
HAVE_MKNOD = @HAVE_MKNOD@
HAVE_MKNODAT = @HAVE_MKNODAT@
HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OPENDIR = @HAVE_OPENDIR@
HAVE_OS_H = @HAVE_OS_H@
HAVE_PCLOSE = @HAVE_PCLOSE@
HAVE_PIPE = @HAVE_PIPE@
HAVE_PIPE2 = @HAVE_PIPE2@
HAVE_POPEN = @HAVE_POPEN@
HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
HAVE_PWRITE = @HAVE_PWRITE@
HAVE_QSORT_R = @HAVE_QSORT_R@
HAVE_RANDOM = @HAVE_RANDOM@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
HAVE_READDIR = @HAVE_READDIR@
HAVE_READLINK = @HAVE_READLINK@
HAVE_READLINKAT = @HAVE_READLINKAT@
HAVE_REALPATH = @HAVE_REALPATH@
HAVE_RENAMEAT = @HAVE_RENAMEAT@
HAVE_REWINDDIR = @HAVE_REWINDDIR@
HAVE_RPMATCH = @HAVE_RPMATCH@
HAVE_SCANDIR = @HAVE_SCANDIR@
HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
HAVE_SETENV = @HAVE_SETENV@
HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
HAVE_SLEEP = @HAVE_SLEEP@
HAVE_STDINT_H = @HAVE_STDINT_H@
HAVE_STPCPY = @HAVE_STPCPY@
HAVE_STPNCPY = @HAVE_STPNCPY@
HAVE_STRCASESTR = @HAVE_STRCASESTR@
HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
HAVE_STRPBRK = @HAVE_STRPBRK@
HAVE_STRPTIME = @HAVE_STRPTIME@
HAVE_STRSEP = @HAVE_STRSEP@
HAVE_STRTOD = @HAVE_STRTOD@
HAVE_STRTOLL = @HAVE_STRTOLL@
HAVE_STRTOULL = @HAVE_STRTOULL@
HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
HAVE_SYMLINK = @HAVE_SYMLINK@
HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
HAVE_TIMEGM = @HAVE_TIMEGM@
HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
HAVE_UNISTD_H = @HAVE_UNISTD_H@
HAVE_UNLINKAT = @HAVE_UNLINKAT@
HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
HAVE_USLEEP = @HAVE_USLEEP@
HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
HAVE_VASPRINTF = @HAVE_VASPRINTF@
HAVE_VDPRINTF = @HAVE_VDPRINTF@
HAVE_WCHAR_H = @HAVE_WCHAR_H@
HAVE_WCHAR_T = @HAVE_WCHAR_T@
HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
HAVE__BOOL = @HAVE__BOOL@
HAVE__EXIT = @HAVE__EXIT@
INCLUDE_NEXT = @INCLUDE_NEXT@
INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBRPM_CFLAGS = @LIBRPM_CFLAGS@
LIBRPM_LIBS = @LIBRPM_LIBS@
LIBS = @LIBS@
LIMITS_H = @LIMITS_H@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKEPKG = @MAKEPKG@
MKDIR_P = @MKDIR_P@
MKE2FS = @MKE2FS@
MKE2FS_T_OPTION = @MKE2FS_T_OPTION@
NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
NEXT_DIRENT_H = @NEXT_DIRENT_H@
NEXT_ERRNO_H = @NEXT_ERRNO_H@
NEXT_FCNTL_H = @NEXT_FCNTL_H@
NEXT_LIMITS_H = @NEXT_LIMITS_H@
NEXT_STDDEF_H = @NEXT_STDDEF_H@
NEXT_STDINT_H = @NEXT_STDINT_H@
NEXT_STDIO_H = @NEXT_STDIO_H@
NEXT_STDLIB_H = @NEXT_STDLIB_H@
NEXT_STRING_H = @NEXT_STRING_H@
NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
NEXT_TIME_H = @NEXT_TIME_H@
NEXT_UNISTD_H = @NEXT_UNISTD_H@
OBJEXT = @OBJEXT@
OCAML = @OCAML@
OCAMLBEST = @OCAMLBEST@
OCAMLBUILD = @OCAMLBUILD@
OCAMLC = @OCAMLC@
OCAMLCDOTOPT = @OCAMLCDOTOPT@
OCAMLDEP = @OCAMLDEP@
OCAMLDOC = @OCAMLDOC@
OCAMLFIND = @OCAMLFIND@
OCAMLLIB = @OCAMLLIB@
OCAMLMKLIB = @OCAMLMKLIB@
OCAMLMKTOP = @OCAMLMKTOP@
OCAMLOPT = @OCAMLOPT@
OCAMLOPTDOTOPT = @OCAMLOPTDOTOPT@
OCAMLVERSION = @OCAMLVERSION@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACMAN = @PACMAN@
PACMAN_G2 = @PACMAN_G2@
PACTREE = @PACTREE@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERLDOC = @PERLDOC@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_CALLOC = @REPLACE_CALLOC@
REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
REPLACE_CHOWN = @REPLACE_CHOWN@
REPLACE_CLOSE = @REPLACE_CLOSE@
REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
REPLACE_DIRFD = @REPLACE_DIRFD@
REPLACE_DPRINTF = @REPLACE_DPRINTF@
REPLACE_DUP = @REPLACE_DUP@
REPLACE_DUP2 = @REPLACE_DUP2@
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
REPLACE_FCLOSE = @REPLACE_FCLOSE@
REPLACE_FCNTL = @REPLACE_FCNTL@
REPLACE_FDOPEN = @REPLACE_FDOPEN@
REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
REPLACE_FFLUSH = @REPLACE_FFLUSH@
REPLACE_FOPEN = @REPLACE_FOPEN@
REPLACE_FPRINTF = @REPLACE_FPRINTF@
REPLACE_FPURGE = @REPLACE_FPURGE@
REPLACE_FREOPEN = @REPLACE_FREOPEN@
REPLACE_FSEEK = @REPLACE_FSEEK@
REPLACE_FSEEKO = @REPLACE_FSEEKO@
REPLACE_FSTAT = @REPLACE_FSTAT@
REPLACE_FSTATAT = @REPLACE_FSTATAT@
REPLACE_FTELL = @REPLACE_FTELL@
REPLACE_FTELLO = @REPLACE_FTELLO@
REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
REPLACE_GETCWD = @REPLACE_GETCWD@
REPLACE_GETDELIM = @REPLACE_GETDELIM@
REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
REPLACE_GETLINE = @REPLACE_GETLINE@
REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
REPLACE_GMTIME = @REPLACE_GMTIME@
REPLACE_ISATTY = @REPLACE_ISATTY@
REPLACE_LCHOWN = @REPLACE_LCHOWN@
REPLACE_LINK = @REPLACE_LINK@
REPLACE_LINKAT = @REPLACE_LINKAT@
REPLACE_LOCALTIME = @REPLACE_LOCALTIME@
REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
REPLACE_LSEEK = @REPLACE_LSEEK@
REPLACE_LSTAT = @REPLACE_LSTAT@
REPLACE_MALLOC = @REPLACE_MALLOC@
REPLACE_MBTOWC = @REPLACE_MBTOWC@
REPLACE_MEMCHR = @REPLACE_MEMCHR@
REPLACE_MEMMEM = @REPLACE_MEMMEM@
REPLACE_MKDIR = @REPLACE_MKDIR@
REPLACE_MKFIFO = @REPLACE_MKFIFO@
REPLACE_MKNOD = @REPLACE_MKNOD@
REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
REPLACE_MKTIME = @REPLACE_MKTIME@
REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
REPLACE_NULL = @REPLACE_NULL@
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
REPLACE_OPEN = @REPLACE_OPEN@
REPLACE_OPENAT = @REPLACE_OPENAT@
REPLACE_OPENDIR = @REPLACE_OPENDIR@
REPLACE_PERROR = @REPLACE_PERROR@
REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PTSNAME = @REPLACE_PTSNAME@
REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
REPLACE_PUTENV = @REPLACE_PUTENV@
REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_QSORT_R = @REPLACE_QSORT_R@
REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
REPLACE_READ = @REPLACE_READ@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_READLINKAT = @REPLACE_READLINKAT@
REPLACE_REALLOC = @REPLACE_REALLOC@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
REPLACE_RENAME = @REPLACE_RENAME@
REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
REPLACE_RMDIR = @REPLACE_RMDIR@
REPLACE_SETENV = @REPLACE_SETENV@
REPLACE_SLEEP = @REPLACE_SLEEP@
REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
REPLACE_SPRINTF = @REPLACE_SPRINTF@
REPLACE_STAT = @REPLACE_STAT@
REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
REPLACE_STPNCPY = @REPLACE_STPNCPY@
REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
REPLACE_USLEEP = @REPLACE_USLEEP@
REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
REPLACE_VPRINTF = @REPLACE_VPRINTF@
REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
REPLACE_WCTOMB = @REPLACE_WCTOMB@
REPLACE_WRITE = @REPLACE_WRITE@
RPM = @RPM@
RPM2CPIO = @RPM2CPIO@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
STDALIGN_H = @STDALIGN_H@
STDBOOL_H = @STDBOOL_H@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
URPMI = @URPMI@
VERSION = @VERSION@
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
WERROR_CFLAGS = @WERROR_CFLAGS@
WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
WINT_T_SUFFIX = @WINT_T_SUFFIX@
XZCAT = @XZCAT@
YUMDOWNLOADER = @YUMDOWNLOADER@
ZCAT = @ZCAT@
ZYPPER = @ZYPPER@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gl_LIBOBJS = @gl_LIBOBJS@
gl_LTLIBOBJS = @gl_LTLIBOBJS@
gltests_LIBOBJS = @gltests_LIBOBJS@
gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
gltests_WITNESS = @gltests_WITNESS@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = 1.9.6 gnits
SUBDIRS =
noinst_HEADERS =
noinst_LIBRARIES = libgnu.a
noinst_LTLIBRARIES =
EXTRA_DIST = assure.h openat-priv.h openat-proc.c chdir-long.c \
chdir-long.h cloexec.h close.c closedir.c dirent-private.h \
cycle-check.h dev-ino.h dirent.in.h dirent--.h dirent-safer.h \
dirfd.c dirname.h dosname.h dup.c dup2.c errno.in.h error.c \
error.h exitfail.h fchdir.c fcntl.c fcntl.in.h fcntl--.h \
fcntl-safer.h fd-hook.h fdopendir.c filename.h filenamecat.h \
flexmember.h fstat.c fts-cycle.c fts.c fts_.h getcwd-lgpl.c \
getdtablesize.c gettimeofday.c hash.h i-ring.h intprops.h \
limits.in.h lstat.c malloc.c memchr.c memchr.valgrind \
mempcpy.c memrchr.c msvc-inval.c msvc-inval.h msvc-nothrow.c \
msvc-nothrow.h open.c openat.c openat.h fcntl--.h \
fcntl-safer.h dirent-private.h opendir.c pathmax.h \
dirent-private.h readdir.c realloc.c same-inode.h save-cwd.h \
$(top_srcdir)/./snippet/_Noreturn.h \
$(top_srcdir)/./snippet/arg-nonnull.h \
$(top_srcdir)/./snippet/c++defs.h \
$(top_srcdir)/./snippet/warn-on-use.h stat.c stdalign.in.h \
stdbool.in.h stddef.in.h stdint.in.h stdio.in.h stdlib.in.h \
strdup.c strerror.c strerror-override.c strerror-override.h \
string.in.h sys_stat.in.h sys_time.in.h sys_types.in.h \
time.in.h unistd.in.h unistd--.h unistd-safer.h verify.h \
xalloc-oversized.h
# The BUILT_SOURCES created by this Makefile snippet are not used via #include
# statements but through direct file reference. Therefore this snippet must be
# present in all Makefile.am that need it. This is ensured by the applicability
# 'all' defined above.
# The BUILT_SOURCES created by this Makefile snippet are not used via #include
# statements but through direct file reference. Therefore this snippet must be
# present in all Makefile.am that need it. This is ensured by the applicability
# 'all' defined above.
BUILT_SOURCES = dirent.h $(ERRNO_H) fcntl.h $(LIMITS_H) arg-nonnull.h \
c++defs.h warn-on-use.h $(STDALIGN_H) $(STDBOOL_H) $(STDDEF_H) \
$(STDINT_H) stdio.h stdlib.h string.h sys/stat.h sys/time.h \
sys/types.h time.h unistd.h
SUFFIXES =
MOSTLYCLEANFILES = core *.stackdump dirent.h dirent.h-t errno.h \
errno.h-t fcntl.h fcntl.h-t limits.h limits.h-t arg-nonnull.h \
arg-nonnull.h-t c++defs.h c++defs.h-t warn-on-use.h \
warn-on-use.h-t stdalign.h stdalign.h-t stdbool.h stdbool.h-t \
stddef.h stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t \
stdlib.h stdlib.h-t string.h string.h-t sys/stat.h \
sys/stat.h-t sys/time.h sys/time.h-t sys/types.h sys/types.h-t \
time.h time.h-t unistd.h unistd.h-t
MOSTLYCLEANDIRS = sys
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
AM_CPPFLAGS =
AM_CFLAGS =
libgnu_a_SOURCES = bitrotate.h bitrotate.c cloexec.c cycle-check.c \
opendir-safer.c dirname-lgpl.c basename-lgpl.c stripslash.c \
exitfail.c creat-safer.c open-safer.c fd-hook.c \
filenamecat-lgpl.c getprogname.h getprogname.c gettext.h \
hash.c i-ring.c openat-die.c openat-safer.c save-cwd.c \
unistd.c dup-safer.c fd-safer.c pipe-safer.c
libgnu_a_LIBADD = $(gl_LIBOBJS)
libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
EXTRA_libgnu_a_SOURCES = openat-proc.c chdir-long.c close.c closedir.c \
dirfd.c dup.c dup2.c error.c fchdir.c fcntl.c fdopendir.c \
fstat.c fts-cycle.c fts.c getcwd-lgpl.c getdtablesize.c \
gettimeofday.c lstat.c malloc.c memchr.c mempcpy.c memrchr.c \
msvc-inval.c msvc-nothrow.c open.c openat.c opendir.c \
readdir.c realloc.c stat.c strdup.c strerror.c \
strerror-override.c
# Use this preprocessor expression to decide whether #include_next works.
# Do not rely on a 'configure'-time test for this, since the expression
# might appear in an installed header, which is used by some other compiler.
HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER)
# Because this Makefile snippet defines a variable used by other
# gnulib Makefile snippets, it must be present in all Makefile.am that
# need it. This is ensured by the applicability 'all' defined above.
_NORETURN_H = $(top_srcdir)/./snippet/_Noreturn.h
ARG_NONNULL_H = arg-nonnull.h
CXXDEFS_H = c++defs.h
WARN_ON_USE_H = warn-on-use.h
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnits lib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libgnu.a: $(libgnu_a_OBJECTS) $(libgnu_a_DEPENDENCIES) $(EXTRA_libgnu_a_DEPENDENCIES)
$(AM_V_at)-rm -f libgnu.a
$(AM_V_AR)$(libgnu_a_AR) libgnu.a $(libgnu_a_OBJECTS) $(libgnu_a_LIBADD)
$(AM_V_at)$(RANLIB) libgnu.a
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename-lgpl.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitrotate.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chdir-long.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cloexec.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closedir.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat-safer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cycle-check.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirfd.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname-lgpl.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup-safer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exitfail.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-hook.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-safer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdopendir.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat-lgpl.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fts-cycle.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fts.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd-lgpl.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getprogname.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i-ring.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mempcpy.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memrchr.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-inval.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-nothrow.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open-safer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-die.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-proc.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-safer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendir-safer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendir.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe-safer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/realloc.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/save-cwd.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror-override.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unistd.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-recursive
all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS)
installdirs: installdirs-recursive
installdirs-am:
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-recursive
clean-am: clean-generic clean-noinstLIBRARIES clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-recursive
-rm -f ./$(DEPDIR)/basename-lgpl.Po
-rm -f ./$(DEPDIR)/bitrotate.Po
-rm -f ./$(DEPDIR)/chdir-long.Po
-rm -f ./$(DEPDIR)/cloexec.Po
-rm -f ./$(DEPDIR)/close.Po
-rm -f ./$(DEPDIR)/closedir.Po
-rm -f ./$(DEPDIR)/creat-safer.Po
-rm -f ./$(DEPDIR)/cycle-check.Po
-rm -f ./$(DEPDIR)/dirfd.Po
-rm -f ./$(DEPDIR)/dirname-lgpl.Po
-rm -f ./$(DEPDIR)/dup-safer.Po
-rm -f ./$(DEPDIR)/dup.Po
-rm -f ./$(DEPDIR)/dup2.Po
-rm -f ./$(DEPDIR)/error.Po
-rm -f ./$(DEPDIR)/exitfail.Po
-rm -f ./$(DEPDIR)/fchdir.Po
-rm -f ./$(DEPDIR)/fcntl.Po
-rm -f ./$(DEPDIR)/fd-hook.Po
-rm -f ./$(DEPDIR)/fd-safer.Po
-rm -f ./$(DEPDIR)/fdopendir.Po
-rm -f ./$(DEPDIR)/filenamecat-lgpl.Po
-rm -f ./$(DEPDIR)/fstat.Po
-rm -f ./$(DEPDIR)/fts-cycle.Po
-rm -f ./$(DEPDIR)/fts.Po
-rm -f ./$(DEPDIR)/getcwd-lgpl.Po
-rm -f ./$(DEPDIR)/getdtablesize.Po
-rm -f ./$(DEPDIR)/getprogname.Po
-rm -f ./$(DEPDIR)/gettimeofday.Po
-rm -f ./$(DEPDIR)/hash.Po
-rm -f ./$(DEPDIR)/i-ring.Po
-rm -f ./$(DEPDIR)/lstat.Po
-rm -f ./$(DEPDIR)/malloc.Po
-rm -f ./$(DEPDIR)/memchr.Po
-rm -f ./$(DEPDIR)/mempcpy.Po
-rm -f ./$(DEPDIR)/memrchr.Po
-rm -f ./$(DEPDIR)/msvc-inval.Po
-rm -f ./$(DEPDIR)/msvc-nothrow.Po
-rm -f ./$(DEPDIR)/open-safer.Po
-rm -f ./$(DEPDIR)/open.Po
-rm -f ./$(DEPDIR)/openat-die.Po
-rm -f ./$(DEPDIR)/openat-proc.Po
-rm -f ./$(DEPDIR)/openat-safer.Po
-rm -f ./$(DEPDIR)/openat.Po
-rm -f ./$(DEPDIR)/opendir-safer.Po
-rm -f ./$(DEPDIR)/opendir.Po
-rm -f ./$(DEPDIR)/pipe-safer.Po
-rm -f ./$(DEPDIR)/readdir.Po
-rm -f ./$(DEPDIR)/realloc.Po
-rm -f ./$(DEPDIR)/save-cwd.Po
-rm -f ./$(DEPDIR)/stat.Po
-rm -f ./$(DEPDIR)/strdup.Po
-rm -f ./$(DEPDIR)/strerror-override.Po
-rm -f ./$(DEPDIR)/strerror.Po
-rm -f ./$(DEPDIR)/stripslash.Po
-rm -f ./$(DEPDIR)/unistd.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f ./$(DEPDIR)/basename-lgpl.Po
-rm -f ./$(DEPDIR)/bitrotate.Po
-rm -f ./$(DEPDIR)/chdir-long.Po
-rm -f ./$(DEPDIR)/cloexec.Po
-rm -f ./$(DEPDIR)/close.Po
-rm -f ./$(DEPDIR)/closedir.Po
-rm -f ./$(DEPDIR)/creat-safer.Po
-rm -f ./$(DEPDIR)/cycle-check.Po
-rm -f ./$(DEPDIR)/dirfd.Po
-rm -f ./$(DEPDIR)/dirname-lgpl.Po
-rm -f ./$(DEPDIR)/dup-safer.Po
-rm -f ./$(DEPDIR)/dup.Po
-rm -f ./$(DEPDIR)/dup2.Po
-rm -f ./$(DEPDIR)/error.Po
-rm -f ./$(DEPDIR)/exitfail.Po
-rm -f ./$(DEPDIR)/fchdir.Po
-rm -f ./$(DEPDIR)/fcntl.Po
-rm -f ./$(DEPDIR)/fd-hook.Po
-rm -f ./$(DEPDIR)/fd-safer.Po
-rm -f ./$(DEPDIR)/fdopendir.Po
-rm -f ./$(DEPDIR)/filenamecat-lgpl.Po
-rm -f ./$(DEPDIR)/fstat.Po
-rm -f ./$(DEPDIR)/fts-cycle.Po
-rm -f ./$(DEPDIR)/fts.Po
-rm -f ./$(DEPDIR)/getcwd-lgpl.Po
-rm -f ./$(DEPDIR)/getdtablesize.Po
-rm -f ./$(DEPDIR)/getprogname.Po
-rm -f ./$(DEPDIR)/gettimeofday.Po
-rm -f ./$(DEPDIR)/hash.Po
-rm -f ./$(DEPDIR)/i-ring.Po
-rm -f ./$(DEPDIR)/lstat.Po
-rm -f ./$(DEPDIR)/malloc.Po
-rm -f ./$(DEPDIR)/memchr.Po
-rm -f ./$(DEPDIR)/mempcpy.Po
-rm -f ./$(DEPDIR)/memrchr.Po
-rm -f ./$(DEPDIR)/msvc-inval.Po
-rm -f ./$(DEPDIR)/msvc-nothrow.Po
-rm -f ./$(DEPDIR)/open-safer.Po
-rm -f ./$(DEPDIR)/open.Po
-rm -f ./$(DEPDIR)/openat-die.Po
-rm -f ./$(DEPDIR)/openat-proc.Po
-rm -f ./$(DEPDIR)/openat-safer.Po
-rm -f ./$(DEPDIR)/openat.Po
-rm -f ./$(DEPDIR)/opendir-safer.Po
-rm -f ./$(DEPDIR)/opendir.Po
-rm -f ./$(DEPDIR)/pipe-safer.Po
-rm -f ./$(DEPDIR)/readdir.Po
-rm -f ./$(DEPDIR)/realloc.Po
-rm -f ./$(DEPDIR)/save-cwd.Po
-rm -f ./$(DEPDIR)/stat.Po
-rm -f ./$(DEPDIR)/strdup.Po
-rm -f ./$(DEPDIR)/strerror-override.Po
-rm -f ./$(DEPDIR)/strerror.Po
-rm -f ./$(DEPDIR)/stripslash.Po
-rm -f ./$(DEPDIR)/unistd.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-local
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) all check install install-am \
install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--depfiles check check-am clean clean-generic \
clean-noinstLIBRARIES clean-noinstLTLIBRARIES cscopelist-am \
ctags ctags-am distclean distclean-compile distclean-generic \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic \
mostlyclean-local pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
.PRECIOUS: Makefile
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
-e 's/@''GNULIB_OPENDIR''@/$(GNULIB_OPENDIR)/g' \
-e 's/@''GNULIB_READDIR''@/$(GNULIB_READDIR)/g' \
-e 's/@''GNULIB_REWINDDIR''@/$(GNULIB_REWINDDIR)/g' \
-e 's/@''GNULIB_CLOSEDIR''@/$(GNULIB_CLOSEDIR)/g' \
-e 's/@''GNULIB_DIRFD''@/$(GNULIB_DIRFD)/g' \
-e 's/@''GNULIB_FDOPENDIR''@/$(GNULIB_FDOPENDIR)/g' \
-e 's/@''GNULIB_SCANDIR''@/$(GNULIB_SCANDIR)/g' \
-e 's/@''GNULIB_ALPHASORT''@/$(GNULIB_ALPHASORT)/g' \
-e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
-e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
-e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
-e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
-e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
-e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
-e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
-e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
-e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
-e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
-e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
-e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
-e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/dirent.in.h; \
} > $@-t && \
mv $@-t $@
# We need the following in order to create when the system
# doesn't have one that is POSIX compliant.
@GL_GENERATE_ERRNO_H_TRUE@errno.h: errno.in.h $(top_builddir)/config.status
@GL_GENERATE_ERRNO_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \
@GL_GENERATE_ERRNO_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
@GL_GENERATE_ERRNO_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
@GL_GENERATE_ERRNO_H_TRUE@ < $(srcdir)/errno.in.h; \
@GL_GENERATE_ERRNO_H_TRUE@ } > $@-t && \
@GL_GENERATE_ERRNO_H_TRUE@ mv $@-t $@
@GL_GENERATE_ERRNO_H_FALSE@errno.h: $(top_builddir)/config.status
@GL_GENERATE_ERRNO_H_FALSE@ rm -f $@
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
-e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
-e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
-e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
-e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
-e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
-e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
-e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
-e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
-e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/fcntl.in.h; \
} > $@-t && \
mv $@-t $@
# We need the following in order to create when the system
# doesn't have one that is compatible with GNU.
@GL_GENERATE_LIMITS_H_TRUE@limits.h: limits.in.h $(top_builddir)/config.status
@GL_GENERATE_LIMITS_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \
@GL_GENERATE_LIMITS_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
@GL_GENERATE_LIMITS_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \
@GL_GENERATE_LIMITS_H_TRUE@ < $(srcdir)/limits.in.h; \
@GL_GENERATE_LIMITS_H_TRUE@ } > $@-t && \
@GL_GENERATE_LIMITS_H_TRUE@ mv $@-t $@
@GL_GENERATE_LIMITS_H_FALSE@limits.h: $(top_builddir)/config.status
@GL_GENERATE_LIMITS_H_FALSE@ rm -f $@
# The arg-nonnull.h that gets inserted into generated .h files is the same as
# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
# off.
arg-nonnull.h: $(top_srcdir)/./snippet/arg-nonnull.h
$(AM_V_GEN)rm -f $@-t $@ && \
sed -n -e '/GL_ARG_NONNULL/,$$p' \
< $(top_srcdir)/./snippet/arg-nonnull.h \
> $@-t && \
mv $@-t $@
# The c++defs.h that gets inserted into generated .h files is the same as
# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
c++defs.h: $(top_srcdir)/./snippet/c++defs.h
$(AM_V_GEN)rm -f $@-t $@ && \
sed -n -e '/_GL_CXXDEFS/,$$p' \
< $(top_srcdir)/./snippet/c++defs.h \
> $@-t && \
mv $@-t $@
# The warn-on-use.h that gets inserted into generated .h files is the same as
# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
# off.
warn-on-use.h: $(top_srcdir)/./snippet/warn-on-use.h
$(AM_V_GEN)rm -f $@-t $@ && \
sed -n -e '/^.ifndef/,$$p' \
< $(top_srcdir)/./snippet/warn-on-use.h \
> $@-t && \
mv $@-t $@
# We need the following in order to create when the system
# doesn't have one that works.
@GL_GENERATE_STDALIGN_H_TRUE@stdalign.h: stdalign.in.h $(top_builddir)/config.status
@GL_GENERATE_STDALIGN_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \
@GL_GENERATE_STDALIGN_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@GL_GENERATE_STDALIGN_H_TRUE@ cat $(srcdir)/stdalign.in.h; \
@GL_GENERATE_STDALIGN_H_TRUE@ } > $@-t && \
@GL_GENERATE_STDALIGN_H_TRUE@ mv $@-t $@
@GL_GENERATE_STDALIGN_H_FALSE@stdalign.h: $(top_builddir)/config.status
@GL_GENERATE_STDALIGN_H_FALSE@ rm -f $@
# We need the following in order to create when the system
# doesn't have one that works.
@GL_GENERATE_STDBOOL_H_TRUE@stdbool.h: stdbool.in.h $(top_builddir)/config.status
@GL_GENERATE_STDBOOL_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \
@GL_GENERATE_STDBOOL_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@GL_GENERATE_STDBOOL_H_TRUE@ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
@GL_GENERATE_STDBOOL_H_TRUE@ } > $@-t && \
@GL_GENERATE_STDBOOL_H_TRUE@ mv $@-t $@
@GL_GENERATE_STDBOOL_H_FALSE@stdbool.h: $(top_builddir)/config.status
@GL_GENERATE_STDBOOL_H_FALSE@ rm -f $@
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
@GL_GENERATE_STDDEF_H_TRUE@stddef.h: stddef.in.h $(top_builddir)/config.status
@GL_GENERATE_STDDEF_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \
@GL_GENERATE_STDDEF_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
@GL_GENERATE_STDDEF_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
@GL_GENERATE_STDDEF_H_TRUE@ < $(srcdir)/stddef.in.h; \
@GL_GENERATE_STDDEF_H_TRUE@ } > $@-t && \
@GL_GENERATE_STDDEF_H_TRUE@ mv $@-t $@
@GL_GENERATE_STDDEF_H_FALSE@stddef.h: $(top_builddir)/config.status
@GL_GENERATE_STDDEF_H_FALSE@ rm -f $@
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
@GL_GENERATE_STDINT_H_TRUE@stdint.h: stdint.in.h $(top_builddir)/config.status
@GL_GENERATE_STDINT_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \
@GL_GENERATE_STDINT_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@GL_GENERATE_STDINT_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
@GL_GENERATE_STDINT_H_TRUE@ < $(srcdir)/stdint.in.h; \
@GL_GENERATE_STDINT_H_TRUE@ } > $@-t && \
@GL_GENERATE_STDINT_H_TRUE@ mv $@-t $@
@GL_GENERATE_STDINT_H_FALSE@stdint.h: $(top_builddir)/config.status
@GL_GENERATE_STDINT_H_FALSE@ rm -f $@
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
-e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
-e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \
-e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
-e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
-e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
-e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
-e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
-e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
-e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
-e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
-e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
-e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
-e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
-e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
-e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
-e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
-e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
-e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
-e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
-e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
-e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
-e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
-e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
-e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
-e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
-e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
-e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
-e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
-e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
-e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
-e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
-e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
-e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
-e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
-e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
-e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
-e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
-e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
-e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
-e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
-e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
-e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
-e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
-e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
-e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
-e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
-e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
-e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
< $(srcdir)/stdio.in.h | \
sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
-e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
-e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
-e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
-e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
-e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
-e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
-e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
-e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
-e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
-e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
-e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
-e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
-e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
-e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
-e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
-e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
-e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
-e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
-e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
-e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
-e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
-e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
-e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
-e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
-e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
-e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
-e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
-e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
-e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
-e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
-e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
-e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
-e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
-e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
-e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
-e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
$(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
-e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \
-e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \
-e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \
-e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \
-e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \
-e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \
-e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \
-e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \
-e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \
-e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \
-e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \
-e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \
-e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \
-e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \
-e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \
-e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
-e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
-e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
-e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \
-e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
-e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
-e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
-e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
-e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
-e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \
-e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
-e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
-e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
-e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \
-e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \
-e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \
-e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \
-e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \
< $(srcdir)/stdlib.in.h | \
sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
-e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
-e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
-e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
-e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
-e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
-e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
-e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
-e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
-e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
-e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
-e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
-e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \
-e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
-e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
-e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
-e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
-e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
-e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
-e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
-e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
-e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
-e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
-e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
-e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
-e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
-e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
-e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
-e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
-e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
-e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
-e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
-e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
-e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
-e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _Noreturn/r $(_NORETURN_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
-e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
-e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
-e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
-e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
-e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
-e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
-e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
-e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
-e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
-e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
-e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
-e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
-e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
-e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
-e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
-e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
-e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
-e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
-e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
-e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
-e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
-e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
-e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
-e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
-e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
-e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
-e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
-e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
-e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
-e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
-e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
-e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
-e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
-e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
-e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
-e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
-e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
< $(srcdir)/string.in.h | \
sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
-e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
-e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
-e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
-e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
-e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
-e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
-e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
-e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
-e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
-e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
-e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
-e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
-e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
-e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
-e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
-e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
-e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
-e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
-e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
-e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
-e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
-e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
-e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
-e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
-e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
-e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
-e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
-e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
-e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
-e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
-e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
-e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
< $(srcdir)/string.in.h; \
} > $@-t && \
mv $@-t $@
# We need the following in order to create when the system
# has one that is incomplete.
sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
-e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
-e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \
-e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \
-e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \
-e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \
-e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \
-e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \
-e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \
-e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \
-e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \
-e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \
-e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \
-e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \
-e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \
-e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
-e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
-e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
-e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
-e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
-e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
-e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \
-e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
-e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
-e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
-e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
-e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
-e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
-e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
-e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
-e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
-e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
-e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
-e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
-e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/sys_stat.in.h; \
} > $@-t && \
mv $@-t $@
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
-e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
-e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
-e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
-e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
-e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
-e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/sys_time.in.h; \
} > $@-t && \
mv $@-t $@
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
sys/types.h: sys_types.in.h $(top_builddir)/config.status
$(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
-e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
< $(srcdir)/sys_types.in.h; \
} > $@-t && \
mv $@-t $@
# We need the following in order to create when the system
# doesn't have one that works with the given compiler.
time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
-e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
-e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
-e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
-e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
-e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
-e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
-e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \
-e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
-e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
-e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
-e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
-e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \
-e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
-e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
-e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
-e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
-e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
-e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/time.in.h; \
} > $@-t && \
mv $@-t $@
# We need the following in order to create an empty placeholder for
# when the system doesn't have one.
unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
-e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
-e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \
-e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
-e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
-e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \
-e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \
-e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \
-e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \
-e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \
-e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \
-e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \
-e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \
-e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \
-e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \
-e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \
-e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \
-e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \
-e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \
-e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \
-e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
-e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
-e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
-e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
-e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
-e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
-e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
-e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \
-e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \
-e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \
-e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \
-e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \
-e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \
-e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \
-e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \
-e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \
-e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \
-e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \
-e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \
-e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \
-e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \
-e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \
-e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
-e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
-e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \
-e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
-e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \
-e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \
-e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \
-e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \
-e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
< $(srcdir)/unistd.in.h | \
sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
-e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
-e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
-e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
-e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
-e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
-e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
-e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \
-e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
-e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
-e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
-e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
-e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
-e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
-e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
-e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
-e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
-e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
-e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \
-e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
-e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
-e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
-e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
-e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
-e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \
-e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
-e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
-e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
-e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
-e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
-e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
-e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
-e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
-e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
-e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \
-e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
-e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
-e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
-e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
-e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
-e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
| \
sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
-e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
-e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
-e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
-e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
-e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
-e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \
-e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
-e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
-e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
-e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
-e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
-e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
-e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
-e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
-e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
-e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
-e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
-e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \
-e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
-e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
-e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
-e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
-e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
-e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
-e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
-e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
-e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
mostlyclean-local: mostlyclean-generic
@for dir in '' $(MOSTLYCLEANDIRS); do \
if test -n "$$dir" && test -d $$dir; then \
echo "rmdir $$dir"; rmdir $$dir; \
fi; \
done; \
:
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
supermin-5.2.2/lib/bitrotate.h 0000664 0001750 0001750 00000010574 13057324244 013234 0000000 0000000 /* bitrotate.h - Rotate bits in integers
Copyright (C) 2008-2017 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 3 of the License, 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, see . */
/* Written by Simon Josefsson , 2008. */
#ifndef _GL_BITROTATE_H
#define _GL_BITROTATE_H
#include
#include
#include
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
_GL_INLINE_HEADER_BEGIN
#ifndef BITROTATE_INLINE
# define BITROTATE_INLINE _GL_INLINE
#endif
#ifdef UINT64_MAX
/* Given an unsigned 64-bit argument X, return the value corresponding
to rotating the bits N steps to the left. N must be between 1 and
63 inclusive. */
BITROTATE_INLINE uint64_t
rotl64 (uint64_t x, int n)
{
return ((x << n) | (x >> (64 - n))) & UINT64_MAX;
}
/* Given an unsigned 64-bit argument X, return the value corresponding
to rotating the bits N steps to the right. N must be between 1 to
63 inclusive.*/
BITROTATE_INLINE uint64_t
rotr64 (uint64_t x, int n)
{
return ((x >> n) | (x << (64 - n))) & UINT64_MAX;
}
#endif
/* Given an unsigned 32-bit argument X, return the value corresponding
to rotating the bits N steps to the left. N must be between 1 and
31 inclusive. */
BITROTATE_INLINE uint32_t
rotl32 (uint32_t x, int n)
{
return ((x << n) | (x >> (32 - n))) & UINT32_MAX;
}
/* Given an unsigned 32-bit argument X, return the value corresponding
to rotating the bits N steps to the right. N must be between 1 to
31 inclusive.*/
BITROTATE_INLINE uint32_t
rotr32 (uint32_t x, int n)
{
return ((x >> n) | (x << (32 - n))) & UINT32_MAX;
}
/* Given a size_t argument X, return the value corresponding
to rotating the bits N steps to the left. N must be between 1 and
(CHAR_BIT * sizeof (size_t) - 1) inclusive. */
BITROTATE_INLINE size_t
rotl_sz (size_t x, int n)
{
return ((x << n) | (x >> ((CHAR_BIT * sizeof x) - n))) & SIZE_MAX;
}
/* Given a size_t argument X, return the value corresponding
to rotating the bits N steps to the right. N must be between 1 to
(CHAR_BIT * sizeof (size_t) - 1) inclusive. */
BITROTATE_INLINE size_t
rotr_sz (size_t x, int n)
{
return ((x >> n) | (x << ((CHAR_BIT * sizeof x) - n))) & SIZE_MAX;
}
/* Given an unsigned 16-bit argument X, return the value corresponding
to rotating the bits N steps to the left. N must be between 1 to
15 inclusive, but on most relevant targets N can also be 0 and 16
because 'int' is at least 32 bits and the arguments must widen
before shifting. */
BITROTATE_INLINE uint16_t
rotl16 (uint16_t x, int n)
{
return ((x << n) | (x >> (16 - n))) & UINT16_MAX;
}
/* Given an unsigned 16-bit argument X, return the value corresponding
to rotating the bits N steps to the right. N must be in 1 to 15
inclusive, but on most relevant targets N can also be 0 and 16
because 'int' is at least 32 bits and the arguments must widen
before shifting. */
BITROTATE_INLINE uint16_t
rotr16 (uint16_t x, int n)
{
return ((x >> n) | (x << (16 - n))) & UINT16_MAX;
}
/* Given an unsigned 8-bit argument X, return the value corresponding
to rotating the bits N steps to the left. N must be between 1 to 7
inclusive, but on most relevant targets N can also be 0 and 8
because 'int' is at least 32 bits and the arguments must widen
before shifting. */
BITROTATE_INLINE uint8_t
rotl8 (uint8_t x, int n)
{
return ((x << n) | (x >> (8 - n))) & UINT8_MAX;
}
/* Given an unsigned 8-bit argument X, return the value corresponding
to rotating the bits N steps to the right. N must be in 1 to 7
inclusive, but on most relevant targets N can also be 0 and 8
because 'int' is at least 32 bits and the arguments must widen
before shifting. */
BITROTATE_INLINE uint8_t
rotr8 (uint8_t x, int n)
{
return ((x >> n) | (x << (8 - n))) & UINT8_MAX;
}
_GL_INLINE_HEADER_END
#endif /* _GL_BITROTATE_H */
supermin-5.2.2/lib/bitrotate.c 0000664 0001750 0001750 00000000126 12310130007 013176 0000000 0000000 #include
#define BITROTATE_INLINE _GL_EXTERN_INLINE
#include "bitrotate.h"
supermin-5.2.2/lib/cloexec.c 0000664 0001750 0001750 00000004427 13057324244 012654 0000000 0000000 /* closexec.c - set or clear the close-on-exec descriptor flag
Copyright (C) 1991, 2004-2006, 2009-2017 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 3 of the License, 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, see .
The code is taken from glibc/manual/llio.texi */
#include
#include "cloexec.h"
#include
#include
#include
/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true,
or clear the flag if VALUE is false.
Return 0 on success, or -1 on error with 'errno' set.
Note that on MingW, this function does NOT protect DESC from being
inherited into spawned children. Instead, either use dup_cloexec
followed by closing the original DESC, or use interfaces such as
open or pipe2 that accept flags like O_CLOEXEC to create DESC
non-inheritable in the first place. */
int
set_cloexec_flag (int desc, bool value)
{
#ifdef F_SETFD
int flags = fcntl (desc, F_GETFD, 0);
if (0 <= flags)
{
int newflags = (value ? flags | FD_CLOEXEC : flags & ~FD_CLOEXEC);
if (flags == newflags
|| fcntl (desc, F_SETFD, newflags) != -1)
return 0;
}
return -1;
#else /* !F_SETFD */
/* Use dup2 to reject invalid file descriptors; the cloexec flag
will be unaffected. */
if (desc < 0)
{
errno = EBADF;
return -1;
}
if (dup2 (desc, desc) < 0)
/* errno is EBADF here. */
return -1;
/* There is nothing we can do on this kind of platform. Punt. */
return 0;
#endif /* !F_SETFD */
}
/* Duplicates a file handle FD, while marking the copy to be closed
prior to exec or spawn. Returns -1 and sets errno if FD could not
be duplicated. */
int
dup_cloexec (int fd)
{
return fcntl (fd, F_DUPFD_CLOEXEC, 0);
}
supermin-5.2.2/lib/cycle-check.c 0000664 0001750 0001750 00000005200 13057324244 013372 0000000 0000000 /* help detect directory cycles efficiently
Copyright (C) 2003-2006, 2009-2017 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 3 of the License, 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, see . */
/* Written by Jim Meyering */
#include
#include "cycle-check.h"
#include
#include
#include
#include
#include
#include "assure.h"
#define CC_MAGIC 9827862
/* Return true if I is a power of 2, or is zero. */
static bool
is_zero_or_power_of_two (uintmax_t i)
{
return (i & (i - 1)) == 0;
}
void
cycle_check_init (struct cycle_check_state *state)
{
state->chdir_counter = 0;
state->magic = CC_MAGIC;
}
/* In traversing a directory hierarchy, call this function once for each
descending chdir call, with SB corresponding to the chdir operand.
If SB corresponds to a directory that has already been seen,
return true to indicate that there is a directory cycle.
Note that this is done "lazily", which means that some of
the directories in the cycle may be processed twice before
the cycle is detected. */
bool
cycle_check (struct cycle_check_state *state, struct stat const *sb)
{
assure (state->magic == CC_MAGIC);
/* If the current directory ever happens to be the same
as the one we last recorded for the cycle detection,
then it's obviously part of a cycle. */
if (state->chdir_counter && SAME_INODE (*sb, state->dev_ino))
return true;
/* If the number of "descending" chdir calls is a power of two,
record the dev/ino of the current directory. */
if (is_zero_or_power_of_two (++(state->chdir_counter)))
{
/* On all architectures that we know about, if the counter
overflows then there is a directory cycle here somewhere,
even if we haven't detected it yet. Typically this happens
only after the counter is incremented 2**64 times, so it's a
fairly theoretical point. */
if (state->chdir_counter == 0)
return true;
state->dev_ino.st_dev = sb->st_dev;
state->dev_ino.st_ino = sb->st_ino;
}
return false;
}
supermin-5.2.2/lib/opendir-safer.c 0000664 0001750 0001750 00000004301 13057324244 013757 0000000 0000000 /* Invoke opendir, but avoid some glitches.
Copyright (C) 2009-2017 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 3 of the License, 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, see . */
/* Written by Eric Blake. */
#include
#include "dirent-safer.h"
#include
#include
#include "unistd-safer.h"
/* Like opendir, but do not clobber stdin, stdout, or stderr. */
DIR *
opendir_safer (char const *name)
{
DIR *dp = opendir (name);
if (dp)
{
int fd = dirfd (dp);
if (0 <= fd && fd <= STDERR_FILENO)
{
/* If fdopendir is native (as on Linux), then it is safe to
assume dirfd(fdopendir(n))==n. If we are using the
gnulib module fdopendir, then this guarantee is not met,
but fdopendir recursively calls opendir_safer up to 3
times to at least get a safe fd. If fdopendir is not
present but dirfd is accurate (as on cygwin 1.5.x), then
we recurse up to 3 times ourselves. Finally, if dirfd
always fails (as on mingw), then we are already safe. */
DIR *newdp;
int e;
#if HAVE_FDOPENDIR || GNULIB_FDOPENDIR
int f = dup_safer (fd);
if (f < 0)
{
e = errno;
newdp = NULL;
}
else
{
newdp = fdopendir (f);
e = errno;
if (! newdp)
close (f);
}
#else /* !FDOPENDIR */
newdp = opendir_safer (name);
e = errno;
#endif
closedir (dp);
errno = e;
dp = newdp;
}
}
return dp;
}
supermin-5.2.2/lib/dirname-lgpl.c 0000664 0001750 0001750 00000006120 13057324244 013575 0000000 0000000 /* dirname.c -- return all but the last element in a file name
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2017 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 3 of the License, 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, see . */
#include
#include "dirname.h"
#include
#include
/* Return the length of the prefix of FILE that will be used by
dir_name. If FILE is in the working directory, this returns zero
even though 'dir_name (FILE)' will return ".". Works properly even
if there are trailing slashes (by effectively ignoring them). */
size_t
dir_len (char const *file)
{
size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file);
size_t length;
/* Advance prefix_length beyond important leading slashes. */
prefix_length += (prefix_length != 0
? (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
&& ISSLASH (file[prefix_length]))
: (ISSLASH (file[0])
? ((DOUBLE_SLASH_IS_DISTINCT_ROOT
&& ISSLASH (file[1]) && ! ISSLASH (file[2])
? 2 : 1))
: 0));
/* Strip the basename and any redundant slashes before it. */
for (length = last_component (file) - file;
prefix_length < length; length--)
if (! ISSLASH (file[length - 1]))
break;
return length;
}
/* In general, we can't use the builtin 'dirname' function if available,
since it has different meanings in different environments.
In some environments the builtin 'dirname' modifies its argument.
Return the leading directories part of FILE, allocated with malloc.
Works properly even if there are trailing slashes (by effectively
ignoring them). Return NULL on failure.
If lstat (FILE) would succeed, then { chdir (dir_name (FILE));
lstat (base_name (FILE)); } will access the same file. Likewise,
if the sequence { chdir (dir_name (FILE));
rename (base_name (FILE), "foo"); } succeeds, you have renamed FILE
to "foo" in the same directory FILE was in. */
char *
mdir_name (char const *file)
{
size_t length = dir_len (file);
bool append_dot = (length == 0
|| (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
&& length == FILE_SYSTEM_PREFIX_LEN (file)
&& file[2] != '\0' && ! ISSLASH (file[2])));
char *dir = malloc (length + append_dot + 1);
if (!dir)
return NULL;
memcpy (dir, file, length);
if (append_dot)
dir[length++] = '.';
dir[length] = '\0';
return dir;
}
supermin-5.2.2/lib/basename-lgpl.c 0000664 0001750 0001750 00000004061 13057324244 013733 0000000 0000000 /* basename.c -- return the last element in a file name
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2017 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 3 of the License, 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, see . */
#include
#include "dirname.h"
#include
/* Return the address of the last file name component of NAME. If
NAME has no relative file name components because it is a file
system root, return the empty string. */
char *
last_component (char const *name)
{
char const *base = name + FILE_SYSTEM_PREFIX_LEN (name);
char const *p;
bool saw_slash = false;
while (ISSLASH (*base))
base++;
for (p = base; *p; p++)
{
if (ISSLASH (*p))
saw_slash = true;
else if (saw_slash)
{
base = p;
saw_slash = false;
}
}
return (char *) base;
}
/* Return the length of the basename NAME. Typically NAME is the
value returned by base_name or last_component. Act like strlen
(NAME), except omit all trailing slashes. */
size_t
base_len (char const *name)
{
size_t len;
size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--)
continue;
if (DOUBLE_SLASH_IS_DISTINCT_ROOT && len == 1
&& ISSLASH (name[0]) && ISSLASH (name[1]) && ! name[2])
return 2;
if (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && prefix_len
&& len == prefix_len && ISSLASH (name[prefix_len]))
return prefix_len + 1;
return len;
}
supermin-5.2.2/lib/stripslash.c 0000664 0001750 0001750 00000003041 13057324245 013416 0000000 0000000 /* stripslash.c -- remove redundant trailing slashes from a file name
Copyright (C) 1990, 2001, 2003-2006, 2009-2017 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 3 of the License, 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, see . */
#include
#include "dirname.h"
/* Remove trailing slashes from FILE. Return true if a trailing slash
was removed. This is useful when using file name completion from a
shell that adds a "/" after directory names (such as tcsh and
bash), because on symlinks to directories, several system calls
have different semantics according to whether a trailing slash is
present. */
bool
strip_trailing_slashes (char *file)
{
char *base = last_component (file);
char *base_lim;
bool had_slash;
/* last_component returns "" for file system roots, but we need to turn
"///" into "/". */
if (! *base)
base = file;
base_lim = base + base_len (base);
had_slash = (*base_lim != '\0');
*base_lim = '\0';
return had_slash;
}
supermin-5.2.2/lib/exitfail.c 0000664 0001750 0001750 00000001533 13057324244 013032 0000000 0000000 /* Failure exit status
Copyright (C) 2002-2003, 2005-2007, 2009-2017 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 3 of the License, 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, see . */
#include
#include "exitfail.h"
#include
int volatile exit_failure = EXIT_FAILURE;
supermin-5.2.2/lib/creat-safer.c 0000664 0001750 0001750 00000001722 13057324244 013421 0000000 0000000 /* Invoke creat, but avoid some glitches.
Copyright (C) 2005-2006, 2009-2017 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 3 of the License, 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, see . */
/* Written by Jim Meyering. */
#include
#include "fcntl-safer.h"
#include
#include "unistd-safer.h"
int
creat_safer (char const *file, mode_t mode)
{
return fd_safer (creat (file, mode));
}
supermin-5.2.2/lib/open-safer.c 0000664 0001750 0001750 00000002445 13057324244 013267 0000000 0000000 /* Invoke open, but avoid some glitches.
Copyright (C) 2005-2006, 2008-2017 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 3 of the License, 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, see . */
/* Written by Paul Eggert. */
#include
#include "fcntl-safer.h"
#include
#include
#include "unistd-safer.h"
int
open_safer (char const *file, int flags, ...)
{
mode_t mode = 0;
if (flags & O_CREAT)
{
va_list ap;
va_start (ap, flags);
/* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
creates crashing code when 'mode_t' is smaller than 'int'. */
mode = va_arg (ap, PROMOTED_MODE_T);
va_end (ap);
}
return fd_safer (open (file, flags, mode));
}
supermin-5.2.2/lib/fd-hook.c 0000664 0001750 0001750 00000007012 13057324244 012552 0000000 0000000 /* Hook for making making file descriptor functions close(), ioctl() extensible.
Copyright (C) 2009-2017 Free Software Foundation, Inc.
Written by Bruno Haible , 2009.
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 3 of the License, 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, see . */
#include
/* Specification. */
#include "fd-hook.h"
#include
/* Currently, this entire code is only needed for the handling of sockets
on native Windows platforms. */
#if WINDOWS_SOCKETS
/* The first and last link in the doubly linked list.
Initially the list is empty. */
static struct fd_hook anchor = { &anchor, &anchor, NULL, NULL };
int
execute_close_hooks (const struct fd_hook *remaining_list, gl_close_fn primary,
int fd)
{
if (remaining_list == &anchor)
/* End of list reached. */
return primary (fd);
else
return remaining_list->private_close_fn (remaining_list->private_next,
primary, fd);
}
int
execute_all_close_hooks (gl_close_fn primary, int fd)
{
return execute_close_hooks (anchor.private_next, primary, fd);
}
int
execute_ioctl_hooks (const struct fd_hook *remaining_list, gl_ioctl_fn primary,
int fd, int request, void *arg)
{
if (remaining_list == &anchor)
/* End of list reached. */
return primary (fd, request, arg);
else
return remaining_list->private_ioctl_fn (remaining_list->private_next,
primary, fd, request, arg);
}
int
execute_all_ioctl_hooks (gl_ioctl_fn primary,
int fd, int request, void *arg)
{
return execute_ioctl_hooks (anchor.private_next, primary, fd, request, arg);
}
void
register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook, struct fd_hook *link)
{
if (close_hook == NULL)
close_hook = execute_close_hooks;
if (ioctl_hook == NULL)
ioctl_hook = execute_ioctl_hooks;
if (link->private_next == NULL && link->private_prev == NULL)
{
/* Add the link to the doubly linked list. */
link->private_next = anchor.private_next;
link->private_prev = &anchor;
link->private_close_fn = close_hook;
link->private_ioctl_fn = ioctl_hook;
anchor.private_next->private_prev = link;
anchor.private_next = link;
}
else
{
/* The link is already in use. */
if (link->private_close_fn != close_hook
|| link->private_ioctl_fn != ioctl_hook)
abort ();
}
}
void
unregister_fd_hook (struct fd_hook *link)
{
struct fd_hook *next = link->private_next;
struct fd_hook *prev = link->private_prev;
if (next != NULL && prev != NULL)
{
/* The link is in use. Remove it from the doubly linked list. */
prev->private_next = next;
next->private_prev = prev;
/* Clear the link, to mark it unused. */
link->private_next = NULL;
link->private_prev = NULL;
link->private_close_fn = NULL;
link->private_ioctl_fn = NULL;
}
}
#endif
supermin-5.2.2/lib/filenamecat-lgpl.c 0000664 0001750 0001750 00000005442 13057324244 014434 0000000 0000000 /* Concatenate two arbitrary file names.
Copyright (C) 1996-2007, 2009-2017 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 3 of the License, 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, see . */
/* Written by Jim Meyering. */
#include
/* Specification. */
#include "filenamecat.h"
#include
#include
#include "dirname.h"
#if ! HAVE_MEMPCPY && ! defined mempcpy
# define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
#endif
/* Return the longest suffix of F that is a relative file name.
If it has no such suffix, return the empty string. */
static char const * _GL_ATTRIBUTE_PURE
longest_relative_suffix (char const *f)
{
for (f += FILE_SYSTEM_PREFIX_LEN (f); ISSLASH (*f); f++)
continue;
return f;
}
/* Concatenate two file name components, DIR and ABASE, in
newly-allocated storage and return the result.
The resulting file name F is such that the commands "ls F" and "(cd
DIR; ls BASE)" refer to the same file, where BASE is ABASE with any
file system prefixes and leading separators removed.
Arrange for a directory separator if necessary between DIR and BASE
in the result, removing any redundant separators.
In any case, if BASE_IN_RESULT is non-NULL, set
*BASE_IN_RESULT to point to the copy of ABASE in the returned
concatenation. However, if ABASE begins with more than one slash,
set *BASE_IN_RESULT to point to the sole corresponding slash that
is copied into the result buffer.
Return NULL if malloc fails. */
char *
mfile_name_concat (char const *dir, char const *abase, char **base_in_result)
{
char const *dirbase = last_component (dir);
size_t dirbaselen = base_len (dirbase);
size_t dirlen = dirbase - dir + dirbaselen;
size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1]));
char const *base = longest_relative_suffix (abase);
size_t baselen = strlen (base);
char *p_concat = malloc (dirlen + needs_separator + baselen + 1);
char *p;
if (p_concat == NULL)
return NULL;
p = mempcpy (p_concat, dir, dirlen);
*p = DIRECTORY_SEPARATOR;
p += needs_separator;
if (base_in_result)
*base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase);
p = mempcpy (p, base, baselen);
*p = '\0';
return p_concat;
}
supermin-5.2.2/lib/getprogname.h 0000664 0001750 0001750 00000002173 13057324244 013543 0000000 0000000 /* Program name management.
Copyright (C) 2016-2017 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 3 of the License, 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, see . */
#ifndef _GL_GETPROGNAME_H
#define _GL_GETPROGNAME_H
#include
#ifdef __cplusplus
extern "C" {
#endif
/* Return the base name of the executing program.
On native Windows this will usually end in ".exe" or ".EXE". */
#ifndef HAVE_GETPROGNAME
extern char const *getprogname (void)
# ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
_GL_ATTRIBUTE_PURE
# endif
;
#endif
#ifdef __cplusplus
}
#endif
#endif
supermin-5.2.2/lib/getprogname.c 0000664 0001750 0001750 00000013353 13057324244 013540 0000000 0000000 /* Program name management.
Copyright (C) 2016-2017 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 3 of the License, 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, see . */
#include
/* Specification. */
#include "getprogname.h"
#include /* get program_invocation_name declaration */
#include /* get __argv declaration */
#ifdef _AIX
# include
# include
# include
#endif
#ifdef __MVS__
# ifndef _OPEN_SYS
# define _OPEN_SYS
# endif
# include
# include
#endif
#ifdef __hpux
# include
# include
# include
# include
#endif
#ifdef __sgi
# include
# include
# include
# include
# include
#endif
#include "dirname.h"
#ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */
char const *
getprogname (void)
{
# if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME /* glibc, BeOS */
/* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */
return program_invocation_short_name;
# elif HAVE_DECL_PROGRAM_INVOCATION_NAME /* glibc, BeOS */
/* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */
return last_component (program_invocation_name);
# elif HAVE_GETEXECNAME /* Solaris */
/* http://docs.oracle.com/cd/E19253-01/816-5168/6mbb3hrb1/index.html */
const char *p = getexecname ();
if (!p)
p = "?";
return last_component (p);
# elif HAVE_DECL___ARGV /* mingw, MSVC */
/* https://msdn.microsoft.com/en-us/library/dn727674.aspx */
const char *p = __argv && __argv[0] ? __argv[0] : "?";
return last_component (p);
# elif HAVE_VAR___PROGNAME /* OpenBSD, QNX */
/* http://man.openbsd.org/style.9 */
/* http://www.qnx.de/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fp%2F__progname.html */
/* Be careful to declare this only when we absolutely need it
(OpenBSD 5.1), rather than when it's available. Otherwise,
its mere declaration makes program_invocation_short_name
malfunction (have zero length) with Fedora 25's glibc. */
extern char *__progname;
const char *p = __progname;
return p && p[0] ? p : "?";
# elif _AIX /* AIX */
/* Idea by Bastien ROUCARIÈS,
http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00095.html
Reference: http://
ibm.biz/knowctr#ssw_aix_53/com.ibm.aix.basetechref/doc/basetrf1/getprocs.htm
*/
static char *p;
static int first = 1;
if (first)
{
first = 0;
pid_t pid = getpid ();
struct procentry64 procs;
p = (0 < getprocs64 (&procs, sizeof procs, NULL, 0, &pid, 1)
? strdup (procs.pi_comm)
: NULL);
if (!p)
p = "?";
}
return p;
# elif defined __hpux
static char *p;
static int first = 1;
if (first)
{
first = 0;
pid_t pid = getpid ();
struct pst_status status;
p = (0 < pstat_getproc (&status, sizeof status, 0, pid)
? strdup (status.pst_ucomm)
: NULL);
if (!p)
p = "?";
}
return p;
# elif __MVS__ /* z/OS */
/* https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/rtwgetp.htm */
static char *p = "?";
static int first = 1;
if (first)
{
pid_t pid = getpid ();
int token;
W_PSPROC buf;
first = 0;
memset (&buf, 0, sizeof(buf));
buf.ps_cmdptr = (char *) malloc (buf.ps_cmdlen = PS_CMDBLEN_LONG);
buf.ps_conttyptr = (char *) malloc (buf.ps_conttylen = PS_CONTTYBLEN);
buf.ps_pathptr = (char *) malloc (buf.ps_pathlen = PS_PATHBLEN);
if (buf.ps_cmdptr && buf.ps_conttyptr && buf.ps_pathptr)
{
for (token = 0; token >= 0;
token = w_getpsent (token, &buf, sizeof(buf)))
{
if (token > 0 && buf.ps_pid == pid)
{
char *s = strdup (last_component (buf.ps_pathptr));
if (s)
p = s;
break;
}
}
}
free (buf.ps_cmdptr);
free (buf.ps_conttyptr);
free (buf.ps_pathptr);
}
return p;
# elif defined __sgi /* IRIX */
char filename[50];
int fd;
sprintf (filename, "/proc/pinfo/%d", (int) getpid ());
fd = open (filename, O_RDONLY);
if (0 <= fd)
{
prpsinfo_t buf;
int ioctl_ok = 0 <= ioctl (fd, PIOCPSINFO, &buf);
close (fd);
if (ioctl_ok)
{
char *name = buf.pr_fname;
char *namesize = sizeof buf.pr_fname;
char *namenul = memchr (name, '\0', namesize);
size_t namelen = namenul ? namenul - name : namesize;
char *namecopy = malloc (namelen + 1);
if (namecopy)
{
namecopy[namelen] = 0;
return memcpy (namecopy, name, namelen);
}
}
}
return NULL;
# else
# error "getprogname module not ported to this OS"
# endif
}
#endif
supermin-5.2.2/lib/gettext.h 0000664 0001750 0001750 00000023644 13057324244 012725 0000000 0000000 /* Convenience header for conditional use of GNU .
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2017 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 3, 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, see . */
#ifndef _LIBGETTEXT_H
#define _LIBGETTEXT_H 1
/* NLS can be disabled through the configure --disable-nls option. */
#if ENABLE_NLS
/* Get declarations of GNU message catalog functions. */
# include
/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
the gettext() and ngettext() macros. This is an alternative to calling
textdomain(), and is useful for libraries. */
# ifdef DEFAULT_TEXT_DOMAIN
# undef gettext
# define gettext(Msgid) \
dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
# undef ngettext
# define ngettext(Msgid1, Msgid2, N) \
dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
# endif
#else
/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
chokes if dcgettext is defined as a macro. So include it now, to make
later inclusions of a NOP. We don't include
as well because people using "gettext.h" will not include ,
and also including would fail on SunOS 4, whereas
is OK. */
#if defined(__sun)
# include
#endif
/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
, which chokes if dcgettext is defined as a macro. So include
it now, to make later inclusions of a NOP. */
#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
# include
# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H
# include
# endif
#endif
/* Disabled NLS.
The casts to 'const char *' serve the purpose of producing warnings
for invalid uses of the value returned from these functions.
On pre-ANSI systems without 'const', the config.h file is supposed to
contain "#define const". */
# undef gettext
# define gettext(Msgid) ((const char *) (Msgid))
# undef dgettext
# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
# undef dcgettext
# define dcgettext(Domainname, Msgid, Category) \
((void) (Category), dgettext (Domainname, Msgid))
# undef ngettext
# define ngettext(Msgid1, Msgid2, N) \
((N) == 1 \
? ((void) (Msgid2), (const char *) (Msgid1)) \
: ((void) (Msgid1), (const char *) (Msgid2)))
# undef dngettext
# define dngettext(Domainname, Msgid1, Msgid2, N) \
((void) (Domainname), ngettext (Msgid1, Msgid2, N))
# undef dcngettext
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N))
# undef textdomain
# define textdomain(Domainname) ((const char *) (Domainname))
# undef bindtextdomain
# define bindtextdomain(Domainname, Dirname) \
((void) (Domainname), (const char *) (Dirname))
# undef bind_textdomain_codeset
# define bind_textdomain_codeset(Domainname, Codeset) \
((void) (Domainname), (const char *) (Codeset))
#endif
/* Prefer gnulib's setlocale override over libintl's setlocale override. */
#ifdef GNULIB_defined_setlocale
# undef setlocale
# define setlocale rpl_setlocale
#endif
/* A pseudo function call that serves as a marker for the automated
extraction of messages, but does not call gettext(). The run-time
translation is done at a different place in the code.
The argument, String, should be a literal string. Concatenated strings
and other string expressions won't work.
The macro's expansion is not parenthesized, so that it is suitable as
initializer for static 'char[]' or 'const char[]' variables. */
#define gettext_noop(String) String
/* The separator between msgctxt and msgid in a .mo file. */
#define GETTEXT_CONTEXT_GLUE "\004"
/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
short and rarely need to change.
The letter 'p' stands for 'particular' or 'special'. */
#ifdef DEFAULT_TEXT_DOMAIN
# define pgettext(Msgctxt, Msgid) \
pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
#else
# define pgettext(Msgctxt, Msgid) \
pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
#endif
#define dpgettext(Domainname, Msgctxt, Msgid) \
pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
#ifdef DEFAULT_TEXT_DOMAIN
# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
#else
# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
#endif
#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
static const char *
pgettext_aux (const char *domain,
const char *msg_ctxt_id, const char *msgid,
int category)
{
const char *translation = dcgettext (domain, msg_ctxt_id, category);
if (translation == msg_ctxt_id)
return msgid;
else
return translation;
}
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
static const char *
npgettext_aux (const char *domain,
const char *msg_ctxt_id, const char *msgid,
const char *msgid_plural, unsigned long int n,
int category)
{
const char *translation =
dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
if (translation == msg_ctxt_id || translation == msgid_plural)
return (n == 1 ? msgid : msgid_plural);
else
return translation;
}
/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
can be arbitrary expressions. But for string literals these macros are
less efficient than those above. */
#include
#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
/* || __STDC_VERSION__ >= 199901L */ )
# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
#else
# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
#endif
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
#include
#endif
#define pgettext_expr(Msgctxt, Msgid) \
dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
static const char *
dcpgettext_expr (const char *domain,
const char *msgctxt, const char *msgid,
int category)
{
size_t msgctxt_len = strlen (msgctxt) + 1;
size_t msgid_len = strlen (msgid) + 1;
const char *translation;
#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
char msg_ctxt_id[msgctxt_len + msgid_len];
#else
char buf[1024];
char *msg_ctxt_id =
(msgctxt_len + msgid_len <= sizeof (buf)
? buf
: (char *) malloc (msgctxt_len + msgid_len));
if (msg_ctxt_id != NULL)
#endif
{
int found_translation;
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
msg_ctxt_id[msgctxt_len - 1] = '\004';
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
translation = dcgettext (domain, msg_ctxt_id, category);
found_translation = (translation != msg_ctxt_id);
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
if (msg_ctxt_id != buf)
free (msg_ctxt_id);
#endif
if (found_translation)
return translation;
}
return msgid;
}
#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
static const char *
dcnpgettext_expr (const char *domain,
const char *msgctxt, const char *msgid,
const char *msgid_plural, unsigned long int n,
int category)
{
size_t msgctxt_len = strlen (msgctxt) + 1;
size_t msgid_len = strlen (msgid) + 1;
const char *translation;
#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
char msg_ctxt_id[msgctxt_len + msgid_len];
#else
char buf[1024];
char *msg_ctxt_id =
(msgctxt_len + msgid_len <= sizeof (buf)
? buf
: (char *) malloc (msgctxt_len + msgid_len));
if (msg_ctxt_id != NULL)
#endif
{
int found_translation;
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
msg_ctxt_id[msgctxt_len - 1] = '\004';
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
found_translation = !(translation == msg_ctxt_id || translation == msgid_plural);
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
if (msg_ctxt_id != buf)
free (msg_ctxt_id);
#endif
if (found_translation)
return translation;
}
return (n == 1 ? msgid : msgid_plural);
}
#endif /* _LIBGETTEXT_H */
supermin-5.2.2/lib/hash.c 0000664 0001750 0001750 00000114637 13057324244 012162 0000000 0000000 /* hash - hashing table processing.
Copyright (C) 1998-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc.
Written by Jim Meyering, 1992.
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 3 of the License, 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, see . */
/* A generic hash table package. */
/* Define USE_OBSTACK to 1 if you want the allocator to use obstacks instead
of malloc. If you change USE_OBSTACK, you have to recompile! */
#include
#include "hash.h"
#include "bitrotate.h"
#include "xalloc-oversized.h"
#include
#include
#include
#if USE_OBSTACK
# include "obstack.h"
# ifndef obstack_chunk_alloc
# define obstack_chunk_alloc malloc
# endif
# ifndef obstack_chunk_free
# define obstack_chunk_free free
# endif
#endif
struct hash_entry
{
void *data;
struct hash_entry *next;
};
struct hash_table
{
/* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
for a possibility of N_BUCKETS. Among those, N_BUCKETS_USED buckets
are not empty, there are N_ENTRIES active entries in the table. */
struct hash_entry *bucket;
struct hash_entry const *bucket_limit;
size_t n_buckets;
size_t n_buckets_used;
size_t n_entries;
/* Tuning arguments, kept in a physically separate structure. */
const Hash_tuning *tuning;
/* Three functions are given to 'hash_initialize', see the documentation
block for this function. In a word, HASHER randomizes a user entry
into a number up from 0 up to some maximum minus 1; COMPARATOR returns
true if two user entries compare equally; and DATA_FREER is the cleanup
function for a user entry. */
Hash_hasher hasher;
Hash_comparator comparator;
Hash_data_freer data_freer;
/* A linked list of freed struct hash_entry structs. */
struct hash_entry *free_entry_list;
#if USE_OBSTACK
/* Whenever obstacks are used, it is possible to allocate all overflowed
entries into a single stack, so they all can be freed in a single
operation. It is not clear if the speedup is worth the trouble. */
struct obstack entry_stack;
#endif
};
/* A hash table contains many internal entries, each holding a pointer to
some user-provided data (also called a user entry). An entry indistinctly
refers to both the internal entry and its associated user entry. A user
entry contents may be hashed by a randomization function (the hashing
function, or just "hasher" for short) into a number (or "slot") between 0
and the current table size. At each slot position in the hash table,
starts a linked chain of entries for which the user data all hash to this
slot. A bucket is the collection of all entries hashing to the same slot.
A good "hasher" function will distribute entries rather evenly in buckets.
In the ideal case, the length of each bucket is roughly the number of
entries divided by the table size. Finding the slot for a data is usually
done in constant time by the "hasher", and the later finding of a precise
entry is linear in time with the size of the bucket. Consequently, a
larger hash table size (that is, a larger number of buckets) is prone to
yielding shorter chains, *given* the "hasher" function behaves properly.
Long buckets slow down the lookup algorithm. One might use big hash table
sizes in hope to reduce the average length of buckets, but this might
become inordinate, as unused slots in the hash table take some space. The
best bet is to make sure you are using a good "hasher" function (beware
that those are not that easy to write! :-), and to use a table size
larger than the actual number of entries. */
/* If an insertion makes the ratio of nonempty buckets to table size larger
than the growth threshold (a number between 0.0 and 1.0), then increase
the table size by multiplying by the growth factor (a number greater than
1.0). The growth threshold defaults to 0.8, and the growth factor
defaults to 1.414, meaning that the table will have doubled its size
every second time 80% of the buckets get used. */
#define DEFAULT_GROWTH_THRESHOLD 0.8f
#define DEFAULT_GROWTH_FACTOR 1.414f
/* If a deletion empties a bucket and causes the ratio of used buckets to
table size to become smaller than the shrink threshold (a number between
0.0 and 1.0), then shrink the table by multiplying by the shrink factor (a
number greater than the shrink threshold but smaller than 1.0). The shrink
threshold and factor default to 0.0 and 1.0, meaning that the table never
shrinks. */
#define DEFAULT_SHRINK_THRESHOLD 0.0f
#define DEFAULT_SHRINK_FACTOR 1.0f
/* Use this to initialize or reset a TUNING structure to
some sensible values. */
static const Hash_tuning default_tuning =
{
DEFAULT_SHRINK_THRESHOLD,
DEFAULT_SHRINK_FACTOR,
DEFAULT_GROWTH_THRESHOLD,
DEFAULT_GROWTH_FACTOR,
false
};
/* Information and lookup. */
/* The following few functions provide information about the overall hash
table organization: the number of entries, number of buckets and maximum
length of buckets. */
/* Return the number of buckets in the hash table. The table size, the total
number of buckets (used plus unused), or the maximum number of slots, are
the same quantity. */
size_t
hash_get_n_buckets (const Hash_table *table)
{
return table->n_buckets;
}
/* Return the number of slots in use (non-empty buckets). */
size_t
hash_get_n_buckets_used (const Hash_table *table)
{
return table->n_buckets_used;
}
/* Return the number of active entries. */
size_t
hash_get_n_entries (const Hash_table *table)
{
return table->n_entries;
}
/* Return the length of the longest chain (bucket). */
size_t
hash_get_max_bucket_length (const Hash_table *table)
{
struct hash_entry const *bucket;
size_t max_bucket_length = 0;
for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
{
if (bucket->data)
{
struct hash_entry const *cursor = bucket;
size_t bucket_length = 1;
while (cursor = cursor->next, cursor)
bucket_length++;
if (bucket_length > max_bucket_length)
max_bucket_length = bucket_length;
}
}
return max_bucket_length;
}
/* Do a mild validation of a hash table, by traversing it and checking two
statistics. */
bool
hash_table_ok (const Hash_table *table)
{
struct hash_entry const *bucket;
size_t n_buckets_used = 0;
size_t n_entries = 0;
for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
{
if (bucket->data)
{
struct hash_entry const *cursor = bucket;
/* Count bucket head. */
n_buckets_used++;
n_entries++;
/* Count bucket overflow. */
while (cursor = cursor->next, cursor)
n_entries++;
}
}
if (n_buckets_used == table->n_buckets_used && n_entries == table->n_entries)
return true;
return false;
}
void
hash_print_statistics (const Hash_table *table, FILE *stream)
{
size_t n_entries = hash_get_n_entries (table);
size_t n_buckets = hash_get_n_buckets (table);
size_t n_buckets_used = hash_get_n_buckets_used (table);
size_t max_bucket_length = hash_get_max_bucket_length (table);
fprintf (stream, "# entries: %lu\n", (unsigned long int) n_entries);
fprintf (stream, "# buckets: %lu\n", (unsigned long int) n_buckets);
fprintf (stream, "# buckets used: %lu (%.2f%%)\n",
(unsigned long int) n_buckets_used,
(100.0 * n_buckets_used) / n_buckets);
fprintf (stream, "max bucket length: %lu\n",
(unsigned long int) max_bucket_length);
}
/* Hash KEY and return a pointer to the selected bucket.
If TABLE->hasher misbehaves, abort. */
static struct hash_entry *
safe_hasher (const Hash_table *table, const void *key)
{
size_t n = table->hasher (key, table->n_buckets);
if (! (n < table->n_buckets))
abort ();
return table->bucket + n;
}
/* If ENTRY matches an entry already in the hash table, return the
entry from the table. Otherwise, return NULL. */
void *
hash_lookup (const Hash_table *table, const void *entry)
{
struct hash_entry const *bucket = safe_hasher (table, entry);
struct hash_entry const *cursor;
if (bucket->data == NULL)
return NULL;
for (cursor = bucket; cursor; cursor = cursor->next)
if (entry == cursor->data || table->comparator (entry, cursor->data))
return cursor->data;
return NULL;
}
/* Walking. */
/* The functions in this page traverse the hash table and process the
contained entries. For the traversal to work properly, the hash table
should not be resized nor modified while any particular entry is being
processed. In particular, entries should not be added, and an entry
may be removed only if there is no shrink threshold and the entry being
removed has already been passed to hash_get_next. */
/* Return the first data in the table, or NULL if the table is empty. */
void *
hash_get_first (const Hash_table *table)
{
struct hash_entry const *bucket;
if (table->n_entries == 0)
return NULL;
for (bucket = table->bucket; ; bucket++)
if (! (bucket < table->bucket_limit))
abort ();
else if (bucket->data)
return bucket->data;
}
/* Return the user data for the entry following ENTRY, where ENTRY has been
returned by a previous call to either 'hash_get_first' or 'hash_get_next'.
Return NULL if there are no more entries. */
void *
hash_get_next (const Hash_table *table, const void *entry)
{
struct hash_entry const *bucket = safe_hasher (table, entry);
struct hash_entry const *cursor;
/* Find next entry in the same bucket. */
cursor = bucket;
do
{
if (cursor->data == entry && cursor->next)
return cursor->next->data;
cursor = cursor->next;
}
while (cursor != NULL);
/* Find first entry in any subsequent bucket. */
while (++bucket < table->bucket_limit)
if (bucket->data)
return bucket->data;
/* None found. */
return NULL;
}
/* Fill BUFFER with pointers to active user entries in the hash table, then
return the number of pointers copied. Do not copy more than BUFFER_SIZE
pointers. */
size_t
hash_get_entries (const Hash_table *table, void **buffer,
size_t buffer_size)
{
size_t counter = 0;
struct hash_entry const *bucket;
struct hash_entry const *cursor;
for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
{
if (bucket->data)
{
for (cursor = bucket; cursor; cursor = cursor->next)
{
if (counter >= buffer_size)
return counter;
buffer[counter++] = cursor->data;
}
}
}
return counter;
}
/* Call a PROCESSOR function for each entry of a hash table, and return the
number of entries for which the processor function returned success. A
pointer to some PROCESSOR_DATA which will be made available to each call to
the processor function. The PROCESSOR accepts two arguments: the first is
the user entry being walked into, the second is the value of PROCESSOR_DATA
as received. The walking continue for as long as the PROCESSOR function
returns nonzero. When it returns zero, the walking is interrupted. */
size_t
hash_do_for_each (const Hash_table *table, Hash_processor processor,
void *processor_data)
{
size_t counter = 0;
struct hash_entry const *bucket;
struct hash_entry const *cursor;
for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
{
if (bucket->data)
{
for (cursor = bucket; cursor; cursor = cursor->next)
{
if (! processor (cursor->data, processor_data))
return counter;
counter++;
}
}
}
return counter;
}
/* Allocation and clean-up. */
/* Return a hash index for a NUL-terminated STRING between 0 and N_BUCKETS-1.
This is a convenience routine for constructing other hashing functions. */
#if USE_DIFF_HASH
/* About hashings, Paul Eggert writes to me (FP), on 1994-01-01: "Please see
B. J. McKenzie, R. Harries & T. Bell, Selecting a hashing algorithm,
Software--practice & experience 20, 2 (Feb 1990), 209-224. Good hash
algorithms tend to be domain-specific, so what's good for [diffutils'] io.c
may not be good for your application." */
size_t
hash_string (const char *string, size_t n_buckets)
{
# define HASH_ONE_CHAR(Value, Byte) \
((Byte) + rotl_sz (Value, 7))
size_t value = 0;
unsigned char ch;
for (; (ch = *string); string++)
value = HASH_ONE_CHAR (value, ch);
return value % n_buckets;
# undef HASH_ONE_CHAR
}
#else /* not USE_DIFF_HASH */
/* This one comes from 'recode', and performs a bit better than the above as
per a few experiments. It is inspired from a hashing routine found in the
very old Cyber 'snoop', itself written in typical Greg Mansfield style.
(By the way, what happened to this excellent man? Is he still alive?) */
size_t
hash_string (const char *string, size_t n_buckets)
{
size_t value = 0;
unsigned char ch;
for (; (ch = *string); string++)
value = (value * 31 + ch) % n_buckets;
return value;
}
#endif /* not USE_DIFF_HASH */
/* Return true if CANDIDATE is a prime number. CANDIDATE should be an odd
number at least equal to 11. */
static bool _GL_ATTRIBUTE_CONST
is_prime (size_t candidate)
{
size_t divisor = 3;
size_t square = divisor * divisor;
while (square < candidate && (candidate % divisor))
{
divisor++;
square += 4 * divisor;
divisor++;
}
return (candidate % divisor ? true : false);
}
/* Round a given CANDIDATE number up to the nearest prime, and return that
prime. Primes lower than 10 are merely skipped. */
static size_t _GL_ATTRIBUTE_CONST
next_prime (size_t candidate)
{
/* Skip small primes. */
if (candidate < 10)
candidate = 10;
/* Make it definitely odd. */
candidate |= 1;
while (SIZE_MAX != candidate && !is_prime (candidate))
candidate += 2;
return candidate;
}
void
hash_reset_tuning (Hash_tuning *tuning)
{
*tuning = default_tuning;
}
/* If the user passes a NULL hasher, we hash the raw pointer. */
static size_t
raw_hasher (const void *data, size_t n)
{
/* When hashing unique pointers, it is often the case that they were
generated by malloc and thus have the property that the low-order
bits are 0. As this tends to give poorer performance with small
tables, we rotate the pointer value before performing division,
in an attempt to improve hash quality. */
size_t val = rotr_sz ((size_t) data, 3);
return val % n;
}
/* If the user passes a NULL comparator, we use pointer comparison. */
static bool
raw_comparator (const void *a, const void *b)
{
return a == b;
}
/* For the given hash TABLE, check the user supplied tuning structure for
reasonable values, and return true if there is no gross error with it.
Otherwise, definitively reset the TUNING field to some acceptable default
in the hash table (that is, the user loses the right of further modifying
tuning arguments), and return false. */
static bool
check_tuning (Hash_table *table)
{
const Hash_tuning *tuning = table->tuning;
float epsilon;
if (tuning == &default_tuning)
return true;
/* Be a bit stricter than mathematics would require, so that
rounding errors in size calculations do not cause allocations to
fail to grow or shrink as they should. The smallest allocation
is 11 (due to next_prime's algorithm), so an epsilon of 0.1
should be good enough. */
epsilon = 0.1f;
if (epsilon < tuning->growth_threshold
&& tuning->growth_threshold < 1 - epsilon
&& 1 + epsilon < tuning->growth_factor
&& 0 <= tuning->shrink_threshold
&& tuning->shrink_threshold + epsilon < tuning->shrink_factor
&& tuning->shrink_factor <= 1
&& tuning->shrink_threshold + epsilon < tuning->growth_threshold)
return true;
table->tuning = &default_tuning;
return false;
}
/* Compute the size of the bucket array for the given CANDIDATE and
TUNING, or return 0 if there is no possible way to allocate that
many entries. */
static size_t _GL_ATTRIBUTE_PURE
compute_bucket_size (size_t candidate, const Hash_tuning *tuning)
{
if (!tuning->is_n_buckets)
{
float new_candidate = candidate / tuning->growth_threshold;
if (SIZE_MAX <= new_candidate)
return 0;
candidate = new_candidate;
}
candidate = next_prime (candidate);
if (xalloc_oversized (candidate, sizeof (struct hash_entry *)))
return 0;
return candidate;
}
/* Allocate and return a new hash table, or NULL upon failure. The initial
number of buckets is automatically selected so as to _guarantee_ that you
may insert at least CANDIDATE different user entries before any growth of
the hash table size occurs. So, if have a reasonably tight a-priori upper
bound on the number of entries you intend to insert in the hash table, you
may save some table memory and insertion time, by specifying it here. If
the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE
argument has its meaning changed to the wanted number of buckets.
TUNING points to a structure of user-supplied values, in case some fine
tuning is wanted over the default behavior of the hasher. If TUNING is
NULL, the default tuning parameters are used instead. If TUNING is
provided but the values requested are out of bounds or might cause
rounding errors, return NULL.
The user-supplied HASHER function, when not NULL, accepts two
arguments ENTRY and TABLE_SIZE. It computes, by hashing ENTRY contents, a
slot number for that entry which should be in the range 0..TABLE_SIZE-1.
This slot number is then returned.
The user-supplied COMPARATOR function, when not NULL, accepts two
arguments pointing to user data, it then returns true for a pair of entries
that compare equal, or false otherwise. This function is internally called
on entries which are already known to hash to the same bucket index,
but which are distinct pointers.
The user-supplied DATA_FREER function, when not NULL, may be later called
with the user data as an argument, just before the entry containing the
data gets freed. This happens from within 'hash_free' or 'hash_clear'.
You should specify this function only if you want these functions to free
all of your 'data' data. This is typically the case when your data is
simply an auxiliary struct that you have malloc'd to aggregate several
values. */
Hash_table *
hash_initialize (size_t candidate, const Hash_tuning *tuning,
Hash_hasher hasher, Hash_comparator comparator,
Hash_data_freer data_freer)
{
Hash_table *table;
if (hasher == NULL)
hasher = raw_hasher;
if (comparator == NULL)
comparator = raw_comparator;
table = malloc (sizeof *table);
if (table == NULL)
return NULL;
if (!tuning)
tuning = &default_tuning;
table->tuning = tuning;
if (!check_tuning (table))
{
/* Fail if the tuning options are invalid. This is the only occasion
when the user gets some feedback about it. Once the table is created,
if the user provides invalid tuning options, we silently revert to
using the defaults, and ignore further request to change the tuning
options. */
goto fail;
}
table->n_buckets = compute_bucket_size (candidate, tuning);
if (!table->n_buckets)
goto fail;
table->bucket = calloc (table->n_buckets, sizeof *table->bucket);
if (table->bucket == NULL)
goto fail;
table->bucket_limit = table->bucket + table->n_buckets;
table->n_buckets_used = 0;
table->n_entries = 0;
table->hasher = hasher;
table->comparator = comparator;
table->data_freer = data_freer;
table->free_entry_list = NULL;
#if USE_OBSTACK
obstack_init (&table->entry_stack);
#endif
return table;
fail:
free (table);
return NULL;
}
/* Make all buckets empty, placing any chained entries on the free list.
Apply the user-specified function data_freer (if any) to the datas of any
affected entries. */
void
hash_clear (Hash_table *table)
{
struct hash_entry *bucket;
for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
{
if (bucket->data)
{
struct hash_entry *cursor;
struct hash_entry *next;
/* Free the bucket overflow. */
for (cursor = bucket->next; cursor; cursor = next)
{
if (table->data_freer)
table->data_freer (cursor->data);
cursor->data = NULL;
next = cursor->next;
/* Relinking is done one entry at a time, as it is to be expected
that overflows are either rare or short. */
cursor->next = table->free_entry_list;
table->free_entry_list = cursor;
}
/* Free the bucket head. */
if (table->data_freer)
table->data_freer (bucket->data);
bucket->data = NULL;
bucket->next = NULL;
}
}
table->n_buckets_used = 0;
table->n_entries = 0;
}
/* Reclaim all storage associated with a hash table. If a data_freer
function has been supplied by the user when the hash table was created,
this function applies it to the data of each entry before freeing that
entry. */
void
hash_free (Hash_table *table)
{
struct hash_entry *bucket;
struct hash_entry *cursor;
struct hash_entry *next;
/* Call the user data_freer function. */
if (table->data_freer && table->n_entries)
{
for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
{
if (bucket->data)
{
for (cursor = bucket; cursor; cursor = cursor->next)
table->data_freer (cursor->data);
}
}
}
#if USE_OBSTACK
obstack_free (&table->entry_stack, NULL);
#else
/* Free all bucket overflowed entries. */
for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
{
for (cursor = bucket->next; cursor; cursor = next)
{
next = cursor->next;
free (cursor);
}
}
/* Also reclaim the internal list of previously freed entries. */
for (cursor = table->free_entry_list; cursor; cursor = next)
{
next = cursor->next;
free (cursor);
}
#endif
/* Free the remainder of the hash table structure. */
free (table->bucket);
free (table);
}
/* Insertion and deletion. */
/* Get a new hash entry for a bucket overflow, possibly by recycling a
previously freed one. If this is not possible, allocate a new one. */
static struct hash_entry *
allocate_entry (Hash_table *table)
{
struct hash_entry *new;
if (table->free_entry_list)
{
new = table->free_entry_list;
table->free_entry_list = new->next;
}
else
{
#if USE_OBSTACK
new = obstack_alloc (&table->entry_stack, sizeof *new);
#else
new = malloc (sizeof *new);
#endif
}
return new;
}
/* Free a hash entry which was part of some bucket overflow,
saving it for later recycling. */
static void
free_entry (Hash_table *table, struct hash_entry *entry)
{
entry->data = NULL;
entry->next = table->free_entry_list;
table->free_entry_list = entry;
}
/* This private function is used to help with insertion and deletion. When
ENTRY matches an entry in the table, return a pointer to the corresponding
user data and set *BUCKET_HEAD to the head of the selected bucket.
Otherwise, return NULL. When DELETE is true and ENTRY matches an entry in
the table, unlink the matching entry. */
static void *
hash_find_entry (Hash_table *table, const void *entry,
struct hash_entry **bucket_head, bool delete)
{
struct hash_entry *bucket = safe_hasher (table, entry);
struct hash_entry *cursor;
*bucket_head = bucket;
/* Test for empty bucket. */
if (bucket->data == NULL)
return NULL;
/* See if the entry is the first in the bucket. */
if (entry == bucket->data || table->comparator (entry, bucket->data))
{
void *data = bucket->data;
if (delete)
{
if (bucket->next)
{
struct hash_entry *next = bucket->next;
/* Bump the first overflow entry into the bucket head, then save
the previous first overflow entry for later recycling. */
*bucket = *next;
free_entry (table, next);
}
else
{
bucket->data = NULL;
}
}
return data;
}
/* Scan the bucket overflow. */
for (cursor = bucket; cursor->next; cursor = cursor->next)
{
if (entry == cursor->next->data
|| table->comparator (entry, cursor->next->data))
{
void *data = cursor->next->data;
if (delete)
{
struct hash_entry *next = cursor->next;
/* Unlink the entry to delete, then save the freed entry for later
recycling. */
cursor->next = next->next;
free_entry (table, next);
}
return data;
}
}
/* No entry found. */
return NULL;
}
/* Internal helper, to move entries from SRC to DST. Both tables must
share the same free entry list. If SAFE, only move overflow
entries, saving bucket heads for later, so that no allocations will
occur. Return false if the free entry list is exhausted and an
allocation fails. */
static bool
transfer_entries (Hash_table *dst, Hash_table *src, bool safe)
{
struct hash_entry *bucket;
struct hash_entry *cursor;
struct hash_entry *next;
for (bucket = src->bucket; bucket < src->bucket_limit; bucket++)
if (bucket->data)
{
void *data;
struct hash_entry *new_bucket;
/* Within each bucket, transfer overflow entries first and
then the bucket head, to minimize memory pressure. After
all, the only time we might allocate is when moving the
bucket head, but moving overflow entries first may create
free entries that can be recycled by the time we finally
get to the bucket head. */
for (cursor = bucket->next; cursor; cursor = next)
{
data = cursor->data;
new_bucket = safe_hasher (dst, data);
next = cursor->next;
if (new_bucket->data)
{
/* Merely relink an existing entry, when moving from a
bucket overflow into a bucket overflow. */
cursor->next = new_bucket->next;
new_bucket->next = cursor;
}
else
{
/* Free an existing entry, when moving from a bucket
overflow into a bucket header. */
new_bucket->data = data;
dst->n_buckets_used++;
free_entry (dst, cursor);
}
}
/* Now move the bucket head. Be sure that if we fail due to
allocation failure that the src table is in a consistent
state. */
data = bucket->data;
bucket->next = NULL;
if (safe)
continue;
new_bucket = safe_hasher (dst, data);
if (new_bucket->data)
{
/* Allocate or recycle an entry, when moving from a bucket
header into a bucket overflow. */
struct hash_entry *new_entry = allocate_entry (dst);
if (new_entry == NULL)
return false;
new_entry->data = data;
new_entry->next = new_bucket->next;
new_bucket->next = new_entry;
}
else
{
/* Move from one bucket header to another. */
new_bucket->data = data;
dst->n_buckets_used++;
}
bucket->data = NULL;
src->n_buckets_used--;
}
return true;
}
/* For an already existing hash table, change the number of buckets through
specifying CANDIDATE. The contents of the hash table are preserved. The
new number of buckets is automatically selected so as to _guarantee_ that
the table may receive at least CANDIDATE different user entries, including
those already in the table, before any other growth of the hash table size
occurs. If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the
exact number of buckets desired. Return true iff the rehash succeeded. */
bool
hash_rehash (Hash_table *table, size_t candidate)
{
Hash_table storage;
Hash_table *new_table;
size_t new_size = compute_bucket_size (candidate, table->tuning);
if (!new_size)
return false;
if (new_size == table->n_buckets)
return true;
new_table = &storage;
new_table->bucket = calloc (new_size, sizeof *new_table->bucket);
if (new_table->bucket == NULL)
return false;
new_table->n_buckets = new_size;
new_table->bucket_limit = new_table->bucket + new_size;
new_table->n_buckets_used = 0;
new_table->n_entries = 0;
new_table->tuning = table->tuning;
new_table->hasher = table->hasher;
new_table->comparator = table->comparator;
new_table->data_freer = table->data_freer;
/* In order for the transfer to successfully complete, we need
additional overflow entries when distinct buckets in the old
table collide into a common bucket in the new table. The worst
case possible is a hasher that gives a good spread with the old
size, but returns a constant with the new size; if we were to
guarantee table->n_buckets_used-1 free entries in advance, then
the transfer would be guaranteed to not allocate memory.
However, for large tables, a guarantee of no further allocation
introduces a lot of extra memory pressure, all for an unlikely
corner case (most rehashes reduce, rather than increase, the
number of overflow entries needed). So, we instead ensure that
the transfer process can be reversed if we hit a memory
allocation failure mid-transfer. */
/* Merely reuse the extra old space into the new table. */
#if USE_OBSTACK
new_table->entry_stack = table->entry_stack;
#endif
new_table->free_entry_list = table->free_entry_list;
if (transfer_entries (new_table, table, false))
{
/* Entries transferred successfully; tie up the loose ends. */
free (table->bucket);
table->bucket = new_table->bucket;
table->bucket_limit = new_table->bucket_limit;
table->n_buckets = new_table->n_buckets;
table->n_buckets_used = new_table->n_buckets_used;
table->free_entry_list = new_table->free_entry_list;
/* table->n_entries and table->entry_stack already hold their value. */
return true;
}
/* We've allocated new_table->bucket (and possibly some entries),
exhausted the free list, and moved some but not all entries into
new_table. We must undo the partial move before returning
failure. The only way to get into this situation is if new_table
uses fewer buckets than the old table, so we will reclaim some
free entries as overflows in the new table are put back into
distinct buckets in the old table.
There are some pathological cases where a single pass through the
table requires more intermediate overflow entries than using two
passes. Two passes give worse cache performance and takes
longer, but at this point, we're already out of memory, so slow
and safe is better than failure. */
table->free_entry_list = new_table->free_entry_list;
if (! (transfer_entries (table, new_table, true)
&& transfer_entries (table, new_table, false)))
abort ();
/* table->n_entries already holds its value. */
free (new_table->bucket);
return false;
}
/* Insert ENTRY into hash TABLE if there is not already a matching entry.
Return -1 upon memory allocation failure.
Return 1 if insertion succeeded.
Return 0 if there is already a matching entry in the table,
and in that case, if MATCHED_ENT is non-NULL, set *MATCHED_ENT
to that entry.
This interface is easier to use than hash_insert when you must
distinguish between the latter two cases. More importantly,
hash_insert is unusable for some types of ENTRY values. When using
hash_insert, the only way to distinguish those cases is to compare
the return value and ENTRY. That works only when you can have two
different ENTRY values that point to data that compares "equal". Thus,
when the ENTRY value is a simple scalar, you must use
hash_insert_if_absent. ENTRY must not be NULL. */
int
hash_insert_if_absent (Hash_table *table, void const *entry,
void const **matched_ent)
{
void *data;
struct hash_entry *bucket;
/* The caller cannot insert a NULL entry, since hash_lookup returns NULL
to indicate "not found", and hash_find_entry uses "bucket->data == NULL"
to indicate an empty bucket. */
if (! entry)
abort ();
/* If there's a matching entry already in the table, return that. */
if ((data = hash_find_entry (table, entry, &bucket, false)) != NULL)
{
if (matched_ent)
*matched_ent = data;
return 0;
}
/* If the growth threshold of the buckets in use has been reached, increase
the table size and rehash. There's no point in checking the number of
entries: if the hashing function is ill-conditioned, rehashing is not
likely to improve it. */
if (table->n_buckets_used
> table->tuning->growth_threshold * table->n_buckets)
{
/* Check more fully, before starting real work. If tuning arguments
became invalid, the second check will rely on proper defaults. */
check_tuning (table);
if (table->n_buckets_used
> table->tuning->growth_threshold * table->n_buckets)
{
const Hash_tuning *tuning = table->tuning;
float candidate =
(tuning->is_n_buckets
? (table->n_buckets * tuning->growth_factor)
: (table->n_buckets * tuning->growth_factor
* tuning->growth_threshold));
if (SIZE_MAX <= candidate)
return -1;
/* If the rehash fails, arrange to return NULL. */
if (!hash_rehash (table, candidate))
return -1;
/* Update the bucket we are interested in. */
if (hash_find_entry (table, entry, &bucket, false) != NULL)
abort ();
}
}
/* ENTRY is not matched, it should be inserted. */
if (bucket->data)
{
struct hash_entry *new_entry = allocate_entry (table);
if (new_entry == NULL)
return -1;
/* Add ENTRY in the overflow of the bucket. */
new_entry->data = (void *) entry;
new_entry->next = bucket->next;
bucket->next = new_entry;
table->n_entries++;
return 1;
}
/* Add ENTRY right in the bucket head. */
bucket->data = (void *) entry;
table->n_entries++;
table->n_buckets_used++;
return 1;
}
/* If ENTRY matches an entry already in the hash table, return the pointer
to the entry from the table. Otherwise, insert ENTRY and return ENTRY.
Return NULL if the storage required for insertion cannot be allocated.
This implementation does not support duplicate entries or insertion of
NULL. */
void *
hash_insert (Hash_table *table, void const *entry)
{
void const *matched_ent;
int err = hash_insert_if_absent (table, entry, &matched_ent);
return (err == -1
? NULL
: (void *) (err == 0 ? matched_ent : entry));
}
/* If ENTRY is already in the table, remove it and return the just-deleted
data (the user may want to deallocate its storage). If ENTRY is not in the
table, don't modify the table and return NULL. */
void *
hash_delete (Hash_table *table, const void *entry)
{
void *data;
struct hash_entry *bucket;
data = hash_find_entry (table, entry, &bucket, true);
if (!data)
return NULL;
table->n_entries--;
if (!bucket->data)
{
table->n_buckets_used--;
/* If the shrink threshold of the buckets in use has been reached,
rehash into a smaller table. */
if (table->n_buckets_used
< table->tuning->shrink_threshold * table->n_buckets)
{
/* Check more fully, before starting real work. If tuning arguments
became invalid, the second check will rely on proper defaults. */
check_tuning (table);
if (table->n_buckets_used
< table->tuning->shrink_threshold * table->n_buckets)
{
const Hash_tuning *tuning = table->tuning;
size_t candidate =
(tuning->is_n_buckets
? table->n_buckets * tuning->shrink_factor
: (table->n_buckets * tuning->shrink_factor
* tuning->growth_threshold));
if (!hash_rehash (table, candidate))
{
/* Failure to allocate memory in an attempt to
shrink the table is not fatal. But since memory
is low, we can at least be kind and free any
spare entries, rather than keeping them tied up
in the free entry list. */
#if ! USE_OBSTACK
struct hash_entry *cursor = table->free_entry_list;
struct hash_entry *next;
while (cursor)
{
next = cursor->next;
free (cursor);
cursor = next;
}
table->free_entry_list = NULL;
#endif
}
}
}
}
return data;
}
/* Testing. */
#if TESTING
void
hash_print (const Hash_table *table)
{
struct hash_entry *bucket = (struct hash_entry *) table->bucket;
for ( ; bucket < table->bucket_limit; bucket++)
{
struct hash_entry *cursor;
if (bucket)
printf ("%lu:\n", (unsigned long int) (bucket - table->bucket));
for (cursor = bucket; cursor; cursor = cursor->next)
{
char const *s = cursor->data;
/* FIXME */
if (s)
printf (" %s\n", s);
}
}
}
#endif /* TESTING */
supermin-5.2.2/lib/i-ring.c 0000664 0001750 0001750 00000003410 13057324244 012406 0000000 0000000 /* a simple ring buffer
Copyright (C) 2006, 2009-2017 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 3 of the License, 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, see . */
/* written by Jim Meyering */
#include
#include "i-ring.h"
#include
void
i_ring_init (I_ring *ir, int default_val)
{
int i;
ir->ir_empty = true;
ir->ir_front = 0;
ir->ir_back = 0;
for (i = 0; i < I_RING_SIZE; i++)
ir->ir_data[i] = default_val;
ir->ir_default_val = default_val;
}
bool
i_ring_empty (I_ring const *ir)
{
return ir->ir_empty;
}
int
i_ring_push (I_ring *ir, int val)
{
unsigned int dest_idx = (ir->ir_front + !ir->ir_empty) % I_RING_SIZE;
int old_val = ir->ir_data[dest_idx];
ir->ir_data[dest_idx] = val;
ir->ir_front = dest_idx;
if (dest_idx == ir->ir_back)
ir->ir_back = (ir->ir_back + !ir->ir_empty) % I_RING_SIZE;
ir->ir_empty = false;
return old_val;
}
int
i_ring_pop (I_ring *ir)
{
int top_val;
if (i_ring_empty (ir))
abort ();
top_val = ir->ir_data[ir->ir_front];
ir->ir_data[ir->ir_front] = ir->ir_default_val;
if (ir->ir_front == ir->ir_back)
ir->ir_empty = true;
else
ir->ir_front = ((ir->ir_front + I_RING_SIZE - 1) % I_RING_SIZE);
return top_val;
}
supermin-5.2.2/lib/openat-die.c 0000664 0001750 0001750 00000003505 13057324244 013253 0000000 0000000 /* Report a save- or restore-cwd failure in our openat replacement and then exit.
Copyright (C) 2005-2006, 2008-2017 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 3 of the License, 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, see . */
#include
#include "openat.h"
#include
#ifndef GNULIB_LIBPOSIX
# include "error.h"
#endif
#include "exitfail.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
_Noreturn void
openat_save_fail (int errnum)
{
#ifndef GNULIB_LIBPOSIX
error (exit_failure, errnum,
_("unable to record current working directory"));
#endif
/* _Noreturn cannot be applied to error, since it returns
when its first argument is 0. To help compilers understand that this
function does not return, call abort. Also, the abort is a
safety feature if exit_failure is 0 (which shouldn't happen). */
abort ();
}
/* Exit with an error about failure to restore the working directory
during an openat emulation. The caller must ensure that fd 2 is
not a just-opened fd, even when openat_safer is not in use. */
_Noreturn void
openat_restore_fail (int errnum)
{
#ifndef GNULIB_LIBPOSIX
error (exit_failure, errnum,
_("failed to return to initial working directory"));
#endif
/* As above. */
abort ();
}
supermin-5.2.2/lib/openat-safer.c 0000664 0001750 0001750 00000002541 13057324244 013611 0000000 0000000 /* Invoke openat, but avoid some glitches.
Copyright (C) 2005-2006, 2008-2017 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 3 of the License, 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, see . */
/* Written by Paul Eggert for open, ported by Eric Blake for openat. */
#include
#include "fcntl-safer.h"
#include
#include
#include "unistd-safer.h"
int
openat_safer (int fd, char const *file, int flags, ...)
{
mode_t mode = 0;
if (flags & O_CREAT)
{
va_list ap;
va_start (ap, flags);
/* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
creates crashing code when 'mode_t' is smaller than 'int'. */
mode = va_arg (ap, PROMOTED_MODE_T);
va_end (ap);
}
return fd_safer (openat (fd, file, flags, mode));
}
supermin-5.2.2/lib/save-cwd.c 0000664 0001750 0001750 00000006007 13057324244 012737 0000000 0000000 /* save-cwd.c -- Save and restore current working directory.
Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2017 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 3 of the License, 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, see . */
/* Written by Jim Meyering. */
#include
#include "save-cwd.h"
#include
#include
#include
#include
#include
#include "chdir-long.h"
#include "unistd--.h"
#include "cloexec.h"
#if GNULIB_FCNTL_SAFER
# include "fcntl--.h"
#else
# define GNULIB_FCNTL_SAFER 0
#endif
/* Record the location of the current working directory in CWD so that
the program may change to other directories and later use restore_cwd
to return to the recorded location. This function may allocate
space using malloc (via getcwd) or leave a file descriptor open;
use free_cwd to perform the necessary free or close. Upon failure,
no memory is allocated, any locally opened file descriptors are
closed; return non-zero -- in that case, free_cwd need not be
called, but doing so is ok. Otherwise, return zero.
The _raison d'etre_ for this interface is that the working directory
is sometimes inaccessible, and getcwd is not robust or as efficient.
So, we prefer to use the open/fchdir approach, but fall back on
getcwd if necessary. This module works for most cases with just
the getcwd-lgpl module, but to be truly robust, use the getcwd module.
Some systems lack fchdir altogether: e.g., OS/2, pre-2001 Cygwin,
SCO Xenix. Also, SunOS 4 and Irix 5.3 provide the function, yet it
doesn't work for partitions on which auditing is enabled. If
you're still using an obsolete system with these problems, please
send email to the maintainer of this code. */
int
save_cwd (struct saved_cwd *cwd)
{
cwd->name = NULL;
cwd->desc = open (".", O_SEARCH);
if (!GNULIB_FCNTL_SAFER)
cwd->desc = fd_safer (cwd->desc);
if (cwd->desc < 0)
{
cwd->name = getcwd (NULL, 0);
return cwd->name ? 0 : -1;
}
set_cloexec_flag (cwd->desc, true);
return 0;
}
/* Change to recorded location, CWD, in directory hierarchy.
Upon failure, return -1 (errno is set by chdir or fchdir).
Upon success, return zero. */
int
restore_cwd (const struct saved_cwd *cwd)
{
if (0 <= cwd->desc)
return fchdir (cwd->desc);
else
return chdir_long (cwd->name);
}
void
free_cwd (struct saved_cwd *cwd)
{
if (cwd->desc >= 0)
close (cwd->desc);
free (cwd->name);
}
supermin-5.2.2/lib/unistd.c 0000664 0001750 0001750 00000000147 13057324245 012534 0000000 0000000 #include
#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
#include "unistd.h"
typedef int dummy;
supermin-5.2.2/lib/dup-safer.c 0000664 0001750 0001750 00000002026 13057324244 013111 0000000 0000000 /* Invoke dup, but avoid some glitches.
Copyright (C) 2001, 2004-2006, 2009-2017 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 3 of the License, 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, see . */
/* Written by Paul Eggert. */
#include
#include "unistd-safer.h"
#include
#include
/* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or
STDERR_FILENO. */
int
dup_safer (int fd)
{
return fcntl (fd, F_DUPFD, STDERR_FILENO + 1);
}
supermin-5.2.2/lib/fd-safer.c 0000664 0001750 0001750 00000003002 13057324244 012705 0000000 0000000 /* Return a safer copy of a file descriptor.
Copyright (C) 2005-2006, 2009-2017 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 3 of the License, 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, see . */
/* Written by Paul Eggert. */
#include
#include "unistd-safer.h"
#include
#include
/* Return FD, unless FD would be a copy of standard input, output, or
error; in that case, return a duplicate of FD, closing FD. On
failure to duplicate, close FD, set errno, and return -1. Preserve
errno if FD is negative, so that the caller can always inspect
errno when the returned value is negative.
This function is usefully wrapped around functions that return file
descriptors, e.g., fd_safer (open ("file", O_RDONLY)). */
int
fd_safer (int fd)
{
if (STDIN_FILENO <= fd && fd <= STDERR_FILENO)
{
int f = dup_safer (fd);
int e = errno;
close (fd);
errno = e;
fd = f;
}
return fd;
}
supermin-5.2.2/lib/pipe-safer.c 0000664 0001750 0001750 00000002656 13057324244 013267 0000000 0000000 /* Invoke pipe, but avoid some glitches.
Copyright (C) 2005-2006, 2009-2017 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 3 of the License, 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, see . */
/* Written by Jim Meyering. */
#include
#include "unistd-safer.h"
#include
#include
/* Like pipe, but ensure that neither of the file descriptors is
STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO. Fail with ENOSYS on
platforms that lack pipe. */
int
pipe_safer (int fd[2])
{
#if HAVE_PIPE
if (pipe (fd) == 0)
{
int i;
for (i = 0; i < 2; i++)
{
fd[i] = fd_safer (fd[i]);
if (fd[i] < 0)
{
int e = errno;
close (fd[1 - i]);
errno = e;
return -1;
}
}
return 0;
}
#else
errno = ENOSYS;
#endif
return -1;
}
supermin-5.2.2/lib/openat-proc.c 0000664 0001750 0001750 00000010022 13057324244 013445 0000000 0000000 /* Create /proc/self/fd-related names for subfiles of open directories.
Copyright (C) 2006, 2009-2017 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 3 of the License, 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, see . */
/* Written by Paul Eggert. */
#include
#include "openat-priv.h"
#include
#include
#include
#include
#include
#include
#include
#ifdef __KLIBC__
# include
#endif
#include "intprops.h"
/* Set BUF to the name of the subfile of the directory identified by
FD, where the subfile is named FILE. If successful, return BUF if
the result fits in BUF, dynamically allocated memory otherwise.
Return NULL (setting errno) on error. */
char *
openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
{
char *result = buf;
int dirlen;
/* Make sure the caller gets ENOENT when appropriate. */
if (!*file)
{
buf[0] = '\0';
return buf;
}
#ifndef __KLIBC__
# define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/"
{
enum {
PROC_SELF_FD_DIR_SIZE_BOUND
= (sizeof PROC_SELF_FD_FORMAT - (sizeof "%d" - 1)
+ INT_STRLEN_BOUND (int))
};
static int proc_status = 0;
if (! proc_status)
{
/* Set PROC_STATUS to a positive value if /proc/self/fd is
reliable, and a negative value otherwise. Solaris 10
/proc/self/fd mishandles "..", and any file name might expand
to ".." after symbolic link expansion, so avoid /proc/self/fd
if it mishandles "..". Solaris 10 has openat, but this
problem is exhibited on code that built on Solaris 8 and
running on Solaris 10. */
int proc_self_fd = open ("/proc/self/fd",
O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
if (proc_self_fd < 0)
proc_status = -1;
else
{
/* Detect whether /proc/self/fd/%i/../fd exists, where %i is the
number of a file descriptor open on /proc/self/fd. On Linux,
that name resolves to /proc/self/fd, which was opened above.
However, on Solaris, it may resolve to /proc/self/fd/fd, which
cannot exist, since all names in /proc/self/fd are numeric. */
char dotdot_buf[PROC_SELF_FD_DIR_SIZE_BOUND + sizeof "../fd" - 1];
sprintf (dotdot_buf, PROC_SELF_FD_FORMAT "../fd", proc_self_fd);
proc_status = access (dotdot_buf, F_OK) ? -1 : 1;
close (proc_self_fd);
}
}
if (proc_status < 0)
return NULL;
else
{
size_t bufsize = PROC_SELF_FD_DIR_SIZE_BOUND + strlen (file);
if (OPENAT_BUFFER_SIZE < bufsize)
{
result = malloc (bufsize);
if (! result)
return NULL;
}
dirlen = sprintf (result, PROC_SELF_FD_FORMAT, fd);
}
}
#else
/* OS/2 kLIBC provides a function to retrieve a path from a fd. */
{
char dir[_MAX_PATH];
size_t bufsize;
if (__libc_Back_ioFHToPath (fd, dir, sizeof dir))
return NULL;
dirlen = strlen (dir);
bufsize = dirlen + 1 + strlen (file) + 1; /* 1 for '/', 1 for null */
if (OPENAT_BUFFER_SIZE < bufsize)
{
result = malloc (bufsize);
if (! result)
return NULL;
}
strcpy (result, dir);
result[dirlen++] = '/';
}
#endif
strcpy (result + dirlen, file);
return result;
}
supermin-5.2.2/lib/chdir-long.c 0000664 0001750 0001750 00000015265 13057324244 013262 0000000 0000000 /* provide a chdir function that tries not to fail due to ENAMETOOLONG
Copyright (C) 2004-2017 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 3 of the License, 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, see . */
/* written by Jim Meyering */
#include
#include "chdir-long.h"
#include
#include
#include
#include
#include
#include
#include "assure.h"
#ifndef PATH_MAX
# error "compile this file only if your system defines PATH_MAX"
#endif
/* The results of openat() in this file are not leaked to any
single-threaded code that could use stdio.
FIXME - if the kernel ever adds support for multi-thread safety for
avoiding standard fds, then we should use openat_safer. */
struct cd_buf
{
int fd;
};
static void
cdb_init (struct cd_buf *cdb)
{
cdb->fd = AT_FDCWD;
}
static int
cdb_fchdir (struct cd_buf const *cdb)
{
return fchdir (cdb->fd);
}
static void
cdb_free (struct cd_buf const *cdb)
{
if (0 <= cdb->fd)
{
bool close_fail = close (cdb->fd);
assure (! close_fail);
}
}
/* Given a file descriptor of an open directory (or AT_FDCWD), CDB->fd,
try to open the CDB->fd-relative directory, DIR. If the open succeeds,
update CDB->fd with the resulting descriptor, close the incoming file
descriptor, and return zero. Upon failure, return -1 and set errno. */
static int
cdb_advance_fd (struct cd_buf *cdb, char const *dir)
{
int new_fd = openat (cdb->fd, dir,
O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
if (new_fd < 0)
return -1;
cdb_free (cdb);
cdb->fd = new_fd;
return 0;
}
/* Return a pointer to the first non-slash in S. */
static char * _GL_ATTRIBUTE_PURE
find_non_slash (char const *s)
{
size_t n_slash = strspn (s, "/");
return (char *) s + n_slash;
}
/* This is a function much like chdir, but without the PATH_MAX limitation
on the length of the directory name. A significant difference is that
it must be able to modify (albeit only temporarily) the directory
name. It handles an arbitrarily long directory name by operating
on manageable portions of the name. On systems without the openat
syscall, this means changing the working directory to more and more
"distant" points along the long directory name and then restoring
the working directory. If any of those attempts to save or restore
the working directory fails, this function exits nonzero.
Note that this function may still fail with errno == ENAMETOOLONG, but
only if the specified directory name contains a component that is long
enough to provoke such a failure all by itself (e.g. if the component
has length PATH_MAX or greater on systems that define PATH_MAX). */
int
chdir_long (char *dir)
{
int e = chdir (dir);
if (e == 0 || errno != ENAMETOOLONG)
return e;
{
size_t len = strlen (dir);
char *dir_end = dir + len;
struct cd_buf cdb;
size_t n_leading_slash;
cdb_init (&cdb);
/* If DIR is the empty string, then the chdir above
must have failed and set errno to ENOENT. */
assure (0 < len);
assure (PATH_MAX <= len);
/* Count leading slashes. */
n_leading_slash = strspn (dir, "/");
/* Handle any leading slashes as well as any name that matches
the regular expression, m!^//hostname[/]*! . Handling this
prefix separately usually results in a single additional
cdb_advance_fd call, but it's worthwhile, since it makes the
code in the following loop cleaner. */
if (n_leading_slash == 2)
{
int err;
/* Find next slash.
We already know that dir[2] is neither a slash nor '\0'. */
char *slash = memchr (dir + 3, '/', dir_end - (dir + 3));
if (slash == NULL)
{
errno = ENAMETOOLONG;
return -1;
}
*slash = '\0';
err = cdb_advance_fd (&cdb, dir);
*slash = '/';
if (err != 0)
goto Fail;
dir = find_non_slash (slash + 1);
}
else if (n_leading_slash)
{
if (cdb_advance_fd (&cdb, "/") != 0)
goto Fail;
dir += n_leading_slash;
}
assure (*dir != '/');
assure (dir <= dir_end);
while (PATH_MAX <= dir_end - dir)
{
int err;
/* Find a slash that is PATH_MAX or fewer bytes away from dir.
I.e. see if there is a slash that will give us a name of
length PATH_MAX-1 or less. */
char *slash = memrchr (dir, '/', PATH_MAX);
if (slash == NULL)
{
errno = ENAMETOOLONG;
return -1;
}
*slash = '\0';
assure (slash - dir < PATH_MAX);
err = cdb_advance_fd (&cdb, dir);
*slash = '/';
if (err != 0)
goto Fail;
dir = find_non_slash (slash + 1);
}
if (dir < dir_end)
{
if (cdb_advance_fd (&cdb, dir) != 0)
goto Fail;
}
if (cdb_fchdir (&cdb) != 0)
goto Fail;
cdb_free (&cdb);
return 0;
Fail:
{
int saved_errno = errno;
cdb_free (&cdb);
errno = saved_errno;
return -1;
}
}
}
#if TEST_CHDIR
# include "closeout.h"
# include "error.h"
int
main (int argc, char *argv[])
{
char *line = NULL;
size_t n = 0;
int len;
atexit (close_stdout);
len = getline (&line, &n, stdin);
if (len < 0)
{
int saved_errno = errno;
if (feof (stdin))
exit (0);
error (EXIT_FAILURE, saved_errno,
"reading standard input");
}
else if (len == 0)
exit (0);
if (line[len-1] == '\n')
line[len-1] = '\0';
if (chdir_long (line) != 0)
error (EXIT_FAILURE, errno,
"chdir_long failed: %s", line);
if (argc <= 1)
{
/* Using 'pwd' here makes sense only if it is a robust implementation,
like the one in coreutils after the 2004-04-19 changes. */
char const *cmd = "pwd";
execlp (cmd, (char *) NULL);
error (EXIT_FAILURE, errno, "%s", cmd);
}
fclose (stdin);
fclose (stderr);
exit (EXIT_SUCCESS);
}
#endif
/*
Local Variables:
compile-command: "gcc -DTEST_CHDIR=1 -g -O -W -Wall chdir-long.c libcoreutils.a"
End:
*/
supermin-5.2.2/lib/close.c 0000664 0001750 0001750 00000002707 13057324244 012336 0000000 0000000 /* close replacement.
Copyright (C) 2008-2017 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 3 of the License, 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, see . */
#include
/* Specification. */
#include
#include
#include "fd-hook.h"
#include "msvc-inval.h"
#undef close
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
static int
close_nothrow (int fd)
{
int result;
TRY_MSVC_INVAL
{
result = close (fd);
}
CATCH_MSVC_INVAL
{
result = -1;
errno = EBADF;
}
DONE_MSVC_INVAL;
return result;
}
#else
# define close_nothrow close
#endif
/* Override close() to call into other gnulib modules. */
int
rpl_close (int fd)
{
#if WINDOWS_SOCKETS
int retval = execute_all_close_hooks (close_nothrow, fd);
#else
int retval = close_nothrow (fd);
#endif
#if REPLACE_FCHDIR
if (retval >= 0)
_gl_unregister_fd (fd);
#endif
return retval;
}
supermin-5.2.2/lib/closedir.c 0000664 0001750 0001750 00000002775 13057324244 013042 0000000 0000000 /* Stop reading the entries of a directory.
Copyright (C) 2006-2017 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 3 of the License, 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, see . */
#include
/* Specification. */
#include
#if REPLACE_FCHDIR
# include
#endif
#if HAVE_CLOSEDIR
/* Override closedir(), to keep track of the open file descriptors.
Needed because there is a function dirfd(). */
#else
# include
# include "dirent-private.h"
#endif
int
closedir (DIR *dirp)
{
# if REPLACE_FCHDIR || REPLACE_DIRFD
int fd = dirfd (dirp);
# endif
int retval;
#if HAVE_CLOSEDIR
# undef closedir
retval = closedir (dirp);
# ifdef __KLIBC__
if (!retval)
_gl_unregister_dirp_fd (fd);
# endif
#else
if (dirp->current != INVALID_HANDLE_VALUE)
FindClose (dirp->current);
free (dirp);
retval = 0;
#endif
#if REPLACE_FCHDIR
if (retval >= 0)
_gl_unregister_fd (fd);
#endif
return retval;
}
supermin-5.2.2/lib/dirfd.c 0000664 0001750 0001750 00000004425 13057324244 012320 0000000 0000000 /* dirfd.c -- return the file descriptor associated with an open DIR*
Copyright (C) 2001, 2006, 2008-2017 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 3 of the License, 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, see . */
/* Written by Jim Meyering. */
#include
#include
#include
#ifdef __KLIBC__
# include
# include
static struct dirp_fd_list
{
DIR *dirp;
int fd;
struct dirp_fd_list *next;
} *dirp_fd_start = NULL;
/* Register fd associated with dirp to dirp_fd_list. */
int
_gl_register_dirp_fd (int fd, DIR *dirp)
{
struct dirp_fd_list *new_dirp_fd = malloc (sizeof *new_dirp_fd);
if (!new_dirp_fd)
return -1;
new_dirp_fd->dirp = dirp;
new_dirp_fd->fd = fd;
new_dirp_fd->next = dirp_fd_start;
dirp_fd_start = new_dirp_fd;
return 0;
}
/* Unregister fd from dirp_fd_list with closing it */
void
_gl_unregister_dirp_fd (int fd)
{
struct dirp_fd_list *dirp_fd;
struct dirp_fd_list *dirp_fd_prev;
for (dirp_fd_prev = NULL, dirp_fd = dirp_fd_start; dirp_fd;
dirp_fd_prev = dirp_fd, dirp_fd = dirp_fd->next)
{
if (dirp_fd->fd == fd)
{
if (dirp_fd_prev)
dirp_fd_prev->next = dirp_fd->next;
else /* dirp_fd == dirp_fd_start */
dirp_fd_start = dirp_fd_start->next;
close (fd);
free (dirp_fd);
break;
}
}
}
#endif
int
dirfd (DIR *dir_p)
{
int fd = DIR_TO_FD (dir_p);
if (fd == -1)
#ifndef __KLIBC__
errno = ENOTSUP;
#else
{
struct dirp_fd_list *dirp_fd;
for (dirp_fd = dirp_fd_start; dirp_fd; dirp_fd = dirp_fd->next)
if (dirp_fd->dirp == dir_p)
return dirp_fd->fd;
errno = EINVAL;
}
#endif
return fd;
}
supermin-5.2.2/lib/dup.c 0000664 0001750 0001750 00000003407 13057324244 012017 0000000 0000000 /* Duplicate an open file descriptor.
Copyright (C) 2011-2017 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 3 of the License, 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, see . */
#include
/* Specification. */
#include
#include
#include "msvc-inval.h"
#undef dup
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
static int
dup_nothrow (int fd)
{
int result;
TRY_MSVC_INVAL
{
result = dup (fd);
}
CATCH_MSVC_INVAL
{
result = -1;
errno = EBADF;
}
DONE_MSVC_INVAL;
return result;
}
#elif defined __KLIBC__
# include
# include
# include
static int
dup_nothrow (int fd)
{
int dupfd;
struct stat sbuf;
dupfd = dup (fd);
if (dupfd == -1 && errno == ENOTSUP \
&& !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
{
char path[_MAX_PATH];
/* Get a path from fd */
if (!__libc_Back_ioFHToPath (fd, path, sizeof (path)))
dupfd = open (path, O_RDONLY);
}
return dupfd;
}
#else
# define dup_nothrow dup
#endif
int
rpl_dup (int fd)
{
int result = dup_nothrow (fd);
#if REPLACE_FCHDIR
if (result >= 0)
result = _gl_register_dup (fd, result);
#endif
return result;
}
supermin-5.2.2/lib/dup2.c 0000664 0001750 0001750 00000011075 13057324244 012101 0000000 0000000 /* Duplicate an open file descriptor to a specified file descriptor.
Copyright (C) 1999, 2004-2007, 2009-2017 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 3 of the License, 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, see . */
/* written by Paul Eggert */
#include
/* Specification. */
#include
#include
#include
#if HAVE_DUP2
# undef dup2
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include
# include "msvc-inval.h"
/* Get _get_osfhandle. */
# include "msvc-nothrow.h"
static int
ms_windows_dup2 (int fd, int desired_fd)
{
int result;
/* If fd is closed, mingw hangs on dup2 (fd, fd). If fd is open,
dup2 (fd, fd) returns 0, but all further attempts to use fd in
future dup2 calls will hang. */
if (fd == desired_fd)
{
if ((HANDLE) _get_osfhandle (fd) == INVALID_HANDLE_VALUE)
{
errno = EBADF;
return -1;
}
return fd;
}
/* Wine 1.0.1 return 0 when desired_fd is negative but not -1:
http://bugs.winehq.org/show_bug.cgi?id=21289 */
if (desired_fd < 0)
{
errno = EBADF;
return -1;
}
TRY_MSVC_INVAL
{
result = dup2 (fd, desired_fd);
}
CATCH_MSVC_INVAL
{
errno = EBADF;
result = -1;
}
DONE_MSVC_INVAL;
if (result == 0)
result = desired_fd;
return result;
}
# define dup2 ms_windows_dup2
# elif defined __KLIBC__
# include
static int
klibc_dup2dirfd (int fd, int desired_fd)
{
int tempfd;
int dupfd;
tempfd = open ("NUL", O_RDONLY);
if (tempfd == -1)
return -1;
if (tempfd == desired_fd)
{
close (tempfd);
char path[_MAX_PATH];
if (__libc_Back_ioFHToPath (fd, path, sizeof (path)))
return -1;
return open(path, O_RDONLY);
}
dupfd = klibc_dup2dirfd (fd, desired_fd);
close (tempfd);
return dupfd;
}
static int
klibc_dup2 (int fd, int desired_fd)
{
int dupfd;
struct stat sbuf;
dupfd = dup2 (fd, desired_fd);
if (dupfd == -1 && errno == ENOTSUP \
&& !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
{
close (desired_fd);
return klibc_dup2dirfd (fd, desired_fd);
}
return dupfd;
}
# define dup2 klibc_dup2
# endif
int
rpl_dup2 (int fd, int desired_fd)
{
int result;
# ifdef F_GETFL
/* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF.
On Cygwin 1.5.x, dup2 (1, 1) returns 0.
On Cygwin 1.7.17, dup2 (1, -1) dumps core.
On Cygwin 1.7.25, dup2 (1, 256) can dump core.
On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC. */
# if HAVE_SETDTABLESIZE
setdtablesize (desired_fd + 1);
# endif
if (desired_fd < 0)
fd = desired_fd;
if (fd == desired_fd)
return fcntl (fd, F_GETFL) == -1 ? -1 : fd;
# endif
result = dup2 (fd, desired_fd);
/* Correct an errno value on FreeBSD 6.1 and Cygwin 1.5.x. */
if (result == -1 && errno == EMFILE)
errno = EBADF;
# if REPLACE_FCHDIR
if (fd != desired_fd && result != -1)
result = _gl_register_dup (fd, result);
# endif
return result;
}
#else /* !HAVE_DUP2 */
/* On older platforms, dup2 did not exist. */
# ifndef F_DUPFD
static int
dupfd (int fd, int desired_fd)
{
int duplicated_fd = dup (fd);
if (duplicated_fd < 0 || duplicated_fd == desired_fd)
return duplicated_fd;
else
{
int r = dupfd (fd, desired_fd);
int e = errno;
close (duplicated_fd);
errno = e;
return r;
}
}
# endif
int
dup2 (int fd, int desired_fd)
{
int result = fcntl (fd, F_GETFL) < 0 ? -1 : fd;
if (result == -1 || fd == desired_fd)
return result;
close (desired_fd);
# ifdef F_DUPFD
result = fcntl (fd, F_DUPFD, desired_fd);
# if REPLACE_FCHDIR
if (0 <= result)
result = _gl_register_dup (fd, result);
# endif
# else
result = dupfd (fd, desired_fd);
# endif
if (result == -1 && (errno == EMFILE || errno == EINVAL))
errno = EBADF;
return result;
}
#endif /* !HAVE_DUP2 */
supermin-5.2.2/lib/error.c 0000664 0001750 0001750 00000024316 13057324244 012362 0000000 0000000 /* Error handler for noninteractive utilities
Copyright (C) 1990-1998, 2000-2007, 2009-2017 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
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, 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, see . */
/* Written by David MacKenzie . */
#if !_LIBC
# include
#endif
#include "error.h"
#include
#include
#include
#include
#if !_LIBC && ENABLE_NLS
# include "gettext.h"
# define _(msgid) gettext (msgid)
#endif
#ifdef _LIBC
# include
# include
# include
# include
# define mbsrtowcs __mbsrtowcs
# define USE_UNLOCKED_IO 0
# define _GL_ATTRIBUTE_FORMAT_PRINTF(a, b)
# define _GL_ARG_NONNULL(a)
#else
# include "getprogname.h"
#endif
#if USE_UNLOCKED_IO
# include "unlocked-io.h"
#endif
#ifndef _
# define _(String) String
#endif
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */
void (*error_print_progname) (void);
/* This variable is incremented each time 'error' is called. */
unsigned int error_message_count;
#ifdef _LIBC
/* In the GNU C library, there is a predefined variable for this. */
# define program_name program_invocation_name
# include
# include
# include
/* In GNU libc we want do not want to use the common name 'error' directly.
Instead make it a weak alias. */
extern void __error (int status, int errnum, const char *message, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
extern void __error_at_line (int status, int errnum, const char *file_name,
unsigned int line_number, const char *message,
...)
__attribute__ ((__format__ (__printf__, 5, 6)));
# define error __error
# define error_at_line __error_at_line
# include
# define fflush(s) _IO_fflush (s)
# undef putc
# define putc(c, fp) _IO_putc (c, fp)
# include
#else /* not _LIBC */
# include
# include
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include
/* Get _get_osfhandle. */
# include "msvc-nothrow.h"
# endif
/* The gnulib override of fcntl is not needed in this file. */
# undef fcntl
# if !HAVE_DECL_STRERROR_R
# ifndef HAVE_DECL_STRERROR_R
"this configure-time declaration test was not run"
# endif
# if STRERROR_R_CHAR_P
char *strerror_r ();
# else
int strerror_r ();
# endif
# endif
#define program_name getprogname ()
# if HAVE_STRERROR_R || defined strerror_r
# define __strerror_r strerror_r
# endif /* HAVE_STRERROR_R || defined strerror_r */
#endif /* not _LIBC */
#if !_LIBC
/* Return non-zero if FD is open. */
static int
is_open (int fd)
{
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* On native Windows: The initial state of unassigned standard file
descriptors is that they are open but point to an INVALID_HANDLE_VALUE.
There is no fcntl, and the gnulib replacement fcntl does not support
F_GETFL. */
return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
# else
# ifndef F_GETFL
# error Please port fcntl to your platform
# endif
return 0 <= fcntl (fd, F_GETFL);
# endif
}
#endif
static void
flush_stdout (void)
{
#if !_LIBC
int stdout_fd;
# if GNULIB_FREOPEN_SAFER
/* Use of gnulib's freopen-safer module normally ensures that
fileno (stdout) == 1
whenever stdout is open. */
stdout_fd = STDOUT_FILENO;
# else
/* POSIX states that fileno (stdout) after fclose is unspecified. But in
practice it is not a problem, because stdout is statically allocated and
the fd of a FILE stream is stored as a field in its allocated memory. */
stdout_fd = fileno (stdout);
# endif
/* POSIX states that fflush (stdout) after fclose is unspecified; it
is safe in glibc, but not on all other platforms. fflush (NULL)
is always defined, but too draconian. */
if (0 <= stdout_fd && is_open (stdout_fd))
#endif
fflush (stdout);
}
static void
print_errno_message (int errnum)
{
char const *s;
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
# if _LIBC || STRERROR_R_CHAR_P
s = __strerror_r (errnum, errbuf, sizeof errbuf);
# else
if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
s = errbuf;
else
s = 0;
# endif
#else
s = strerror (errnum);
#endif
#if !_LIBC
if (! s)
s = _("Unknown system error");
#endif
#if _LIBC
__fxprintf (NULL, ": %s", s);
#else
fprintf (stderr, ": %s", s);
#endif
}
static void _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) _GL_ARG_NONNULL ((3))
error_tail (int status, int errnum, const char *message, va_list args)
{
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
{
size_t len = strlen (message) + 1;
wchar_t *wmessage = NULL;
mbstate_t st;
size_t res;
const char *tmp;
bool use_malloc = false;
while (1)
{
if (__libc_use_alloca (len * sizeof (wchar_t)))
wmessage = (wchar_t *) alloca (len * sizeof (wchar_t));
else
{
if (!use_malloc)
wmessage = NULL;
wchar_t *p = (wchar_t *) realloc (wmessage,
len * sizeof (wchar_t));
if (p == NULL)
{
free (wmessage);
fputws_unlocked (L"out of memory\n", stderr);
return;
}
wmessage = p;
use_malloc = true;
}
memset (&st, '\0', sizeof (st));
tmp = message;
res = mbsrtowcs (wmessage, &tmp, len, &st);
if (res != len)
break;
if (__builtin_expect (len >= SIZE_MAX / sizeof (wchar_t) / 2, 0))
{
/* This really should not happen if everything is fine. */
res = (size_t) -1;
break;
}
len *= 2;
}
if (res == (size_t) -1)
{
/* The string cannot be converted. */
if (use_malloc)
{
free (wmessage);
use_malloc = false;
}
wmessage = (wchar_t *) L"???";
}
__vfwprintf (stderr, wmessage, args);
if (use_malloc)
free (wmessage);
}
else
#endif
vfprintf (stderr, message, args);
va_end (args);
++error_message_count;
if (errnum)
print_errno_message (errnum);
#if _LIBC
__fxprintf (NULL, "\n");
#else
putc ('\n', stderr);
#endif
fflush (stderr);
if (status)
exit (status);
}
/* Print the program name and error message MESSAGE, which is a printf-style
format string with optional args.
If ERRNUM is nonzero, print its corresponding system error message.
Exit with status STATUS if it is nonzero. */
void
error (int status, int errnum, const char *message, ...)
{
va_list args;
#if defined _LIBC && defined __libc_ptf_call
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
__libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
0);
#endif
flush_stdout ();
#ifdef _LIBC
_IO_flockfile (stderr);
#endif
if (error_print_progname)
(*error_print_progname) ();
else
{
#if _LIBC
__fxprintf (NULL, "%s: ", program_name);
#else
fprintf (stderr, "%s: ", program_name);
#endif
}
va_start (args, message);
error_tail (status, errnum, message, args);
#ifdef _LIBC
_IO_funlockfile (stderr);
# ifdef __libc_ptf_call
__libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
# endif
#endif
}
/* Sometimes we want to have at most one error per line. This
variable controls whether this mode is selected or not. */
int error_one_per_line;
void
error_at_line (int status, int errnum, const char *file_name,
unsigned int line_number, const char *message, ...)
{
va_list args;
if (error_one_per_line)
{
static const char *old_file_name;
static unsigned int old_line_number;
if (old_line_number == line_number
&& (file_name == old_file_name
|| (old_file_name != NULL
&& file_name != NULL
&& strcmp (old_file_name, file_name) == 0)))
/* Simply return and print nothing. */
return;
old_file_name = file_name;
old_line_number = line_number;
}
#if defined _LIBC && defined __libc_ptf_call
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
__libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
0);
#endif
flush_stdout ();
#ifdef _LIBC
_IO_flockfile (stderr);
#endif
if (error_print_progname)
(*error_print_progname) ();
else
{
#if _LIBC
__fxprintf (NULL, "%s:", program_name);
#else
fprintf (stderr, "%s:", program_name);
#endif
}
#if _LIBC
__fxprintf (NULL, file_name != NULL ? "%s:%u: " : " ",
file_name, line_number);
#else
fprintf (stderr, file_name != NULL ? "%s:%u: " : " ",
file_name, line_number);
#endif
va_start (args, message);
error_tail (status, errnum, message, args);
#ifdef _LIBC
_IO_funlockfile (stderr);
# ifdef __libc_ptf_call
__libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
# endif
#endif
}
#ifdef _LIBC
/* Make the weak alias. */
# undef error
# undef error_at_line
weak_alias (__error, error)
weak_alias (__error_at_line, error_at_line)
#endif
supermin-5.2.2/lib/fchdir.c 0000664 0001750 0001750 00000013376 13057324244 012474 0000000 0000000 /* fchdir replacement.
Copyright (C) 2006-2017 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 3 of the License, 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, see . */
#include
/* Specification. */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "assure.h"
#include "dosname.h"
#include "filenamecat.h"
#ifndef REPLACE_OPEN_DIRECTORY
# define REPLACE_OPEN_DIRECTORY 0
#endif
/* This replacement assumes that a directory is not renamed while opened
through a file descriptor.
FIXME: On mingw, this would be possible to enforce if we were to
also open a HANDLE to each directory currently visited by a file
descriptor, since mingw refuses to rename any in-use file system
object. */
/* Array of file descriptors opened. If REPLACE_OPEN_DIRECTORY or if it points
to a directory, it stores info about this directory. */
typedef struct
{
char *name; /* Absolute name of the directory, or NULL. */
/* FIXME - add a DIR* member to make dirfd possible on mingw? */
} dir_info_t;
static dir_info_t *dirs;
static size_t dirs_allocated;
/* Try to ensure dirs has enough room for a slot at index fd; free any
contents already in that slot. Return false and set errno to
ENOMEM on allocation failure. */
static bool
ensure_dirs_slot (size_t fd)
{
if (fd < dirs_allocated)
free (dirs[fd].name);
else
{
size_t new_allocated;
dir_info_t *new_dirs;
new_allocated = 2 * dirs_allocated + 1;
if (new_allocated <= fd)
new_allocated = fd + 1;
new_dirs =
(dirs != NULL
? (dir_info_t *) realloc (dirs, new_allocated * sizeof *dirs)
: (dir_info_t *) malloc (new_allocated * sizeof *dirs));
if (new_dirs == NULL)
return false;
memset (new_dirs + dirs_allocated, 0,
(new_allocated - dirs_allocated) * sizeof *dirs);
dirs = new_dirs;
dirs_allocated = new_allocated;
}
return true;
}
/* Return an absolute name of DIR in malloc'd storage. */
static char *
get_name (char const *dir)
{
char *cwd;
char *result;
int saved_errno;
if (IS_ABSOLUTE_FILE_NAME (dir))
return strdup (dir);
/* We often encounter "."; treat it as a special case. */
cwd = getcwd (NULL, 0);
if (!cwd || (dir[0] == '.' && dir[1] == '\0'))
return cwd;
result = mfile_name_concat (cwd, dir, NULL);
saved_errno = errno;
free (cwd);
errno = saved_errno;
return result;
}
/* Hook into the gnulib replacements for open() and close() to keep track
of the open file descriptors. */
/* Close FD, cleaning up any fd to name mapping if fd was visiting a
directory. */
void
_gl_unregister_fd (int fd)
{
if (fd >= 0 && fd < dirs_allocated)
{
free (dirs[fd].name);
dirs[fd].name = NULL;
}
}
/* Mark FD as visiting FILENAME. FD must be non-negative, and refer
to an open file descriptor. If REPLACE_OPEN_DIRECTORY is non-zero,
this should only be called if FD is visiting a directory. Close FD
and return -1 if there is insufficient memory to track the
directory name; otherwise return FD. */
int
_gl_register_fd (int fd, const char *filename)
{
struct stat statbuf;
assure (0 <= fd);
if (REPLACE_OPEN_DIRECTORY
|| (fstat (fd, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)))
{
if (!ensure_dirs_slot (fd)
|| (dirs[fd].name = get_name (filename)) == NULL)
{
int saved_errno = errno;
close (fd);
errno = saved_errno;
return -1;
}
}
return fd;
}
/* Mark NEWFD as a duplicate of OLDFD; useful from dup, dup2, dup3,
and fcntl. Both arguments must be valid and distinct file
descriptors. Close NEWFD and return -1 if OLDFD is tracking a
directory, but there is insufficient memory to track the same
directory in NEWFD; otherwise return NEWFD. */
int
_gl_register_dup (int oldfd, int newfd)
{
assure (0 <= oldfd && 0 <= newfd && oldfd != newfd);
if (oldfd < dirs_allocated && dirs[oldfd].name)
{
/* Duplicated a directory; must ensure newfd is allocated. */
if (!ensure_dirs_slot (newfd)
|| (dirs[newfd].name = strdup (dirs[oldfd].name)) == NULL)
{
int saved_errno = errno;
close (newfd);
errno = saved_errno;
newfd = -1;
}
}
else if (newfd < dirs_allocated)
{
/* Duplicated a non-directory; ensure newfd is cleared. */
free (dirs[newfd].name);
dirs[newfd].name = NULL;
}
return newfd;
}
/* If FD is currently visiting a directory, then return the name of
that directory. Otherwise, return NULL and set errno. */
const char *
_gl_directory_name (int fd)
{
if (0 <= fd && fd < dirs_allocated && dirs[fd].name != NULL)
return dirs[fd].name;
/* At this point, fd is either invalid, or open but not a directory.
If dup2 fails, errno is correctly EBADF. */
if (0 <= fd)
{
if (dup2 (fd, fd) == fd)
errno = ENOTDIR;
}
else
errno = EBADF;
return NULL;
}
/* Implement fchdir() in terms of chdir(). */
int
fchdir (int fd)
{
const char *name = _gl_directory_name (fd);
return name ? chdir (name) : -1;
}
supermin-5.2.2/lib/fcntl.c 0000664 0001750 0001750 00000027243 13057324244 012341 0000000 0000000 /* Provide file descriptor control.
Copyright (C) 2009-2017 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 3 of the License, 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, see . */
/* Written by Eric Blake . */
#include
/* Specification. */
#include
#include
#include
#include
#include
#if !HAVE_FCNTL
# define rpl_fcntl fcntl
#endif
#undef fcntl
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include
/* Get _get_osfhandle. */
# include "msvc-nothrow.h"
/* Upper bound on getdtablesize(). See lib/getdtablesize.c. */
# define OPEN_MAX_MAX 0x10000
/* Duplicate OLDFD into the first available slot of at least NEWFD,
which must be positive, with FLAGS determining whether the duplicate
will be inheritable. */
static int
dupfd (int oldfd, int newfd, int flags)
{
/* Mingw has no way to create an arbitrary fd. Iterate until all
file descriptors less than newfd are filled up. */
HANDLE curr_process = GetCurrentProcess ();
HANDLE old_handle = (HANDLE) _get_osfhandle (oldfd);
unsigned char fds_to_close[OPEN_MAX_MAX / CHAR_BIT];
unsigned int fds_to_close_bound = 0;
int result;
BOOL inherit = flags & O_CLOEXEC ? FALSE : TRUE;
int mode;
if (newfd < 0 || getdtablesize () <= newfd)
{
errno = EINVAL;
return -1;
}
if (old_handle == INVALID_HANDLE_VALUE
|| (mode = setmode (oldfd, O_BINARY)) == -1)
{
/* oldfd is not open, or is an unassigned standard file
descriptor. */
errno = EBADF;
return -1;
}
setmode (oldfd, mode);
flags |= mode;
for (;;)
{
HANDLE new_handle;
int duplicated_fd;
unsigned int index;
if (!DuplicateHandle (curr_process, /* SourceProcessHandle */
old_handle, /* SourceHandle */
curr_process, /* TargetProcessHandle */
(PHANDLE) &new_handle, /* TargetHandle */
(DWORD) 0, /* DesiredAccess */
inherit, /* InheritHandle */
DUPLICATE_SAME_ACCESS)) /* Options */
{
switch (GetLastError ())
{
case ERROR_TOO_MANY_OPEN_FILES:
errno = EMFILE;
break;
case ERROR_INVALID_HANDLE:
case ERROR_INVALID_TARGET_HANDLE:
case ERROR_DIRECT_ACCESS_HANDLE:
errno = EBADF;
break;
case ERROR_INVALID_PARAMETER:
case ERROR_INVALID_FUNCTION:
case ERROR_INVALID_ACCESS:
errno = EINVAL;
break;
default:
errno = EACCES;
break;
}
result = -1;
break;
}
duplicated_fd = _open_osfhandle ((intptr_t) new_handle, flags);
if (duplicated_fd < 0)
{
CloseHandle (new_handle);
result = -1;
break;
}
if (newfd <= duplicated_fd)
{
result = duplicated_fd;
break;
}
/* Set the bit duplicated_fd in fds_to_close[]. */
index = (unsigned int) duplicated_fd / CHAR_BIT;
if (fds_to_close_bound <= index)
{
if (sizeof fds_to_close <= index)
/* Need to increase OPEN_MAX_MAX. */
abort ();
memset (fds_to_close + fds_to_close_bound, '\0',
index + 1 - fds_to_close_bound);
fds_to_close_bound = index + 1;
}
fds_to_close[index] |= 1 << ((unsigned int) duplicated_fd % CHAR_BIT);
}
/* Close the previous fds that turned out to be too small. */
{
int saved_errno = errno;
unsigned int duplicated_fd;
for (duplicated_fd = 0;
duplicated_fd < fds_to_close_bound * CHAR_BIT;
duplicated_fd++)
if ((fds_to_close[duplicated_fd / CHAR_BIT]
>> (duplicated_fd % CHAR_BIT))
& 1)
close (duplicated_fd);
errno = saved_errno;
}
# if REPLACE_FCHDIR
if (0 <= result)
result = _gl_register_dup (oldfd, result);
# endif
return result;
}
#endif /* W32 */
#ifdef __KLIBC__
# define INCL_DOS
# include
static int
klibc_fcntl (int fd, int action, /* arg */...)
{
va_list arg_ptr;
int arg;
struct stat sbuf;
int result = -1;
va_start (arg_ptr, action);
arg = va_arg (arg_ptr, int);
result = fcntl (fd, action, arg);
/* EPERM for F_DUPFD, ENOTSUP for others */
if (result == -1 && (errno == EPERM || errno == ENOTSUP)
&& !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
{
ULONG ulMode;
switch (action)
{
case F_DUPFD:
/* Find available fd */
while (fcntl (arg, F_GETFL) != -1 || errno != EBADF)
arg++;
result = dup2 (fd, arg);
break;
/* Using underlying APIs is right ? */
case F_GETFD:
if (DosQueryFHState (fd, &ulMode))
break;
result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0;
break;
case F_SETFD:
if (arg & ~FD_CLOEXEC)
break;
if (DosQueryFHState (fd, &ulMode))
break;
if (arg & FD_CLOEXEC)
ulMode |= OPEN_FLAGS_NOINHERIT;
else
ulMode &= ~OPEN_FLAGS_NOINHERIT;
/* Filter supported flags. */
ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR
| OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT);
if (DosSetFHState (fd, ulMode))
break;
result = 0;
break;
case F_GETFL:
result = 0;
break;
case F_SETFL:
if (arg != 0)
break;
result = 0;
break;
default :
errno = EINVAL;
break;
}
}
va_end (arg_ptr);
return result;
}
# define fcntl klibc_fcntl
#endif
/* Perform the specified ACTION on the file descriptor FD, possibly
using the argument ARG further described below. This replacement
handles the following actions, and forwards all others on to the
native fcntl. An unrecognized ACTION returns -1 with errno set to
EINVAL.
F_DUPFD - duplicate FD, with int ARG being the minimum target fd.
If successful, return the duplicate, which will be inheritable;
otherwise return -1 and set errno.
F_DUPFD_CLOEXEC - duplicate FD, with int ARG being the minimum
target fd. If successful, return the duplicate, which will not be
inheritable; otherwise return -1 and set errno.
F_GETFD - ARG need not be present. If successful, return a
non-negative value containing the descriptor flags of FD (only
FD_CLOEXEC is portable, but other flags may be present); otherwise
return -1 and set errno. */
int
rpl_fcntl (int fd, int action, /* arg */...)
{
va_list arg;
int result = -1;
va_start (arg, action);
switch (action)
{
#if !HAVE_FCNTL
case F_DUPFD:
{
int target = va_arg (arg, int);
result = dupfd (fd, target, 0);
break;
}
#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR
case F_DUPFD:
{
int target = va_arg (arg, int);
/* Detect invalid target; needed for cygwin 1.5.x. */
if (target < 0 || getdtablesize () <= target)
errno = EINVAL;
else
{
/* Haiku alpha 2 loses fd flags on original. */
int flags = fcntl (fd, F_GETFD);
if (flags < 0)
{
result = -1;
break;
}
result = fcntl (fd, action, target);
if (0 <= result && fcntl (fd, F_SETFD, flags) == -1)
{
int saved_errno = errno;
close (result);
result = -1;
errno = saved_errno;
}
# if REPLACE_FCHDIR
if (0 <= result)
result = _gl_register_dup (fd, result);
# endif
}
break;
} /* F_DUPFD */
#endif /* FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR */
case F_DUPFD_CLOEXEC:
{
int target = va_arg (arg, int);
#if !HAVE_FCNTL
result = dupfd (fd, target, O_CLOEXEC);
break;
#else /* HAVE_FCNTL */
/* Try the system call first, if the headers claim it exists
(that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we
may be running with a glibc that has the macro but with an
older kernel that does not support it. Cache the
information on whether the system call really works, but
avoid caching failure if the corresponding F_DUPFD fails
for any reason. 0 = unknown, 1 = yes, -1 = no. */
static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0;
if (0 <= have_dupfd_cloexec)
{
result = fcntl (fd, action, target);
if (0 <= result || errno != EINVAL)
{
have_dupfd_cloexec = 1;
# if REPLACE_FCHDIR
if (0 <= result)
result = _gl_register_dup (fd, result);
# endif
}
else
{
result = rpl_fcntl (fd, F_DUPFD, target);
if (result < 0)
break;
have_dupfd_cloexec = -1;
}
}
else
result = rpl_fcntl (fd, F_DUPFD, target);
if (0 <= result && have_dupfd_cloexec == -1)
{
int flags = fcntl (result, F_GETFD);
if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1)
{
int saved_errno = errno;
close (result);
errno = saved_errno;
result = -1;
}
}
break;
#endif /* HAVE_FCNTL */
} /* F_DUPFD_CLOEXEC */
#if !HAVE_FCNTL
case F_GETFD:
{
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
HANDLE handle = (HANDLE) _get_osfhandle (fd);
DWORD flags;
if (handle == INVALID_HANDLE_VALUE
|| GetHandleInformation (handle, &flags) == 0)
errno = EBADF;
else
result = (flags & HANDLE_FLAG_INHERIT) ? 0 : FD_CLOEXEC;
# else /* !W32 */
/* Use dup2 to reject invalid file descriptors. No way to
access this information, so punt. */
if (0 <= dup2 (fd, fd))
result = 0;
# endif /* !W32 */
break;
} /* F_GETFD */
#endif /* !HAVE_FCNTL */
/* Implementing F_SETFD on mingw is not trivial - there is no
API for changing the O_NOINHERIT bit on an fd, and merely
changing the HANDLE_FLAG_INHERIT bit on the underlying handle
can lead to odd state. It may be possible by duplicating the
handle, using _open_osfhandle with the right flags, then
using dup2 to move the duplicate onto the original, but that
is not supported for now. */
default:
{
#if HAVE_FCNTL
void *p = va_arg (arg, void *);
result = fcntl (fd, action, p);
#else
errno = EINVAL;
#endif
break;
}
}
va_end (arg);
return result;
}
supermin-5.2.2/lib/fdopendir.c 0000664 0001750 0001750 00000015034 13057324244 013200 0000000 0000000 /* provide a replacement fdopendir function
Copyright (C) 2004-2017 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 3 of the License, 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, see . */
/* written by Jim Meyering */
#include
#include
#include
#include
#if !HAVE_FDOPENDIR
# include "openat.h"
# include "openat-priv.h"
# include "save-cwd.h"
# if GNULIB_DIRENT_SAFER
# include "dirent--.h"
# endif
# ifndef REPLACE_FCHDIR
# define REPLACE_FCHDIR 0
# endif
static DIR *fdopendir_with_dup (int, int, struct saved_cwd const *);
static DIR *fd_clone_opendir (int, struct saved_cwd const *);
/* Replacement for POSIX fdopendir.
First, try to simulate it via opendir ("/proc/self/fd/..."). Failing
that, simulate it by using fchdir metadata, or by doing
save_cwd/fchdir/opendir(".")/restore_cwd.
If either the save_cwd or the restore_cwd fails (relatively unlikely),
then give a diagnostic and exit nonzero.
If successful, the resulting stream is based on FD in
implementations where streams are based on file descriptors and in
applications where no other thread or signal handler allocates or
frees file descriptors. In other cases, consult dirfd on the result
to find out whether FD is still being used.
Otherwise, this function works just like POSIX fdopendir.
W A R N I N G:
Unlike other fd-related functions, this one places constraints on FD.
If this function returns successfully, FD is under control of the
dirent.h system, and the caller should not close or modify the state of
FD other than by the dirent.h functions. */
# ifdef __KLIBC__
# include
DIR *
fdopendir (int fd)
{
char path[_MAX_PATH];
DIR *dirp;
/* Get a path from fd */
if (__libc_Back_ioFHToPath (fd, path, sizeof (path)))
return NULL;
dirp = opendir (path);
if (!dirp)
return NULL;
/* Unregister fd registered by opendir() */
_gl_unregister_dirp_fd (dirfd (dirp));
/* Register our fd */
if (_gl_register_dirp_fd (fd, dirp))
{
int saved_errno = errno;
closedir (dirp);
errno = saved_errno;
dirp = NULL;
}
return dirp;
}
# else
DIR *
fdopendir (int fd)
{
DIR *dir = fdopendir_with_dup (fd, -1, NULL);
if (! REPLACE_FCHDIR && ! dir)
{
int saved_errno = errno;
if (EXPECTED_ERRNO (saved_errno))
{
struct saved_cwd cwd;
if (save_cwd (&cwd) != 0)
openat_save_fail (errno);
dir = fdopendir_with_dup (fd, -1, &cwd);
saved_errno = errno;
free_cwd (&cwd);
errno = saved_errno;
}
}
return dir;
}
# endif
/* Like fdopendir, except that if OLDER_DUPFD is not -1, it is known
to be a dup of FD which is less than FD - 1 and which will be
closed by the caller and not otherwise used by the caller. This
function makes sure that FD is closed and all file descriptors less
than FD are open, and then calls fd_clone_opendir on a dup of FD.
That way, barring race conditions, fd_clone_opendir returns a
stream whose file descriptor is FD.
If REPLACE_FCHDIR or CWD is null, use opendir ("/proc/self/fd/...",
falling back on fchdir metadata. Otherwise, CWD is a saved version
of the working directory; use fchdir/opendir(".")/restore_cwd(CWD). */
static DIR *
fdopendir_with_dup (int fd, int older_dupfd, struct saved_cwd const *cwd)
{
int dupfd = dup (fd);
if (dupfd < 0 && errno == EMFILE)
dupfd = older_dupfd;
if (dupfd < 0)
return NULL;
else
{
DIR *dir;
int saved_errno;
if (dupfd < fd - 1 && dupfd != older_dupfd)
{
dir = fdopendir_with_dup (fd, dupfd, cwd);
saved_errno = errno;
}
else
{
close (fd);
dir = fd_clone_opendir (dupfd, cwd);
saved_errno = errno;
if (! dir)
{
int fd1 = dup (dupfd);
if (fd1 != fd)
openat_save_fail (fd1 < 0 ? errno : EBADF);
}
}
if (dupfd != older_dupfd)
close (dupfd);
errno = saved_errno;
return dir;
}
}
/* Like fdopendir, except the result controls a clone of FD. It is
the caller's responsibility both to close FD and (if the result is
not null) to closedir the result. */
static DIR *
fd_clone_opendir (int fd, struct saved_cwd const *cwd)
{
if (REPLACE_FCHDIR || ! cwd)
{
DIR *dir = NULL;
int saved_errno = EOPNOTSUPP;
char buf[OPENAT_BUFFER_SIZE];
char *proc_file = openat_proc_name (buf, fd, ".");
if (proc_file)
{
dir = opendir (proc_file);
saved_errno = errno;
if (proc_file != buf)
free (proc_file);
}
# if REPLACE_FCHDIR
if (! dir && EXPECTED_ERRNO (saved_errno))
{
char const *name = _gl_directory_name (fd);
DIR *dp = name ? opendir (name) : NULL;
/* The caller has done an elaborate dance to arrange for opendir to
consume just the right file descriptor. If dirfd returns -1,
though, we're on a system like mingw where opendir does not
consume a file descriptor. Consume it via 'dup' instead. */
if (dp && dirfd (dp) < 0)
dup (fd);
return dp;
}
# endif
errno = saved_errno;
return dir;
}
else
{
if (fchdir (fd) != 0)
return NULL;
else
{
DIR *dir = opendir (".");
int saved_errno = errno;
if (restore_cwd (cwd) != 0)
openat_restore_fail (errno);
errno = saved_errno;
return dir;
}
}
}
#else /* HAVE_FDOPENDIR */
# include
# include
# undef fdopendir
/* Like fdopendir, but work around GNU/Hurd bug by validating FD. */
DIR *
rpl_fdopendir (int fd)
{
struct stat st;
if (fstat (fd, &st))
return NULL;
if (!S_ISDIR (st.st_mode))
{
errno = ENOTDIR;
return NULL;
}
return fdopendir (fd);
}
#endif /* HAVE_FDOPENDIR */
supermin-5.2.2/lib/fstat.c 0000664 0001750 0001750 00000004605 13057324244 012351 0000000 0000000 /* fstat() replacement.
Copyright (C) 2011-2017 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 3 of the License, 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, see . */
/* If the user's config.h happens to include , let it include only
the system's here, so that orig_fstat doesn't recurse to
rpl_fstat. */
#define __need_system_sys_stat_h
#include
/* Get the original definition of fstat. It might be defined as a macro. */
#include
#include
#if _GL_WINDOWS_64_BIT_ST_SIZE
# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
# define stat _stati64
# undef fstat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
# define fstat _fstati64
#endif
#undef __need_system_sys_stat_h
static int
orig_fstat (int fd, struct stat *buf)
{
return fstat (fd, buf);
}
/* Specification. */
/* Write "sys/stat.h" here, not , otherwise OSF/1 5.1 DTK cc
eliminates this include because of the preliminary #include
above. */
#include "sys/stat.h"
#include
#include
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
# include "msvc-inval.h"
#endif
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
static int
fstat_nothrow (int fd, struct stat *buf)
{
int result;
TRY_MSVC_INVAL
{
result = orig_fstat (fd, buf);
}
CATCH_MSVC_INVAL
{
result = -1;
errno = EBADF;
}
DONE_MSVC_INVAL;
return result;
}
#else
# define fstat_nothrow orig_fstat
#endif
int
rpl_fstat (int fd, struct stat *buf)
{
#if REPLACE_FCHDIR && REPLACE_OPEN_DIRECTORY
/* Handle the case when rpl_open() used a dummy file descriptor to work
around an open() that can't normally visit directories. */
const char *name = _gl_directory_name (fd);
if (name != NULL)
return stat (name, buf);
#endif
return fstat_nothrow (fd, buf);
}
supermin-5.2.2/lib/fts-cycle.c 0000664 0001750 0001750 00000010265 13057324244 013120 0000000 0000000 /* Detect cycles in file tree walks.
Copyright (C) 2003-2006, 2009-2017 Free Software Foundation, Inc.
Written by Jim Meyering.
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 3 of the License, 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, see . */
#include "cycle-check.h"
#include "hash.h"
/* Use each of these to map a device/inode pair to an FTSENT. */
struct Active_dir
{
dev_t dev;
ino_t ino;
FTSENT *fts_ent;
};
static bool
AD_compare (void const *x, void const *y)
{
struct Active_dir const *ax = x;
struct Active_dir const *ay = y;
return ax->ino == ay->ino
&& ax->dev == ay->dev;
}
static size_t
AD_hash (void const *x, size_t table_size)
{
struct Active_dir const *ax = x;
return (uintmax_t) ax->ino % table_size;
}
/* Set up the cycle-detection machinery. */
static bool
setup_dir (FTS *fts)
{
if (fts->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
{
enum { HT_INITIAL_SIZE = 31 };
fts->fts_cycle.ht = hash_initialize (HT_INITIAL_SIZE, NULL, AD_hash,
AD_compare, free);
if (! fts->fts_cycle.ht)
return false;
}
else
{
fts->fts_cycle.state = malloc (sizeof *fts->fts_cycle.state);
if (! fts->fts_cycle.state)
return false;
cycle_check_init (fts->fts_cycle.state);
}
return true;
}
/* Enter a directory during a file tree walk. */
static bool
enter_dir (FTS *fts, FTSENT *ent)
{
if (fts->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
{
struct stat const *st = ent->fts_statp;
struct Active_dir *ad = malloc (sizeof *ad);
struct Active_dir *ad_from_table;
if (!ad)
return false;
ad->dev = st->st_dev;
ad->ino = st->st_ino;
ad->fts_ent = ent;
/* See if we've already encountered this directory.
This can happen when following symlinks as well as
with a corrupted directory hierarchy. */
ad_from_table = hash_insert (fts->fts_cycle.ht, ad);
if (ad_from_table != ad)
{
free (ad);
if (!ad_from_table)
return false;
/* There was an entry with matching dev/inode already in the table.
Record the fact that we've found a cycle. */
ent->fts_cycle = ad_from_table->fts_ent;
ent->fts_info = FTS_DC;
}
}
else
{
if (cycle_check (fts->fts_cycle.state, ent->fts_statp))
{
/* FIXME: setting fts_cycle like this isn't proper.
To do what the documentation requires, we'd have to
go around the cycle again and find the right entry.
But no callers in coreutils use the fts_cycle member. */
ent->fts_cycle = ent;
ent->fts_info = FTS_DC;
}
}
return true;
}
/* Leave a directory during a file tree walk. */
static void
leave_dir (FTS *fts, FTSENT *ent)
{
struct stat const *st = ent->fts_statp;
if (fts->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
{
struct Active_dir obj;
void *found;
obj.dev = st->st_dev;
obj.ino = st->st_ino;
found = hash_delete (fts->fts_cycle.ht, &obj);
if (!found)
abort ();
free (found);
}
else
{
FTSENT *parent = ent->fts_parent;
if (parent != NULL && 0 <= parent->fts_level)
CYCLE_CHECK_REFLECT_CHDIR_UP (fts->fts_cycle.state,
*(parent->fts_statp), *st);
}
}
/* Free any memory used for cycle detection. */
static void
free_dir (FTS *sp)
{
if (sp->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
{
if (sp->fts_cycle.ht)
hash_free (sp->fts_cycle.ht);
}
else
free (sp->fts_cycle.state);
}
supermin-5.2.2/lib/fts.c 0000664 0001750 0001750 00000223212 13057324244 012021 0000000 0000000 /* Traverse a file hierarchy.
Copyright (C) 2004-2017 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 3 of the License, 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, see . */
/*-
* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include
#if defined LIBC_SCCS && !defined GCC_LINT && !defined lint
static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#endif
#include "fts_.h"
#if HAVE_SYS_PARAM_H || defined _LIBC
# include
#endif
#ifdef _LIBC
# include
#else
# include
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#if ! _LIBC
# include "fcntl--.h"
# include "dirent--.h"
# include "unistd--.h"
/* FIXME - use fcntl(F_DUPFD_CLOEXEC)/openat(O_CLOEXEC) once they are
supported. */
# include "cloexec.h"
# include "flexmember.h"
# include "openat.h"
# include "same-inode.h"
#endif
#include
#ifndef _D_EXACT_NAMLEN
# define _D_EXACT_NAMLEN(dirent) strlen ((dirent)->d_name)
#endif
#if HAVE_STRUCT_DIRENT_D_TYPE
/* True if the type of the directory entry D is known. */
# define DT_IS_KNOWN(d) ((d)->d_type != DT_UNKNOWN)
/* True if the type of the directory entry D must be T. */
# define DT_MUST_BE(d, t) ((d)->d_type == (t))
# define D_TYPE(d) ((d)->d_type)
#else
# define DT_IS_KNOWN(d) false
# define DT_MUST_BE(d, t) false
# define D_TYPE(d) DT_UNKNOWN
# undef DT_UNKNOWN
# define DT_UNKNOWN 0
/* Any nonzero values will do here, so long as they're distinct.
Undef any existing macros out of the way. */
# undef DT_BLK
# undef DT_CHR
# undef DT_DIR
# undef DT_FIFO
# undef DT_LNK
# undef DT_REG
# undef DT_SOCK
# define DT_BLK 1
# define DT_CHR 2
# define DT_DIR 3
# define DT_FIFO 4
# define DT_LNK 5
# define DT_REG 6
# define DT_SOCK 7
#endif
#ifndef S_IFLNK
# define S_IFLNK 0
#endif
#ifndef S_IFSOCK
# define S_IFSOCK 0
#endif
enum
{
NOT_AN_INODE_NUMBER = 0
};
#ifdef D_INO_IN_DIRENT
# define D_INO(dp) (dp)->d_ino
#else
/* Some systems don't have inodes, so fake them to avoid lots of ifdefs. */
# define D_INO(dp) NOT_AN_INODE_NUMBER
#endif
/* If possible (see max_entries, below), read no more than this many directory
entries at a time. Without this limit (i.e., when using non-NULL
fts_compar), processing a directory with 4,000,000 entries requires ~1GiB
of memory, and handling 64M entries would require 16GiB of memory. */
#ifndef FTS_MAX_READDIR_ENTRIES
# define FTS_MAX_READDIR_ENTRIES 100000
#endif
/* If there are more than this many entries in a directory,
and the conditions mentioned below are satisfied, then sort
the entries on inode number before any further processing. */
#ifndef FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD
# define FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD 10000
#endif
enum
{
_FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD = FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD
};
enum Fts_stat
{
FTS_NO_STAT_REQUIRED = 1,
FTS_STAT_REQUIRED = 2
};
#ifdef _LIBC
# undef close
# define close __close
# undef closedir
# define closedir __closedir
# undef fchdir
# define fchdir __fchdir
# undef open
# define open __open
# undef readdir
# define readdir __readdir
#else
# undef internal_function
# define internal_function /* empty */
#endif
#ifndef __set_errno
# define __set_errno(Val) errno = (Val)
#endif
/* If this host provides the openat function, then we can avoid
attempting to open "." in some initialization code below. */
#ifdef HAVE_OPENAT
# define HAVE_OPENAT_SUPPORT 1
#else
# define HAVE_OPENAT_SUPPORT 0
#endif
#ifdef NDEBUG
# define fts_assert(expr) ((void) (0 && (expr)))
#else
# define fts_assert(expr) \
do \
{ \
if (!(expr)) \
abort (); \
} \
while (false)
#endif
static FTSENT *fts_alloc (FTS *, const char *, size_t) internal_function;
static FTSENT *fts_build (FTS *, int) internal_function;
static void fts_lfree (FTSENT *) internal_function;
static void fts_load (FTS *, FTSENT *) internal_function;
static size_t fts_maxarglen (char * const *) internal_function;
static void fts_padjust (FTS *, FTSENT *) internal_function;
static bool fts_palloc (FTS *, size_t) internal_function;
static FTSENT *fts_sort (FTS *, FTSENT *, size_t) internal_function;
static unsigned short int fts_stat (FTS *, FTSENT *, bool) internal_function;
static int fts_safe_changedir (FTS *, FTSENT *, int, const char *)
internal_function;
#include "fts-cycle.c"
#ifndef MAX
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
#endif
#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
#define STREQ(a, b) (strcmp (a, b) == 0)
#define CLR(opt) (sp->fts_options &= ~(opt))
#define ISSET(opt) (sp->fts_options & (opt))
#define SET(opt) (sp->fts_options |= (opt))
/* FIXME: FTS_NOCHDIR is now misnamed.
Call it FTS_USE_FULL_RELATIVE_FILE_NAMES instead. */
#define FCHDIR(sp, fd) \
(!ISSET(FTS_NOCHDIR) && (ISSET(FTS_CWDFD) \
? (cwd_advance_fd ((sp), (fd), true), 0) \
: fchdir (fd)))
/* fts_build flags */
/* FIXME: make this an enum */
#define BCHILD 1 /* fts_children */
#define BNAMES 2 /* fts_children, names only */
#define BREAD 3 /* fts_read */
#if FTS_DEBUG
# include
# include
# include
# include "getcwdat.h"
bool fts_debug = false;
# define Dprintf(x) do { if (fts_debug) printf x; } while (false)
#else
# define Dprintf(x)
# define fd_ring_check(x)
# define fd_ring_print(a, b, c)
#endif
#define LEAVE_DIR(Fts, Ent, Tag) \
do \
{ \
Dprintf ((" %s-leaving: %s\n", Tag, (Ent)->fts_path)); \
leave_dir (Fts, Ent); \
fd_ring_check (Fts); \
} \
while (false)
static void
fd_ring_clear (I_ring *fd_ring)
{
while ( ! i_ring_empty (fd_ring))
{
int fd = i_ring_pop (fd_ring);
if (0 <= fd)
close (fd);
}
}
/* Overload the fts_statp->st_size member (otherwise unused, when
fts_info is FTS_NSOK) to indicate whether fts_read should stat
this entry or not. */
static void
fts_set_stat_required (FTSENT *p, bool required)
{
fts_assert (p->fts_info == FTS_NSOK);
p->fts_statp->st_size = (required
? FTS_STAT_REQUIRED
: FTS_NO_STAT_REQUIRED);
}
/* file-descriptor-relative opendir. */
/* FIXME: if others need this function, move it into lib/openat.c */
static DIR *
internal_function
opendirat (int fd, char const *dir, int extra_flags, int *pdir_fd)
{
int new_fd = openat (fd, dir,
(O_RDONLY | O_DIRECTORY | O_NOCTTY | O_NONBLOCK
| extra_flags));
DIR *dirp;
if (new_fd < 0)
return NULL;
set_cloexec_flag (new_fd, true);
dirp = fdopendir (new_fd);
if (dirp)
*pdir_fd = new_fd;
else
{
int saved_errno = errno;
close (new_fd);
errno = saved_errno;
}
return dirp;
}
/* Virtual fchdir. Advance SP's working directory file descriptor,
SP->fts_cwd_fd, to FD, and push the previous value onto the fd_ring.
CHDIR_DOWN_ONE is true if FD corresponds to an entry in the directory
open on sp->fts_cwd_fd; i.e., to move the working directory one level
down. */
static void
internal_function
cwd_advance_fd (FTS *sp, int fd, bool chdir_down_one)
{
int old = sp->fts_cwd_fd;
fts_assert (old != fd || old == AT_FDCWD);
if (chdir_down_one)
{
/* Push "old" onto the ring.
If the displaced file descriptor is non-negative, close it. */
int prev_fd_in_slot = i_ring_push (&sp->fts_fd_ring, old);
fd_ring_print (sp, stderr, "post-push");
if (0 <= prev_fd_in_slot)
close (prev_fd_in_slot); /* ignore any close failure */
}
else if ( ! ISSET (FTS_NOCHDIR))
{
if (0 <= old)
close (old); /* ignore any close failure */
}
sp->fts_cwd_fd = fd;
}
/* Restore the initial, pre-traversal, "working directory".
In FTS_CWDFD mode, we merely call cwd_advance_fd, otherwise,
we may actually change the working directory.
Return 0 upon success. Upon failure, set errno and return nonzero. */
static int
restore_initial_cwd (FTS *sp)
{
int fail = FCHDIR (sp, ISSET (FTS_CWDFD) ? AT_FDCWD : sp->fts_rfd);
fd_ring_clear (&(sp->fts_fd_ring));
return fail;
}
/* Open the directory DIR if possible, and return a file
descriptor. Return -1 and set errno on failure. It doesn't matter
whether the file descriptor has read or write access. */
static int
internal_function
diropen (FTS const *sp, char const *dir)
{
int open_flags = (O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK
| (ISSET (FTS_PHYSICAL) ? O_NOFOLLOW : 0)
| (ISSET (FTS_NOATIME) ? O_NOATIME : 0));
int fd = (ISSET (FTS_CWDFD)
? openat (sp->fts_cwd_fd, dir, open_flags)
: open (dir, open_flags));
if (0 <= fd)
set_cloexec_flag (fd, true);
return fd;
}
FTS *
fts_open (char * const *argv,
register int options,
int (*compar) (FTSENT const **, FTSENT const **))
{
register FTS *sp;
register FTSENT *p, *root;
register size_t nitems;
FTSENT *parent = NULL;
FTSENT *tmp = NULL; /* pacify gcc */
bool defer_stat;
/* Options check. */
if (options & ~FTS_OPTIONMASK) {
__set_errno (EINVAL);
return (NULL);
}
if ((options & FTS_NOCHDIR) && (options & FTS_CWDFD)) {
__set_errno (EINVAL);
return (NULL);
}
if ( ! (options & (FTS_LOGICAL | FTS_PHYSICAL))) {
__set_errno (EINVAL);
return (NULL);
}
/* Allocate/initialize the stream */
if ((sp = malloc(sizeof(FTS))) == NULL)
return (NULL);
memset(sp, 0, sizeof(FTS));
sp->fts_compar = compar;
sp->fts_options = options;
/* Logical walks turn on NOCHDIR; symbolic links are too hard. */
if (ISSET(FTS_LOGICAL)) {
SET(FTS_NOCHDIR);
CLR(FTS_CWDFD);
}
/* Initialize fts_cwd_fd. */
sp->fts_cwd_fd = AT_FDCWD;
if ( ISSET(FTS_CWDFD) && ! HAVE_OPENAT_SUPPORT)
{
/* While it isn't technically necessary to open "." this
early, doing it here saves us the trouble of ensuring
later (where it'd be messier) that "." can in fact
be opened. If not, revert to FTS_NOCHDIR mode. */
int fd = open (".",
O_SEARCH | (ISSET (FTS_NOATIME) ? O_NOATIME : 0));
if (fd < 0)
{
/* Even if "." is unreadable, don't revert to FTS_NOCHDIR mode
on systems like Linux+PROC_FS, where our openat emulation
is good enough. Note: on a system that emulates
openat via /proc, this technique can still fail, but
only in extreme conditions, e.g., when the working
directory cannot be saved (i.e. save_cwd fails) --
and that happens on Linux only when "." is unreadable
and the CWD would be longer than PATH_MAX.
FIXME: once Linux kernel openat support is well established,
replace the above open call and this entire if/else block
with the body of the if-block below. */
if ( openat_needs_fchdir ())
{
SET(FTS_NOCHDIR);
CLR(FTS_CWDFD);
}
}
else
{
close (fd);
}
}
/*
* Start out with 1K of file name space, and enough, in any case,
* to hold the user's file names.
*/
#ifndef MAXPATHLEN
# define MAXPATHLEN 1024
#endif
{
size_t maxarglen = fts_maxarglen(argv);
if (! fts_palloc(sp, MAX(maxarglen, MAXPATHLEN)))
goto mem1;
}
/* Allocate/initialize root's parent. */
if (*argv != NULL) {
if ((parent = fts_alloc(sp, "", 0)) == NULL)
goto mem2;
parent->fts_level = FTS_ROOTPARENTLEVEL;
}
/* The classic fts implementation would call fts_stat with
a new entry for each iteration of the loop below.
If the comparison function is not specified or if the
FTS_DEFER_STAT option is in effect, don't stat any entry
in this loop. This is an attempt to minimize the interval
between the initial stat/lstat/fstatat and the point at which
a directory argument is first opened. This matters for any
directory command line argument that resides on a file system
without genuine i-nodes. If you specify FTS_DEFER_STAT along
with a comparison function, that function must not access any
data via the fts_statp pointer. */
defer_stat = (compar == NULL || ISSET(FTS_DEFER_STAT));
/* Allocate/initialize root(s). */
for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
/* *Do* allow zero-length file names. */
size_t len = strlen(*argv);
if ( ! (options & FTS_VERBATIM))
{
/* If there are two or more trailing slashes, trim all but one,
but don't change "//" to "/", and do map "///" to "/". */
char const *v = *argv;
if (2 < len && v[len - 1] == '/')
while (1 < len && v[len - 2] == '/')
--len;
}
if ((p = fts_alloc(sp, *argv, len)) == NULL)
goto mem3;
p->fts_level = FTS_ROOTLEVEL;
p->fts_parent = parent;
p->fts_accpath = p->fts_name;
/* Even when defer_stat is true, be sure to stat the first
command line argument, since fts_read (at least with
FTS_XDEV) requires that. */
if (defer_stat && root != NULL) {
p->fts_info = FTS_NSOK;
fts_set_stat_required(p, true);
} else {
p->fts_info = fts_stat(sp, p, false);
}
/*
* If comparison routine supplied, traverse in sorted
* order; otherwise traverse in the order specified.
*/
if (compar) {
p->fts_link = root;
root = p;
} else {
p->fts_link = NULL;
if (root == NULL)
tmp = root = p;
else {
tmp->fts_link = p;
tmp = p;
}
}
}
if (compar && nitems > 1)
root = fts_sort(sp, root, nitems);
/*
* Allocate a dummy pointer and make fts_read think that we've just
* finished the node before the root(s); set p->fts_info to FTS_INIT
* so that everything about the "current" node is ignored.
*/
if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
goto mem3;
sp->fts_cur->fts_link = root;
sp->fts_cur->fts_info = FTS_INIT;
if (! setup_dir (sp))
goto mem3;
/*
* If using chdir(2), grab a file descriptor pointing to dot to ensure
* that we can get back here; this could be avoided for some file names,
* but almost certainly not worth the effort. Slashes, symbolic links,
* and ".." are all fairly nasty problems. Note, if we can't get the
* descriptor we run anyway, just more slowly.
*/
if (!ISSET(FTS_NOCHDIR) && !ISSET(FTS_CWDFD)
&& (sp->fts_rfd = diropen (sp, ".")) < 0)
SET(FTS_NOCHDIR);
i_ring_init (&sp->fts_fd_ring, -1);
return (sp);
mem3: fts_lfree(root);
free(parent);
mem2: free(sp->fts_path);
mem1: free(sp);
return (NULL);
}
static void
internal_function
fts_load (FTS *sp, register FTSENT *p)
{
register size_t len;
register char *cp;
/*
* Load the stream structure for the next traversal. Since we don't
* actually enter the directory until after the preorder visit, set
* the fts_accpath field specially so the chdir gets done to the right
* place and the user can access the first node. From fts_open it's
* known that the file name will fit.
*/
len = p->fts_pathlen = p->fts_namelen;
memmove(sp->fts_path, p->fts_name, len + 1);
if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
len = strlen(++cp);
memmove(p->fts_name, cp, len + 1);
p->fts_namelen = len;
}
p->fts_accpath = p->fts_path = sp->fts_path;
}
int
fts_close (FTS *sp)
{
register FTSENT *freep, *p;
int saved_errno = 0;
/*
* This still works if we haven't read anything -- the dummy structure
* points to the root list, so we step through to the end of the root
* list which has a valid parent pointer.
*/
if (sp->fts_cur) {
for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
freep = p;
p = p->fts_link != NULL ? p->fts_link : p->fts_parent;
free(freep);
}
free(p);
}
/* Free up child linked list, sort array, file name buffer. */
if (sp->fts_child)
fts_lfree(sp->fts_child);
free(sp->fts_array);
free(sp->fts_path);
if (ISSET(FTS_CWDFD))
{
if (0 <= sp->fts_cwd_fd)
if (close (sp->fts_cwd_fd))
saved_errno = errno;
}
else if (!ISSET(FTS_NOCHDIR))
{
/* Return to original directory, save errno if necessary. */
if (fchdir(sp->fts_rfd))
saved_errno = errno;
/* If close fails, record errno only if saved_errno is zero,
so that we report the probably-more-meaningful fchdir errno. */
if (close (sp->fts_rfd))
if (saved_errno == 0)
saved_errno = errno;
}
fd_ring_clear (&sp->fts_fd_ring);
if (sp->fts_leaf_optimization_works_ht)
hash_free (sp->fts_leaf_optimization_works_ht);
free_dir (sp);
/* Free up the stream pointer. */
free(sp);
/* Set errno and return. */
if (saved_errno) {
__set_errno (saved_errno);
return (-1);
}
return (0);
}
#if defined __linux__ \
&& HAVE_SYS_VFS_H && HAVE_FSTATFS && HAVE_STRUCT_STATFS_F_TYPE
# include
/* Linux-specific constants from coreutils' src/fs.h */
# define S_MAGIC_TMPFS 0x1021994
# define S_MAGIC_NFS 0x6969
# define S_MAGIC_REISERFS 0x52654973
# define S_MAGIC_XFS 0x58465342
# define S_MAGIC_PROC 0x9FA0
/* Return false if it is easy to determine the file system type of
the directory on which DIR_FD is open, and sorting dirents on
inode numbers is known not to improve traversal performance with
that type of file system. Otherwise, return true. */
static bool
dirent_inode_sort_may_be_useful (int dir_fd)
{
/* Skip the sort only if we can determine efficiently
that skipping it is the right thing to do.
The cost of performing an unnecessary sort is negligible,
while the cost of *not* performing it can be O(N^2) with
a very large constant. */
struct statfs fs_buf;
/* If fstatfs fails, assume sorting would be useful. */
if (fstatfs (dir_fd, &fs_buf) != 0)
return true;
/* FIXME: what about when f_type is not an integral type?
deal with that if/when it's encountered. */
switch (fs_buf.f_type)
{
case S_MAGIC_TMPFS:
case S_MAGIC_NFS:
/* On a file system of any of these types, sorting
is unnecessary, and hence wasteful. */
return false;
default:
return true;
}
}
/* Given a file descriptor DIR_FD open on a directory D,
return true if it is valid to apply the leaf-optimization
technique of counting directories in D via stat.st_nlink. */
static bool
leaf_optimization_applies (int dir_fd)
{
struct statfs fs_buf;
/* If fstatfs fails, assume we can't use the optimization. */
if (fstatfs (dir_fd, &fs_buf) != 0)
return false;
/* FIXME: do we need to detect AFS mount points? I doubt it,
unless fstatfs can report S_MAGIC_REISERFS for such a directory. */
switch (fs_buf.f_type)
{
/* List here the file system types that lack usable dirent.d_type
info, yet for which the optimization does apply. */
case S_MAGIC_REISERFS:
case S_MAGIC_XFS:
return true;
/* Explicitly list here any other file system type for which the
optimization is not applicable, but need documentation. */
case S_MAGIC_NFS:
/* NFS provides usable dirent.d_type but not necessarily for all entries
of large directories, so as per
NFS should return true. However st_nlink values are not accurate on
all implementations as per . */
/* fall through */
case S_MAGIC_PROC:
/* Per /proc may have
bogus stat.st_nlink values. */
/* fall through */
default:
return false;
}
}
#else
static bool
dirent_inode_sort_may_be_useful (int dir_fd _GL_UNUSED) { return true; }
static bool
leaf_optimization_applies (int dir_fd _GL_UNUSED) { return false; }
#endif
/* link-count-optimization entry:
map a stat.st_dev number to a boolean: leaf_optimization_works */
struct LCO_ent
{
dev_t st_dev;
bool opt_ok;
};
/* Use a tiny initial size. If a traversal encounters more than
a few devices, the cost of growing/rehashing this table will be
rendered negligible by the number of inodes processed. */
enum { LCO_HT_INITIAL_SIZE = 13 };
static size_t
LCO_hash (void const *x, size_t table_size)
{
struct LCO_ent const *ax = x;
return (uintmax_t) ax->st_dev % table_size;
}
static bool
LCO_compare (void const *x, void const *y)
{
struct LCO_ent const *ax = x;
struct LCO_ent const *ay = y;
return ax->st_dev == ay->st_dev;
}
/* Ask the same question as leaf_optimization_applies, but query
the cache first (FTS.fts_leaf_optimization_works_ht), and if necessary,
update that cache. */
static bool
link_count_optimize_ok (FTSENT const *p)
{
FTS *sp = p->fts_fts;
Hash_table *h = sp->fts_leaf_optimization_works_ht;
struct LCO_ent tmp;
struct LCO_ent *ent;
bool opt_ok;
struct LCO_ent *t2;
/* If we're not in CWDFD mode, don't bother with this optimization,
since the caller is not serious about performance. */
if (!ISSET(FTS_CWDFD))
return false;
/* map st_dev to the boolean, leaf_optimization_works */
if (h == NULL)
{
h = sp->fts_leaf_optimization_works_ht
= hash_initialize (LCO_HT_INITIAL_SIZE, NULL, LCO_hash,
LCO_compare, free);
if (h == NULL)
return false;
}
tmp.st_dev = p->fts_statp->st_dev;
ent = hash_lookup (h, &tmp);
if (ent)
return ent->opt_ok;
/* Look-up failed. Query directly and cache the result. */
t2 = malloc (sizeof *t2);
if (t2 == NULL)
return false;
/* Is it ok to perform the optimization in the dir, FTS_CWD_FD? */
opt_ok = leaf_optimization_applies (sp->fts_cwd_fd);
t2->opt_ok = opt_ok;
t2->st_dev = p->fts_statp->st_dev;
ent = hash_insert (h, t2);
if (ent == NULL)
{
/* insertion failed */
free (t2);
return false;
}
fts_assert (ent == t2);
return opt_ok;
}
/*
* Special case of "/" at the end of the file name so that slashes aren't
* appended which would cause file names to be written as "....//foo".
*/
#define NAPPEND(p) \
(p->fts_path[p->fts_pathlen - 1] == '/' \
? p->fts_pathlen - 1 : p->fts_pathlen)
FTSENT *
fts_read (register FTS *sp)
{
register FTSENT *p, *tmp;
register unsigned short int instr;
register char *t;
/* If finished or unrecoverable error, return NULL. */
if (sp->fts_cur == NULL || ISSET(FTS_STOP))
return (NULL);
/* Set current node pointer. */
p = sp->fts_cur;
/* Save and zero out user instructions. */
instr = p->fts_instr;
p->fts_instr = FTS_NOINSTR;
/* Any type of file may be re-visited; re-stat and re-turn. */
if (instr == FTS_AGAIN) {
p->fts_info = fts_stat(sp, p, false);
return (p);
}
Dprintf (("fts_read: p=%s\n",
p->fts_info == FTS_INIT ? "" : p->fts_path));
/*
* Following a symlink -- SLNONE test allows application to see
* SLNONE and recover. If indirecting through a symlink, have
* keep a pointer to current location. If unable to get that
* pointer, follow fails.
*/
if (instr == FTS_FOLLOW &&
(p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
p->fts_info = fts_stat(sp, p, true);
if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
if ((p->fts_symfd = diropen (sp, ".")) < 0) {
p->fts_errno = errno;
p->fts_info = FTS_ERR;
} else
p->fts_flags |= FTS_SYMFOLLOW;
}
goto check_for_dir;
}
/* Directory in pre-order. */
if (p->fts_info == FTS_D) {
/* If skipped or crossed mount point, do post-order visit. */
if (instr == FTS_SKIP ||
(ISSET(FTS_XDEV) && p->fts_statp->st_dev != sp->fts_dev)) {
if (p->fts_flags & FTS_SYMFOLLOW)
(void)close(p->fts_symfd);
if (sp->fts_child) {
fts_lfree(sp->fts_child);
sp->fts_child = NULL;
}
p->fts_info = FTS_DP;
LEAVE_DIR (sp, p, "1");
return (p);
}
/* Rebuild if only read the names and now traversing. */
if (sp->fts_child != NULL && ISSET(FTS_NAMEONLY)) {
CLR(FTS_NAMEONLY);
fts_lfree(sp->fts_child);
sp->fts_child = NULL;
}
/*
* Cd to the subdirectory.
*
* If have already read and now fail to chdir, whack the list
* to make the names come out right, and set the parent errno
* so the application will eventually get an error condition.
* Set the FTS_DONTCHDIR flag so that when we logically change
* directories back to the parent we don't do a chdir.
*
* If haven't read do so. If the read fails, fts_build sets
* FTS_STOP or the fts_info field of the node.
*/
if (sp->fts_child != NULL) {
if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) {
p->fts_errno = errno;
p->fts_flags |= FTS_DONTCHDIR;
for (p = sp->fts_child; p != NULL;
p = p->fts_link)
p->fts_accpath =
p->fts_parent->fts_accpath;
}
} else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
if (ISSET(FTS_STOP))
return (NULL);
/* If fts_build's call to fts_safe_changedir failed
because it was not able to fchdir into a
subdirectory, tell the caller. */
if (p->fts_errno && p->fts_info != FTS_DNR)
p->fts_info = FTS_ERR;
LEAVE_DIR (sp, p, "2");
return (p);
}
p = sp->fts_child;
sp->fts_child = NULL;
goto name;
}
/* Move to the next node on this level. */
next: tmp = p;
/* If we have so many directory entries that we're reading them
in batches, and we've reached the end of the current batch,
read in a new batch. */
if (p->fts_link == NULL && p->fts_parent->fts_dirp)
{
p = tmp->fts_parent;
sp->fts_cur = p;
sp->fts_path[p->fts_pathlen] = '\0';
if ((p = fts_build (sp, BREAD)) == NULL)
{
if (ISSET(FTS_STOP))
return NULL;
goto cd_dot_dot;
}
free(tmp);
goto name;
}
if ((p = p->fts_link) != NULL) {
sp->fts_cur = p;
free(tmp);
/*
* If reached the top, return to the original directory (or
* the root of the tree), and load the file names for the next
* root.
*/
if (p->fts_level == FTS_ROOTLEVEL) {
if (restore_initial_cwd(sp)) {
SET(FTS_STOP);
return (NULL);
}
free_dir(sp);
fts_load(sp, p);
setup_dir(sp);
goto check_for_dir;
}
/*
* User may have called fts_set on the node. If skipped,
* ignore. If followed, get a file descriptor so we can
* get back if necessary.
*/
if (p->fts_instr == FTS_SKIP)
goto next;
if (p->fts_instr == FTS_FOLLOW) {
p->fts_info = fts_stat(sp, p, true);
if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
if ((p->fts_symfd = diropen (sp, ".")) < 0) {
p->fts_errno = errno;
p->fts_info = FTS_ERR;
} else
p->fts_flags |= FTS_SYMFOLLOW;
}
p->fts_instr = FTS_NOINSTR;
}
name: t = sp->fts_path + NAPPEND(p->fts_parent);
*t++ = '/';
memmove(t, p->fts_name, p->fts_namelen + 1);
check_for_dir:
sp->fts_cur = p;
if (p->fts_info == FTS_NSOK)
{
if (p->fts_statp->st_size == FTS_STAT_REQUIRED)
{
FTSENT *parent = p->fts_parent;
if (FTS_ROOTLEVEL < p->fts_level
/* ->fts_n_dirs_remaining is not valid
for command-line-specified names. */
&& parent->fts_n_dirs_remaining == 0
&& ISSET(FTS_NOSTAT)
&& ISSET(FTS_PHYSICAL)
&& link_count_optimize_ok (parent))
{
/* nothing more needed */
}
else
{
p->fts_info = fts_stat(sp, p, false);
if (S_ISDIR(p->fts_statp->st_mode)
&& p->fts_level != FTS_ROOTLEVEL
&& parent->fts_n_dirs_remaining)
parent->fts_n_dirs_remaining--;
}
}
else
fts_assert (p->fts_statp->st_size == FTS_NO_STAT_REQUIRED);
}
if (p->fts_info == FTS_D)
{
/* Now that P->fts_statp is guaranteed to be valid,
if this is a command-line directory, record its
device number, to be used for FTS_XDEV. */
if (p->fts_level == FTS_ROOTLEVEL)
sp->fts_dev = p->fts_statp->st_dev;
Dprintf ((" entering: %s\n", p->fts_path));
if (! enter_dir (sp, p))
{
__set_errno (ENOMEM);
return NULL;
}
}
return p;
}
cd_dot_dot:
/* Move up to the parent node. */
p = tmp->fts_parent;
sp->fts_cur = p;
free(tmp);
if (p->fts_level == FTS_ROOTPARENTLEVEL) {
/*
* Done; free everything up and set errno to 0 so the user
* can distinguish between error and EOF.
*/
free(p);
__set_errno (0);
return (sp->fts_cur = NULL);
}
fts_assert (p->fts_info != FTS_NSOK);
/* NUL terminate the file name. */
sp->fts_path[p->fts_pathlen] = '\0';
/*
* Return to the parent directory. If at a root node, restore
* the initial working directory. If we came through a symlink,
* go back through the file descriptor. Otherwise, move up
* one level, via "..".
*/
if (p->fts_level == FTS_ROOTLEVEL) {
if (restore_initial_cwd(sp)) {
p->fts_errno = errno;
SET(FTS_STOP);
}
} else if (p->fts_flags & FTS_SYMFOLLOW) {
if (FCHDIR(sp, p->fts_symfd)) {
p->fts_errno = errno;
SET(FTS_STOP);
}
(void)close(p->fts_symfd);
} else if (!(p->fts_flags & FTS_DONTCHDIR) &&
fts_safe_changedir(sp, p->fts_parent, -1, "..")) {
p->fts_errno = errno;
SET(FTS_STOP);
}
/* If the directory causes a cycle, preserve the FTS_DC flag and keep
the corresponding dev/ino pair in the hash table. It is going to be
removed when leaving the original directory. */
if (p->fts_info != FTS_DC) {
p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
if (p->fts_errno == 0)
LEAVE_DIR (sp, p, "3");
}
return ISSET(FTS_STOP) ? NULL : p;
}
/*
* Fts_set takes the stream as an argument although it's not used in this
* implementation; it would be necessary if anyone wanted to add global
* semantics to fts using fts_set. An error return is allowed for similar
* reasons.
*/
/* ARGSUSED */
int
fts_set(FTS *sp _GL_UNUSED, FTSENT *p, int instr)
{
if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
instr != FTS_NOINSTR && instr != FTS_SKIP) {
__set_errno (EINVAL);
return (1);
}
p->fts_instr = instr;
return (0);
}
FTSENT *
fts_children (register FTS *sp, int instr)
{
register FTSENT *p;
int fd;
if (instr != 0 && instr != FTS_NAMEONLY) {
__set_errno (EINVAL);
return (NULL);
}
/* Set current node pointer. */
p = sp->fts_cur;
/*
* Errno set to 0 so user can distinguish empty directory from
* an error.
*/
__set_errno (0);
/* Fatal errors stop here. */
if (ISSET(FTS_STOP))
return (NULL);
/* Return logical hierarchy of user's arguments. */
if (p->fts_info == FTS_INIT)
return (p->fts_link);
/*
* If not a directory being visited in pre-order, stop here. Could
* allow FTS_DNR, assuming the user has fixed the problem, but the
* same effect is available with FTS_AGAIN.
*/
if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */)
return (NULL);
/* Free up any previous child list. */
if (sp->fts_child != NULL)
fts_lfree(sp->fts_child);
if (instr == FTS_NAMEONLY) {
SET(FTS_NAMEONLY);
instr = BNAMES;
} else
instr = BCHILD;
/*
* If using chdir on a relative file name and called BEFORE fts_read
* does its chdir to the root of a traversal, we can lose -- we need to
* chdir into the subdirectory, and we don't know where the current
* directory is, so we can't get back so that the upcoming chdir by
* fts_read will work.
*/
if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
ISSET(FTS_NOCHDIR))
return (sp->fts_child = fts_build(sp, instr));
if ((fd = diropen (sp, ".")) < 0)
return (sp->fts_child = NULL);
sp->fts_child = fts_build(sp, instr);
if (ISSET(FTS_CWDFD))
{
cwd_advance_fd (sp, fd, true);
}
else
{
if (fchdir(fd))
{
int saved_errno = errno;
close (fd);
__set_errno (saved_errno);
return NULL;
}
close (fd);
}
return (sp->fts_child);
}
/* A comparison function to sort on increasing inode number.
For some file system types, sorting either way makes a huge
performance difference for a directory with very many entries,
but sorting on increasing values is slightly better than sorting
on decreasing values. The difference is in the 5% range. */
static int
fts_compare_ino (struct _ftsent const **a, struct _ftsent const **b)
{
return (a[0]->fts_statp->st_ino < b[0]->fts_statp->st_ino ? -1
: b[0]->fts_statp->st_ino < a[0]->fts_statp->st_ino ? 1 : 0);
}
/* Map the dirent.d_type value, DTYPE, to the corresponding stat.st_mode
S_IF* bit and set ST.st_mode, thus clearing all other bits in that field. */
static void
set_stat_type (struct stat *st, unsigned int dtype)
{
mode_t type;
switch (dtype)
{
case DT_BLK:
type = S_IFBLK;
break;
case DT_CHR:
type = S_IFCHR;
break;
case DT_DIR:
type = S_IFDIR;
break;
case DT_FIFO:
type = S_IFIFO;
break;
case DT_LNK:
type = S_IFLNK;
break;
case DT_REG:
type = S_IFREG;
break;
case DT_SOCK:
type = S_IFSOCK;
break;
default:
type = 0;
}
st->st_mode = type;
}
#define closedir_and_clear(dirp) \
do \
{ \
closedir (dirp); \
dirp = NULL; \
} \
while (0)
#define fts_opendir(file, Pdir_fd) \
opendirat((! ISSET(FTS_NOCHDIR) && ISSET(FTS_CWDFD) \
? sp->fts_cwd_fd : AT_FDCWD), \
file, \
(((ISSET(FTS_PHYSICAL) \
&& ! (ISSET(FTS_COMFOLLOW) \
&& cur->fts_level == FTS_ROOTLEVEL)) \
? O_NOFOLLOW : 0) \
| (ISSET (FTS_NOATIME) ? O_NOATIME : 0)), \
Pdir_fd)
/*
* This is the tricky part -- do not casually change *anything* in here. The
* idea is to build the linked list of entries that are used by fts_children
* and fts_read. There are lots of special cases.
*
* The real slowdown in walking the tree is the stat calls. If FTS_NOSTAT is
* set and it's a physical walk (so that symbolic links can't be directories),
* we can do things quickly. First, if it's a 4.4BSD file system, the type
* of the file is in the directory entry. Otherwise, we assume that the number
* of subdirectories in a node is equal to the number of links to the parent.
* The former skips all stat calls. The latter skips stat calls in any leaf
* directories and for any files after the subdirectories in the directory have
* been found, cutting the stat calls by about 2/3.
*/
static FTSENT *
internal_function
fts_build (register FTS *sp, int type)
{
register FTSENT *p, *head;
register size_t nitems;
FTSENT *tail;
void *oldaddr;
int saved_errno;
bool descend;
bool doadjust;
ptrdiff_t level;
nlink_t nlinks;
bool nostat;
size_t len, maxlen, new_len;
char *cp;
int dir_fd;
FTSENT *cur = sp->fts_cur;
bool continue_readdir = !!cur->fts_dirp;
size_t max_entries;
/* When cur->fts_dirp is non-NULL, that means we should
continue calling readdir on that existing DIR* pointer
rather than opening a new one. */
if (continue_readdir)
{
DIR *dp = cur->fts_dirp;
dir_fd = dirfd (dp);
if (dir_fd < 0)
{
closedir_and_clear (cur->fts_dirp);
if (type == BREAD)
{
cur->fts_info = FTS_DNR;
cur->fts_errno = errno;
}
return NULL;
}
}
else
{
/* Open the directory for reading. If this fails, we're done.
If being called from fts_read, set the fts_info field. */
if ((cur->fts_dirp = fts_opendir(cur->fts_accpath, &dir_fd)) == NULL)
{
if (type == BREAD)
{
cur->fts_info = FTS_DNR;
cur->fts_errno = errno;
}
return NULL;
}
/* Rather than calling fts_stat for each and every entry encountered
in the readdir loop (below), stat each directory only right after
opening it. */
if (cur->fts_info == FTS_NSOK)
cur->fts_info = fts_stat(sp, cur, false);
else if (sp->fts_options & FTS_TIGHT_CYCLE_CHECK)
{
/* Now read the stat info again after opening a directory to
reveal eventual changes caused by a submount triggered by
the traversal. But do it only for utilities which use
FTS_TIGHT_CYCLE_CHECK. Therefore, only find and du
benefit/suffer from this feature for now. */
LEAVE_DIR (sp, cur, "4");
fts_stat (sp, cur, false);
if (! enter_dir (sp, cur))
{
__set_errno (ENOMEM);
return NULL;
}
}
}
/* Maximum number of readdir entries to read at one time. This
limitation is to avoid reading millions of entries into memory
at once. When an fts_compar function is specified, we have no
choice: we must read all entries into memory before calling that
function. But when no such function is specified, we can read
entries in batches that are large enough to help us with inode-
sorting, yet not so large that we risk exhausting memory. */
max_entries = sp->fts_compar ? SIZE_MAX : FTS_MAX_READDIR_ENTRIES;
/*
* Nlinks is the number of possible entries of type directory in the
* directory if we're cheating on stat calls, 0 if we're not doing
* any stat calls at all, (nlink_t) -1 if we're statting everything.
*/
if (type == BNAMES) {
nlinks = 0;
/* Be quiet about nostat, GCC. */
nostat = false;
} else if (ISSET(FTS_NOSTAT) && ISSET(FTS_PHYSICAL)) {
nlinks = (cur->fts_statp->st_nlink
- (ISSET(FTS_SEEDOT) ? 0 : 2));
nostat = true;
} else {
nlinks = -1;
nostat = false;
}
/*
* If we're going to need to stat anything or we want to descend
* and stay in the directory, chdir. If this fails we keep going,
* but set a flag so we don't chdir after the post-order visit.
* We won't be able to stat anything, but we can still return the
* names themselves. Note, that since fts_read won't be able to
* chdir into the directory, it will have to return different file
* names than before, i.e. "a/b" instead of "b". Since the node
* has already been visited in pre-order, have to wait until the
* post-order visit to return the error. There is a special case
* here, if there was nothing to stat then it's not an error to
* not be able to stat. This is all fairly nasty. If a program
* needed sorted entries or stat information, they had better be
* checking FTS_NS on the returned nodes.
*/
if (continue_readdir)
{
/* When resuming a short readdir run, we already have
the required dirp and dir_fd. */
descend = true;
}
else if (nlinks || type == BREAD) {
if (ISSET(FTS_CWDFD))
{
dir_fd = dup (dir_fd);
if (0 <= dir_fd)
set_cloexec_flag (dir_fd, true);
}
if (dir_fd < 0 || fts_safe_changedir(sp, cur, dir_fd, NULL)) {
if (nlinks && type == BREAD)
cur->fts_errno = errno;
cur->fts_flags |= FTS_DONTCHDIR;
descend = false;
closedir_and_clear(cur->fts_dirp);
if (ISSET(FTS_CWDFD) && 0 <= dir_fd)
close (dir_fd);
cur->fts_dirp = NULL;
} else
descend = true;
} else
descend = false;
/*
* Figure out the max file name length that can be stored in the
* current buffer -- the inner loop allocates more space as necessary.
* We really wouldn't have to do the maxlen calculations here, we
* could do them in fts_read before returning the name, but it's a
* lot easier here since the length is part of the dirent structure.
*
* If not changing directories set a pointer so that can just append
* each new component into the file name.
*/
len = NAPPEND(cur);
if (ISSET(FTS_NOCHDIR)) {
cp = sp->fts_path + len;
*cp++ = '/';
} else {
/* GCC, you're too verbose. */
cp = NULL;
}
len++;
maxlen = sp->fts_pathlen - len;
level = cur->fts_level + 1;
/* Read the directory, attaching each entry to the "link" pointer. */
doadjust = false;
head = NULL;
tail = NULL;
nitems = 0;
while (cur->fts_dirp) {
bool is_dir;
size_t d_namelen;
__set_errno (0);
struct dirent *dp = readdir(cur->fts_dirp);
if (dp == NULL) {
if (errno) {
cur->fts_errno = errno;
/* If we've not read any items yet, treat
the error as if we can't access the dir. */
cur->fts_info = (continue_readdir || nitems)
? FTS_ERR : FTS_DNR;
}
break;
}
if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
continue;
d_namelen = _D_EXACT_NAMLEN (dp);
p = fts_alloc (sp, dp->d_name, d_namelen);
if (!p)
goto mem1;
if (d_namelen >= maxlen) {
/* include space for NUL */
oldaddr = sp->fts_path;
if (! fts_palloc(sp, d_namelen + len + 1)) {
/*
* No more memory. Save
* errno, free up the current structure and the
* structures already allocated.
*/
mem1: saved_errno = errno;
free(p);
fts_lfree(head);
closedir_and_clear(cur->fts_dirp);
cur->fts_info = FTS_ERR;
SET(FTS_STOP);
__set_errno (saved_errno);
return (NULL);
}
/* Did realloc() change the pointer? */
if (oldaddr != sp->fts_path) {
doadjust = true;
if (ISSET(FTS_NOCHDIR))
cp = sp->fts_path + len;
}
maxlen = sp->fts_pathlen - len;
}
new_len = len + d_namelen;
if (new_len < len) {
/*
* In the unlikely event that we would end up
* with a file name longer than SIZE_MAX, free up
* the current structure and the structures already
* allocated, then error out with ENAMETOOLONG.
*/
free(p);
fts_lfree(head);
closedir_and_clear(cur->fts_dirp);
cur->fts_info = FTS_ERR;
SET(FTS_STOP);
__set_errno (ENAMETOOLONG);
return (NULL);
}
p->fts_level = level;
p->fts_parent = sp->fts_cur;
p->fts_pathlen = new_len;
/* Store dirent.d_ino, in case we need to sort
entries before processing them. */
p->fts_statp->st_ino = D_INO (dp);
/* Build a file name for fts_stat to stat. */
if (ISSET(FTS_NOCHDIR)) {
p->fts_accpath = p->fts_path;
memmove(cp, p->fts_name, p->fts_namelen + 1);
} else
p->fts_accpath = p->fts_name;
if (sp->fts_compar == NULL || ISSET(FTS_DEFER_STAT)) {
/* Record what fts_read will have to do with this
entry. In many cases, it will simply fts_stat it,
but we can take advantage of any d_type information
to optimize away the unnecessary stat calls. I.e.,
if FTS_NOSTAT is in effect and we're not following
symlinks (FTS_PHYSICAL) and d_type indicates this
is *not* a directory, then we won't have to stat it
at all. If it *is* a directory, then (currently)
we stat it regardless, in order to get device and
inode numbers. Some day we might optimize that
away, too, for directories where d_ino is known to
be valid. */
bool skip_stat = (ISSET(FTS_PHYSICAL)
&& ISSET(FTS_NOSTAT)
&& DT_IS_KNOWN(dp)
&& ! DT_MUST_BE(dp, DT_DIR));
p->fts_info = FTS_NSOK;
/* Propagate dirent.d_type information back
to caller, when possible. */
set_stat_type (p->fts_statp, D_TYPE (dp));
fts_set_stat_required(p, !skip_stat);
is_dir = (ISSET(FTS_PHYSICAL)
&& DT_MUST_BE(dp, DT_DIR));
} else {
p->fts_info = fts_stat(sp, p, false);
is_dir = (p->fts_info == FTS_D
|| p->fts_info == FTS_DC
|| p->fts_info == FTS_DOT);
}
/* Decrement link count if applicable. */
if (nlinks > 0 && is_dir)
nlinks -= nostat;
/* We walk in directory order so "ls -f" doesn't get upset. */
p->fts_link = NULL;
if (head == NULL)
head = tail = p;
else {
tail->fts_link = p;
tail = p;
}
++nitems;
if (max_entries <= nitems) {
/* When there are too many dir entries, leave
fts_dirp open, so that a subsequent fts_read
can take up where we leave off. */
goto break_without_closedir;
}
}
if (cur->fts_dirp)
closedir_and_clear(cur->fts_dirp);
break_without_closedir:
/*
* If realloc() changed the address of the file name, adjust the
* addresses for the rest of the tree and the dir list.
*/
if (doadjust)
fts_padjust(sp, head);
/*
* If not changing directories, reset the file name back to original
* state.
*/
if (ISSET(FTS_NOCHDIR)) {
if (len == sp->fts_pathlen || nitems == 0)
--cp;
*cp = '\0';
}
/*
* If descended after called from fts_children or after called from
* fts_read and nothing found, get back. At the root level we use
* the saved fd; if one of fts_open()'s arguments is a relative name
* to an empty directory, we wind up here with no other way back. If
* can't get back, we're done.
*/
if (!continue_readdir && descend && (type == BCHILD || !nitems) &&
(cur->fts_level == FTS_ROOTLEVEL
? restore_initial_cwd(sp)
: fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
cur->fts_info = FTS_ERR;
SET(FTS_STOP);
fts_lfree(head);
return (NULL);
}
/* If didn't find anything, return NULL. */
if (!nitems) {
if (type == BREAD
&& cur->fts_info != FTS_DNR && cur->fts_info != FTS_ERR)
cur->fts_info = FTS_DP;
fts_lfree(head);
return (NULL);
}
/* If there are many entries, no sorting function has been specified,
and this file system is of a type that may be slow with a large
number of entries, then sort the directory entries on increasing
inode numbers. */
if (nitems > _FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD
&& !sp->fts_compar
&& ISSET (FTS_CWDFD)
&& dirent_inode_sort_may_be_useful (sp->fts_cwd_fd)) {
sp->fts_compar = fts_compare_ino;
head = fts_sort (sp, head, nitems);
sp->fts_compar = NULL;
}
/* Sort the entries. */
if (sp->fts_compar && nitems > 1)
head = fts_sort(sp, head, nitems);
return (head);
}
#if FTS_DEBUG
/* Walk ->fts_parent links starting at E_CURR, until the root of the
current hierarchy. There should be a directory with dev/inode
matching those of AD. If not, print a lot of diagnostics. */
static void
find_matching_ancestor (FTSENT const *e_curr, struct Active_dir const *ad)
{
FTSENT const *ent;
for (ent = e_curr; ent->fts_level >= FTS_ROOTLEVEL; ent = ent->fts_parent)
{
if (ad->ino == ent->fts_statp->st_ino
&& ad->dev == ent->fts_statp->st_dev)
return;
}
printf ("ERROR: tree dir, %s, not active\n", ad->fts_ent->fts_accpath);
printf ("active dirs:\n");
for (ent = e_curr;
ent->fts_level >= FTS_ROOTLEVEL; ent = ent->fts_parent)
printf (" %s(%"PRIuMAX"/%"PRIuMAX") to %s(%"PRIuMAX"/%"PRIuMAX")...\n",
ad->fts_ent->fts_accpath,
(uintmax_t) ad->dev,
(uintmax_t) ad->ino,
ent->fts_accpath,
(uintmax_t) ent->fts_statp->st_dev,
(uintmax_t) ent->fts_statp->st_ino);
}
void
fts_cross_check (FTS const *sp)
{
FTSENT const *ent = sp->fts_cur;
FTSENT const *t;
if ( ! ISSET (FTS_TIGHT_CYCLE_CHECK))
return;
Dprintf (("fts-cross-check cur=%s\n", ent->fts_path));
/* Make sure every parent dir is in the tree. */
for (t = ent->fts_parent; t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
{
struct Active_dir ad;
ad.ino = t->fts_statp->st_ino;
ad.dev = t->fts_statp->st_dev;
if ( ! hash_lookup (sp->fts_cycle.ht, &ad))
printf ("ERROR: active dir, %s, not in tree\n", t->fts_path);
}
/* Make sure every dir in the tree is an active dir.
But ENT is not necessarily a directory. If so, just skip this part. */
if (ent->fts_parent->fts_level >= FTS_ROOTLEVEL
&& (ent->fts_info == FTS_DP
|| ent->fts_info == FTS_D))
{
struct Active_dir *ad;
for (ad = hash_get_first (sp->fts_cycle.ht); ad != NULL;
ad = hash_get_next (sp->fts_cycle.ht, ad))
{
find_matching_ancestor (ent, ad);
}
}
}
static bool
same_fd (int fd1, int fd2)
{
struct stat sb1, sb2;
return (fstat (fd1, &sb1) == 0
&& fstat (fd2, &sb2) == 0
&& SAME_INODE (sb1, sb2));
}
static void
fd_ring_print (FTS const *sp, FILE *stream, char const *msg)
{
I_ring const *fd_ring = &sp->fts_fd_ring;
unsigned int i = fd_ring->fts_front;
char *cwd = getcwdat (sp->fts_cwd_fd, NULL, 0);
fprintf (stream, "=== %s ========== %s\n", msg, cwd);
free (cwd);
if (i_ring_empty (fd_ring))
return;
while (true)
{
int fd = fd_ring->fts_fd_ring[i];
if (fd < 0)
fprintf (stream, "%d: %d:\n", i, fd);
else
{
char *wd = getcwdat (fd, NULL, 0);
fprintf (stream, "%d: %d: %s\n", i, fd, wd);
free (wd);
}
if (i == fd_ring->fts_back)
break;
i = (i + I_RING_SIZE - 1) % I_RING_SIZE;
}
}
/* Ensure that each file descriptor on the fd_ring matches a
parent, grandparent, etc. of the current working directory. */
static void
fd_ring_check (FTS const *sp)
{
if (!fts_debug)
return;
/* Make a writable copy. */
I_ring fd_w = sp->fts_fd_ring;
int cwd_fd = sp->fts_cwd_fd;
cwd_fd = dup (cwd_fd);
char *dot = getcwdat (cwd_fd, NULL, 0);
error (0, 0, "===== check ===== cwd: %s", dot);
free (dot);
while ( ! i_ring_empty (&fd_w))
{
int fd = i_ring_pop (&fd_w);
if (0 <= fd)
{
int parent_fd = openat (cwd_fd, "..", O_SEARCH | O_NOATIME);
if (parent_fd < 0)
{
// Warn?
break;
}
if (!same_fd (fd, parent_fd))
{
char *cwd = getcwdat (fd, NULL, 0);
error (0, errno, "ring : %s", cwd);
char *c2 = getcwdat (parent_fd, NULL, 0);
error (0, errno, "parent: %s", c2);
free (cwd);
free (c2);
fts_assert (0);
}
close (cwd_fd);
cwd_fd = parent_fd;
}
}
close (cwd_fd);
}
#endif
static unsigned short int
internal_function
fts_stat(FTS *sp, register FTSENT *p, bool follow)
{
struct stat *sbp = p->fts_statp;
int saved_errno;
if (p->fts_level == FTS_ROOTLEVEL && ISSET(FTS_COMFOLLOW))
follow = true;
/*
* If doing a logical walk, or application requested FTS_FOLLOW, do
* a stat(2). If that fails, check for a non-existent symlink. If
* fail, set the errno from the stat call.
*/
if (ISSET(FTS_LOGICAL) || follow) {
if (stat(p->fts_accpath, sbp)) {
saved_errno = errno;
if (errno == ENOENT
&& lstat(p->fts_accpath, sbp) == 0) {
__set_errno (0);
return (FTS_SLNONE);
}
p->fts_errno = saved_errno;
goto err;
}
} else if (fstatat(sp->fts_cwd_fd, p->fts_accpath, sbp,
AT_SYMLINK_NOFOLLOW)) {
p->fts_errno = errno;
err: memset(sbp, 0, sizeof(struct stat));
return (FTS_NS);
}
if (S_ISDIR(sbp->st_mode)) {
p->fts_n_dirs_remaining = (sbp->st_nlink
- (ISSET(FTS_SEEDOT) ? 0 : 2));
if (ISDOT(p->fts_name)) {
/* Command-line "." and ".." are real directories. */
return (p->fts_level == FTS_ROOTLEVEL ? FTS_D : FTS_DOT);
}
return (FTS_D);
}
if (S_ISLNK(sbp->st_mode))
return (FTS_SL);
if (S_ISREG(sbp->st_mode))
return (FTS_F);
return (FTS_DEFAULT);
}
static int
fts_compar (void const *a, void const *b)
{
/* Convert A and B to the correct types, to pacify the compiler, and
for portability to bizarre hosts where "void const *" and "FTSENT
const **" differ in runtime representation. The comparison
function cannot modify *a and *b, but there is no compile-time
check for this. */
FTSENT const **pa = (FTSENT const **) a;
FTSENT const **pb = (FTSENT const **) b;
return pa[0]->fts_fts->fts_compar (pa, pb);
}
static FTSENT *
internal_function
fts_sort (FTS *sp, FTSENT *head, register size_t nitems)
{
register FTSENT **ap, *p;
/* On most modern hosts, void * and FTSENT ** have the same
run-time representation, and one can convert sp->fts_compar to
the type qsort expects without problem. Use the heuristic that
this is OK if the two pointer types are the same size, and if
converting FTSENT ** to long int is the same as converting
FTSENT ** to void * and then to long int. This heuristic isn't
valid in general but we don't know of any counterexamples. */
FTSENT *dummy;
int (*compare) (void const *, void const *) =
((sizeof &dummy == sizeof (void *)
&& (long int) &dummy == (long int) (void *) &dummy)
? (int (*) (void const *, void const *)) sp->fts_compar
: fts_compar);
/*
* Construct an array of pointers to the structures and call qsort(3).
* Reassemble the array in the order returned by qsort. If unable to
* sort for memory reasons, return the directory entries in their
* current order. Allocate enough space for the current needs plus
* 40 so don't realloc one entry at a time.
*/
if (nitems > sp->fts_nitems) {
FTSENT **a;
sp->fts_nitems = nitems + 40;
if (SIZE_MAX / sizeof *a < sp->fts_nitems
|| ! (a = realloc (sp->fts_array,
sp->fts_nitems * sizeof *a))) {
free(sp->fts_array);
sp->fts_array = NULL;
sp->fts_nitems = 0;
return (head);
}
sp->fts_array = a;
}
for (ap = sp->fts_array, p = head; p; p = p->fts_link)
*ap++ = p;
qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), compare);
for (head = *(ap = sp->fts_array); --nitems; ++ap)
ap[0]->fts_link = ap[1];
ap[0]->fts_link = NULL;
return (head);
}
static FTSENT *
internal_function
fts_alloc (FTS *sp, const char *name, register size_t namelen)
{
register FTSENT *p;
size_t len;
/*
* The file name is a variable length array. Allocate the FTSENT
* structure and the file name in one chunk.
*/
len = FLEXSIZEOF(FTSENT, fts_name, namelen + 1);
if ((p = malloc(len)) == NULL)
return (NULL);
/* Copy the name and guarantee NUL termination. */
memcpy(p->fts_name, name, namelen);
p->fts_name[namelen] = '\0';
p->fts_namelen = namelen;
p->fts_fts = sp;
p->fts_path = sp->fts_path;
p->fts_errno = 0;
p->fts_dirp = NULL;
p->fts_flags = 0;
p->fts_instr = FTS_NOINSTR;
p->fts_number = 0;
p->fts_pointer = NULL;
return (p);
}
static void
internal_function
fts_lfree (register FTSENT *head)
{
register FTSENT *p;
/* Free a linked list of structures. */
while ((p = head)) {
head = head->fts_link;
if (p->fts_dirp)
closedir (p->fts_dirp);
free(p);
}
}
/*
* Allow essentially unlimited file name lengths; find, rm, ls should
* all work on any tree. Most systems will allow creation of file
* names much longer than MAXPATHLEN, even though the kernel won't
* resolve them. Add the size (not just what's needed) plus 256 bytes
* so don't realloc the file name 2 bytes at a time.
*/
static bool
internal_function
fts_palloc (FTS *sp, size_t more)
{
char *p;
size_t new_len = sp->fts_pathlen + more + 256;
/*
* See if fts_pathlen would overflow.
*/
if (new_len < sp->fts_pathlen) {
free(sp->fts_path);
sp->fts_path = NULL;
__set_errno (ENAMETOOLONG);
return false;
}
sp->fts_pathlen = new_len;
p = realloc(sp->fts_path, sp->fts_pathlen);
if (p == NULL) {
free(sp->fts_path);
sp->fts_path = NULL;
return false;
}
sp->fts_path = p;
return true;
}
/*
* When the file name is realloc'd, have to fix all of the pointers in
* structures already returned.
*/
static void
internal_function
fts_padjust (FTS *sp, FTSENT *head)
{
FTSENT *p;
char *addr = sp->fts_path;
#define ADJUST(p) do { \
if ((p)->fts_accpath != (p)->fts_name) { \
(p)->fts_accpath = \
(char *)addr + ((p)->fts_accpath - (p)->fts_path); \
} \
(p)->fts_path = addr; \
} while (0)
/* Adjust the current set of children. */
for (p = sp->fts_child; p; p = p->fts_link)
ADJUST(p);
/* Adjust the rest of the tree, including the current level. */
for (p = head; p->fts_level >= FTS_ROOTLEVEL;) {
ADJUST(p);
p = p->fts_link ? p->fts_link : p->fts_parent;
}
}
static size_t
internal_function _GL_ATTRIBUTE_PURE
fts_maxarglen (char * const *argv)
{
size_t len, max;
for (max = 0; *argv; ++argv)
if ((len = strlen(*argv)) > max)
max = len;
return (max + 1);
}
/*
* Change to dir specified by fd or file name without getting
* tricked by someone changing the world out from underneath us.
* Assumes p->fts_statp->st_dev and p->fts_statp->st_ino are filled in.
* If FD is non-negative, expect it to be used after this function returns,
* and to be closed eventually. So don't pass e.g., 'dirfd(dirp)' and then
* do closedir(dirp), because that would invalidate the saved FD.
* Upon failure, close FD immediately and return nonzero.
*/
static int
internal_function
fts_safe_changedir (FTS *sp, FTSENT *p, int fd, char const *dir)
{
int ret;
bool is_dotdot = dir && STREQ (dir, "..");
int newfd;
/* This clause handles the unusual case in which FTS_NOCHDIR
is specified, along with FTS_CWDFD. In that case, there is
no need to change even the virtual cwd file descriptor.
However, if FD is non-negative, we do close it here. */
if (ISSET (FTS_NOCHDIR))
{
if (ISSET (FTS_CWDFD) && 0 <= fd)
close (fd);
return 0;
}
if (fd < 0 && is_dotdot && ISSET (FTS_CWDFD))
{
/* When possible, skip the diropen and subsequent fstat+dev/ino
comparison. I.e., when changing to parent directory
(chdir ("..")), use a file descriptor from the ring and
save the overhead of diropen+fstat, as well as avoiding
failure when we lack "x" access to the virtual cwd. */
if ( ! i_ring_empty (&sp->fts_fd_ring))
{
int parent_fd;
fd_ring_print (sp, stderr, "pre-pop");
parent_fd = i_ring_pop (&sp->fts_fd_ring);
is_dotdot = true;
if (0 <= parent_fd)
{
fd = parent_fd;
dir = NULL;
}
}
}
newfd = fd;
if (fd < 0 && (newfd = diropen (sp, dir)) < 0)
return -1;
/* The following dev/inode check is necessary if we're doing a
"logical" traversal (through symlinks, a la chown -L), if the
system lacks O_NOFOLLOW support, or if we're changing to ".."
(but not via a popped file descriptor). When changing to the
name "..", O_NOFOLLOW can't help. In general, when the target is
not "..", diropen's use of O_NOFOLLOW ensures we don't mistakenly
follow a symlink, so we can avoid the expense of this fstat. */
if (ISSET(FTS_LOGICAL) || ! HAVE_WORKING_O_NOFOLLOW
|| (dir && STREQ (dir, "..")))
{
struct stat sb;
if (fstat(newfd, &sb))
{
ret = -1;
goto bail;
}
if (p->fts_statp->st_dev != sb.st_dev
|| p->fts_statp->st_ino != sb.st_ino)
{
__set_errno (ENOENT); /* disinformation */
ret = -1;
goto bail;
}
}
if (ISSET(FTS_CWDFD))
{
cwd_advance_fd (sp, newfd, ! is_dotdot);
return 0;
}
ret = fchdir(newfd);
bail:
if (fd < 0)
{
int oerrno = errno;
(void)close(newfd);
__set_errno (oerrno);
}
return ret;
}
supermin-5.2.2/lib/getcwd-lgpl.c 0000664 0001750 0001750 00000006066 13057324244 013444 0000000 0000000 /* Copyright (C) 2011-2017 Free Software Foundation, Inc.
This file is part of gnulib.
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 3 of the License, 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, see . */
#include
/* Specification */
#include
#include
#include
#include
#if GNULIB_GETCWD
/* Favor GPL getcwd.c if both getcwd and getcwd-lgpl modules are in use. */
typedef int dummy;
#else
/* Get the name of the current working directory, and put it in SIZE
bytes of BUF. Returns NULL if the directory couldn't be determined
(perhaps because the absolute name was longer than PATH_MAX, or
because of missing read/search permissions on parent directories)
or SIZE was too small. If successful, returns BUF. If BUF is
NULL, an array is allocated with 'malloc'; the array is SIZE bytes
long, unless SIZE == 0, in which case it is as big as
necessary. */
# undef getcwd
char *
rpl_getcwd (char *buf, size_t size)
{
char *ptr;
char *result;
/* Handle single size operations. */
if (buf)
{
if (!size)
{
errno = EINVAL;
return NULL;
}
return getcwd (buf, size);
}
if (size)
{
buf = malloc (size);
if (!buf)
{
errno = ENOMEM;
return NULL;
}
result = getcwd (buf, size);
if (!result)
{
int saved_errno = errno;
free (buf);
errno = saved_errno;
}
return result;
}
/* Flexible sizing requested. Avoid over-allocation for the common
case of a name that fits within a 4k page, minus some space for
local variables, to be sure we don't skip over a guard page. */
{
char tmp[4032];
size = sizeof tmp;
ptr = getcwd (tmp, size);
if (ptr)
{
result = strdup (ptr);
if (!result)
errno = ENOMEM;
return result;
}
if (errno != ERANGE)
return NULL;
}
/* My what a large directory name we have. */
do
{
size <<= 1;
ptr = realloc (buf, size);
if (ptr == NULL)
{
free (buf);
errno = ENOMEM;
return NULL;
}
buf = ptr;
result = getcwd (buf, size);
}
while (!result && errno == ERANGE);
if (!result)
{
int saved_errno = errno;
free (buf);
errno = saved_errno;
}
else
{
/* Trim to fit, if possible. */
result = realloc (buf, strlen (buf) + 1);
if (!result)
result = buf;
}
return result;
}
#endif
supermin-5.2.2/lib/getdtablesize.c 0000664 0001750 0001750 00000006437 13057324244 014063 0000000 0000000 /* getdtablesize() function for platforms that don't have it.
Copyright (C) 2008-2017 Free Software Foundation, Inc.
Written by Bruno Haible , 2008.
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 3 of the License, 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, see . */
#include
/* Specification. */
#include
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
# include
# include "msvc-inval.h"
# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
static int
_setmaxstdio_nothrow (int newmax)
{
int result;
TRY_MSVC_INVAL
{
result = _setmaxstdio (newmax);
}
CATCH_MSVC_INVAL
{
result = -1;
}
DONE_MSVC_INVAL;
return result;
}
# define _setmaxstdio _setmaxstdio_nothrow
# endif
/* Cache for the previous getdtablesize () result. Safe to cache because
Windows also lacks setrlimit. */
static int dtablesize;
int
getdtablesize (void)
{
if (dtablesize == 0)
{
/* We are looking for the number N such that the valid file descriptors
are 0..N-1. It can be obtained through a loop as follows:
{
int fd;
for (fd = 3; fd < 65536; fd++)
if (dup2 (0, fd) == -1)
break;
return fd;
}
On Windows XP, the result is 2048.
The drawback of this loop is that it allocates memory for a libc
internal array that is never freed.
The number N can also be obtained as the upper bound for
_getmaxstdio (). _getmaxstdio () returns the maximum number of open
FILE objects. The sanity check in _setmaxstdio reveals the maximum
number of file descriptors. This too allocates memory, but it is
freed when we call _setmaxstdio with the original value. */
int orig_max_stdio = _getmaxstdio ();
unsigned int bound;
for (bound = 0x10000; _setmaxstdio (bound) < 0; bound = bound / 2)
;
_setmaxstdio (orig_max_stdio);
dtablesize = bound;
}
return dtablesize;
}
#else
# include
# include
# ifndef RLIM_SAVED_CUR
# define RLIM_SAVED_CUR RLIM_INFINITY
# endif
# ifndef RLIM_SAVED_MAX
# define RLIM_SAVED_MAX RLIM_INFINITY
# endif
# ifdef __CYGWIN__
/* Cygwin 1.7.25 auto-increases the RLIMIT_NOFILE soft limit until it
hits the compile-time constant hard limit of 3200. We might as
well just report the hard limit. */
# define rlim_cur rlim_max
# endif
int
getdtablesize (void)
{
struct rlimit lim;
if (getrlimit (RLIMIT_NOFILE, &lim) == 0
&& 0 <= lim.rlim_cur && lim.rlim_cur <= INT_MAX
&& lim.rlim_cur != RLIM_INFINITY
&& lim.rlim_cur != RLIM_SAVED_CUR
&& lim.rlim_cur != RLIM_SAVED_MAX)
return lim.rlim_cur;
return INT_MAX;
}
#endif
supermin-5.2.2/lib/gettimeofday.c 0000664 0001750 0001750 00000007751 13057324244 013716 0000000 0000000 /* Provide gettimeofday for systems that don't have it or for which it's broken.
Copyright (C) 2001-2003, 2005-2007, 2009-2017 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 3, 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, see