Blame gl/stdlib.in.h

Packit aea12f
/* A GNU-like <stdlib.h>.
Packit aea12f
Packit Service 991b93
   Copyright (C) 1995, 2001-2004, 2006-2020 Free Software Foundation, Inc.
Packit aea12f
Packit aea12f
   This program is free software: you can redistribute it and/or modify
Packit Service 991b93
   it under the terms of the GNU Lesser General Public License as published by
Packit Service 991b93
   the Free Software Foundation; either version 2.1 of the License, or
Packit aea12f
   (at your option) any later version.
Packit aea12f
Packit aea12f
   This program is distributed in the hope that it will be useful,
Packit aea12f
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit aea12f
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 991b93
   GNU Lesser General Public License for more details.
Packit aea12f
Packit Service 991b93
   You should have received a copy of the GNU Lesser General Public License
Packit aea12f
   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
Packit aea12f
Packit aea12f
#if __GNUC__ >= 3
Packit aea12f
@PRAGMA_SYSTEM_HEADER@
Packit aea12f
#endif
Packit aea12f
@PRAGMA_COLUMNS@
Packit aea12f
Packit aea12f
#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
Packit aea12f
/* Special invocation conventions inside some gnulib header files,
Packit aea12f
   and inside some glibc header files, respectively.  */
Packit aea12f
Packit aea12f
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
Packit aea12f
Packit aea12f
#else
Packit aea12f
/* Normal invocation convention.  */
Packit aea12f
Packit aea12f
#ifndef _@GUARD_PREFIX@_STDLIB_H
Packit aea12f
Packit aea12f
/* The include_next requires a split double-inclusion guard.  */
Packit aea12f
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
Packit aea12f
Packit aea12f
#ifndef _@GUARD_PREFIX@_STDLIB_H
Packit aea12f
#define _@GUARD_PREFIX@_STDLIB_H
Packit aea12f
Packit aea12f
/* NetBSD 5.0 mis-defines NULL.  */
Packit aea12f
#include <stddef.h>
Packit aea12f
Packit aea12f
/* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>.  */
Packit aea12f
#if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
Packit aea12f
# include <sys/wait.h>
Packit aea12f
#endif
Packit aea12f
Packit aea12f
/* Solaris declares getloadavg() in <sys/loadavg.h>.  */
Packit aea12f
#if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
Packit aea12f
/* OpenIndiana has a bug: <sys/time.h> must be included before
Packit aea12f
   <sys/loadavg.h>.  */
Packit aea12f
# include <sys/time.h>
Packit aea12f
# include <sys/loadavg.h>
Packit aea12f
#endif
Packit aea12f
Packit aea12f
/* Native Windows platforms declare mktemp() in <io.h>.  */
Packit aea12f
#if 0 && (defined _WIN32 && ! defined __CYGWIN__)
Packit aea12f
# include <io.h>
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_RANDOM_R@
Packit aea12f
Packit aea12f
/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
Packit aea12f
   from <stdlib.h> if _REENTRANT is defined.  Include it whenever we need
Packit aea12f
   'struct random_data'.  */
Packit aea12f
# if @HAVE_RANDOM_H@
Packit aea12f
#  include <random.h>
Packit aea12f
# endif
Packit aea12f
Packit aea12f
# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
Packit aea12f
#  include <stdint.h>
Packit aea12f
# endif
Packit aea12f
Packit aea12f
# if !@HAVE_STRUCT_RANDOM_DATA@
Packit aea12f
/* Define 'struct random_data'.
Packit aea12f
   But allow multiple gnulib generated <stdlib.h> replacements to coexist.  */
Packit aea12f
#  if !GNULIB_defined_struct_random_data
Packit aea12f
struct random_data
Packit aea12f
{
Packit aea12f
  int32_t *fptr;                /* Front pointer.  */
Packit aea12f
  int32_t *rptr;                /* Rear pointer.  */
Packit aea12f
  int32_t *state;               /* Array of state values.  */
Packit aea12f
  int rand_type;                /* Type of random number generator.  */
Packit aea12f
  int rand_deg;                 /* Degree of random number generator.  */
Packit aea12f
  int rand_sep;                 /* Distance between front and rear.  */
Packit aea12f
  int32_t *end_ptr;             /* Pointer behind state table.  */
Packit aea12f
};
Packit aea12f
#   define GNULIB_defined_struct_random_data 1
Packit aea12f
#  endif
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
Packit aea12f
/* On Mac OS X 10.3, only <unistd.h> declares mkstemp.  */
Packit aea12f
/* On Mac OS X 10.5, only <unistd.h> declares mkstemps.  */
Packit aea12f
/* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps.  */
Packit aea12f
/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
Packit aea12f
/* But avoid namespace pollution on glibc systems and native Windows.  */
Packit aea12f
# include <unistd.h>
Packit aea12f
#endif
Packit aea12f
Packit aea12f
/* The __attribute__ feature is available in gcc versions 2.5 and later.
Packit aea12f
   The attribute __pure__ was added in gcc 2.96.  */
Packit Service 991b93
#ifndef _GL_ATTRIBUTE_PURE
Packit Service 991b93
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
Packit Service 991b93
#  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
Packit Service 991b93
# else
Packit Service 991b93
#  define _GL_ATTRIBUTE_PURE /* empty */
Packit Service 991b93
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
/* The definition of _Noreturn is copied here.  */
Packit aea12f
Packit aea12f
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
Packit aea12f
Packit aea12f
/* The definition of _GL_ARG_NONNULL is copied here.  */
Packit aea12f
Packit aea12f
/* The definition of _GL_WARN_ON_USE is copied here.  */
Packit aea12f
Packit aea12f
Packit aea12f
/* Some systems do not define EXIT_*, despite otherwise supporting C89.  */
Packit aea12f
#ifndef EXIT_SUCCESS
Packit aea12f
# define EXIT_SUCCESS 0
Packit aea12f
#endif
Packit aea12f
/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
Packit aea12f
   with proper operation of xargs.  */
Packit aea12f
#ifndef EXIT_FAILURE
Packit aea12f
# define EXIT_FAILURE 1
Packit aea12f
#elif EXIT_FAILURE != 1
Packit aea12f
# undef EXIT_FAILURE
Packit aea12f
# define EXIT_FAILURE 1
Packit aea12f
#endif
Packit aea12f
Packit aea12f
Packit aea12f
#if @GNULIB__EXIT@
Packit aea12f
/* Terminate the current process with the given return code, without running
Packit aea12f
   the 'atexit' handlers.  */
Packit aea12f
# if !@HAVE__EXIT@
Packit aea12f
_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (_Exit, void, (int status));
Packit aea12f
_GL_CXXALIASWARN (_Exit);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef _Exit
Packit aea12f
# if HAVE_RAW_DECL__EXIT
Packit aea12f
_GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
Packit aea12f
                 "use gnulib module _Exit for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
Packit aea12f
#if @GNULIB_ATOLL@
Packit aea12f
/* Parse a signed decimal integer.
Packit aea12f
   Returns the value of the integer.  Errors are not detected.  */
Packit aea12f
# if !@HAVE_ATOLL@
Packit aea12f
_GL_FUNCDECL_SYS (atoll, long long, (const char *string)
Packit aea12f
                                    _GL_ATTRIBUTE_PURE
Packit aea12f
                                    _GL_ARG_NONNULL ((1)));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
Packit aea12f
_GL_CXXALIASWARN (atoll);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef atoll
Packit aea12f
# if HAVE_RAW_DECL_ATOLL
Packit aea12f
_GL_WARN_ON_USE (atoll, "atoll is unportable - "
Packit aea12f
                 "use gnulib module atoll for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_CALLOC_POSIX@
Packit aea12f
# if @REPLACE_CALLOC@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef calloc
Packit aea12f
#   define calloc rpl_calloc
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size));
Packit aea12f
_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
Packit aea12f
# else
Packit aea12f
_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
Packit aea12f
# endif
Packit Service 991b93
# if __GLIBC__ >= 2
Packit aea12f
_GL_CXXALIASWARN (calloc);
Packit Service 991b93
# endif
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef calloc
Packit aea12f
/* Assume calloc is always declared.  */
Packit aea12f
_GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
Packit aea12f
                 "use gnulib module calloc-posix for portability");
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_CANONICALIZE_FILE_NAME@
Packit aea12f
# if @REPLACE_CANONICALIZE_FILE_NAME@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   define canonicalize_file_name rpl_canonicalize_file_name
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
Packit aea12f
                                                  _GL_ARG_NONNULL ((1)));
Packit aea12f
_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_CANONICALIZE_FILE_NAME@
Packit aea12f
_GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
Packit aea12f
                                                  _GL_ARG_NONNULL ((1)));
Packit aea12f
#  endif
Packit aea12f
_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
Packit aea12f
# endif
Packit Service 991b93
# ifndef GNULIB_defined_canonicalize_file_name
Packit Service 991b93
#  define GNULIB_defined_canonicalize_file_name \
Packit Service 991b93
     (!@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@)
Packit Service 991b93
# endif
Packit aea12f
_GL_CXXALIASWARN (canonicalize_file_name);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef canonicalize_file_name
Packit aea12f
# if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
Packit aea12f
_GL_WARN_ON_USE (canonicalize_file_name,
Packit aea12f
                 "canonicalize_file_name is unportable - "
Packit aea12f
                 "use gnulib module canonicalize-lgpl for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_GETLOADAVG@
Packit aea12f
/* Store max(NELEM,3) load average numbers in LOADAVG[].
Packit aea12f
   The three numbers are the load average of the last 1 minute, the last 5
Packit aea12f
   minutes, and the last 15 minutes, respectively.
Packit aea12f
   LOADAVG is an array of NELEM numbers.  */
Packit aea12f
# if !@HAVE_DECL_GETLOADAVG@
Packit aea12f
_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
Packit aea12f
                                   _GL_ARG_NONNULL ((1)));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
Packit aea12f
_GL_CXXALIASWARN (getloadavg);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef getloadavg
Packit aea12f
# if HAVE_RAW_DECL_GETLOADAVG
Packit aea12f
_GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
Packit aea12f
                 "use gnulib module getloadavg for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_GETSUBOPT@
Packit aea12f
/* Assuming *OPTIONP is a comma separated list of elements of the form
Packit aea12f
   "token" or "token=value", getsubopt parses the first of these elements.
Packit aea12f
   If the first element refers to a "token" that is member of the given
Packit aea12f
   NULL-terminated array of tokens:
Packit aea12f
     - It replaces the comma with a NUL byte, updates *OPTIONP to point past
Packit aea12f
       the first option and the comma, sets *VALUEP to the value of the
Packit aea12f
       element (or NULL if it doesn't contain an "=" sign),
Packit aea12f
     - It returns the index of the "token" in the given array of tokens.
Packit aea12f
   Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
Packit Service 991b93
   For more details see the POSIX specification.
Packit Service 991b93
   https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */
Packit aea12f
# if !@HAVE_GETSUBOPT@
Packit aea12f
_GL_FUNCDECL_SYS (getsubopt, int,
Packit aea12f
                  (char **optionp, char *const *tokens, char **valuep)
Packit aea12f
                  _GL_ARG_NONNULL ((1, 2, 3)));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (getsubopt, int,
Packit aea12f
                  (char **optionp, char *const *tokens, char **valuep));
Packit aea12f
_GL_CXXALIASWARN (getsubopt);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef getsubopt
Packit aea12f
# if HAVE_RAW_DECL_GETSUBOPT
Packit aea12f
_GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
Packit aea12f
                 "use gnulib module getsubopt for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_GRANTPT@
Packit aea12f
/* Change the ownership and access permission of the slave side of the
Packit aea12f
   pseudo-terminal whose master side is specified by FD.  */
Packit aea12f
# if !@HAVE_GRANTPT@
Packit aea12f
_GL_FUNCDECL_SYS (grantpt, int, (int fd));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (grantpt, int, (int fd));
Packit aea12f
_GL_CXXALIASWARN (grantpt);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef grantpt
Packit aea12f
# if HAVE_RAW_DECL_GRANTPT
Packit aea12f
_GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
Packit aea12f
                 "use gnulib module grantpt for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
/* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
Packit aea12f
   rely on GNU or POSIX semantics for malloc and realloc (for example,
Packit aea12f
   by never specifying a zero size), so it does not need malloc or
Packit aea12f
   realloc to be redefined.  */
Packit aea12f
#if @GNULIB_MALLOC_POSIX@
Packit aea12f
# if @REPLACE_MALLOC@
Packit aea12f
#  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
Packit aea12f
        || _GL_USE_STDLIB_ALLOC)
Packit aea12f
#   undef malloc
Packit aea12f
#   define malloc rpl_malloc
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (malloc, void *, (size_t size));
Packit aea12f
_GL_CXXALIAS_RPL (malloc, void *, (size_t size));
Packit aea12f
# else
Packit aea12f
_GL_CXXALIAS_SYS (malloc, void *, (size_t size));
Packit aea12f
# endif
Packit Service 991b93
# if __GLIBC__ >= 2
Packit aea12f
_GL_CXXALIASWARN (malloc);
Packit Service 991b93
# endif
Packit aea12f
#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
Packit aea12f
# undef malloc
Packit aea12f
/* Assume malloc is always declared.  */
Packit aea12f
_GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
Packit aea12f
                 "use gnulib module malloc-posix for portability");
Packit aea12f
#endif
Packit aea12f
Packit aea12f
/* Convert a multibyte character to a wide character.  */
Packit aea12f
#if @GNULIB_MBTOWC@
Packit aea12f
# if @REPLACE_MBTOWC@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef mbtowc
Packit aea12f
#   define mbtowc rpl_mbtowc
Packit aea12f
#  endif
Packit Service 991b93
_GL_FUNCDECL_RPL (mbtowc, int,
Packit Service 991b93
                  (wchar_t *restrict pwc, const char *restrict s, size_t n));
Packit Service 991b93
_GL_CXXALIAS_RPL (mbtowc, int,
Packit Service 991b93
                  (wchar_t *restrict pwc, const char *restrict s, size_t n));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_MBTOWC@
Packit Service 991b93
_GL_FUNCDECL_SYS (mbtowc, int,
Packit Service 991b93
                  (wchar_t *restrict pwc, const char *restrict s, size_t n));
Packit aea12f
#  endif
Packit Service 991b93
_GL_CXXALIAS_SYS (mbtowc, int,
Packit Service 991b93
                  (wchar_t *restrict pwc, const char *restrict s, size_t n));
Packit aea12f
# endif
Packit Service 991b93
# if __GLIBC__ >= 2
Packit aea12f
_GL_CXXALIASWARN (mbtowc);
Packit Service 991b93
# endif
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef mbtowc
Packit aea12f
# if HAVE_RAW_DECL_MBTOWC
Packit aea12f
_GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
Packit aea12f
                 "use gnulib module mbtowc for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_MKDTEMP@
Packit aea12f
/* Create a unique temporary directory from TEMPLATE.
Packit aea12f
   The last six characters of TEMPLATE must be "XXXXXX";
Packit aea12f
   they are replaced with a string that makes the directory name unique.
Packit aea12f
   Returns TEMPLATE, or a null pointer if it cannot get a unique name.
Packit aea12f
   The directory is created mode 700.  */
Packit aea12f
# if !@HAVE_MKDTEMP@
Packit aea12f
_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
Packit aea12f
_GL_CXXALIASWARN (mkdtemp);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef mkdtemp
Packit aea12f
# if HAVE_RAW_DECL_MKDTEMP
Packit aea12f
_GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
Packit aea12f
                 "use gnulib module mkdtemp for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_MKOSTEMP@
Packit aea12f
/* Create a unique temporary file from TEMPLATE.
Packit aea12f
   The last six characters of TEMPLATE must be "XXXXXX";
Packit aea12f
   they are replaced with a string that makes the file name unique.
Packit aea12f
   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
Packit aea12f
   and O_TEXT, O_BINARY (defined in "binary-io.h").
Packit aea12f
   The file is then created, with the specified flags, ensuring it didn't exist
Packit aea12f
   before.
Packit aea12f
   The file is created read-write (mask at least 0600 & ~umask), but it may be
Packit aea12f
   world-readable and world-writable (mask 0666 & ~umask), depending on the
Packit aea12f
   implementation.
Packit aea12f
   Returns the open file descriptor if successful, otherwise -1 and errno
Packit aea12f
   set.  */
Packit aea12f
# if !@HAVE_MKOSTEMP@
Packit aea12f
_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
Packit aea12f
                                 _GL_ARG_NONNULL ((1)));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
Packit aea12f
_GL_CXXALIASWARN (mkostemp);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef mkostemp
Packit aea12f
# if HAVE_RAW_DECL_MKOSTEMP
Packit aea12f
_GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
Packit aea12f
                 "use gnulib module mkostemp for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_MKOSTEMPS@
Packit aea12f
/* Create a unique temporary file from TEMPLATE.
Packit aea12f
   The last six characters of TEMPLATE before a suffix of length
Packit aea12f
   SUFFIXLEN must be "XXXXXX";
Packit aea12f
   they are replaced with a string that makes the file name unique.
Packit aea12f
   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
Packit aea12f
   and O_TEXT, O_BINARY (defined in "binary-io.h").
Packit aea12f
   The file is then created, with the specified flags, ensuring it didn't exist
Packit aea12f
   before.
Packit aea12f
   The file is created read-write (mask at least 0600 & ~umask), but it may be
Packit aea12f
   world-readable and world-writable (mask 0666 & ~umask), depending on the
Packit aea12f
   implementation.
Packit aea12f
   Returns the open file descriptor if successful, otherwise -1 and errno
Packit aea12f
   set.  */
Packit aea12f
# if !@HAVE_MKOSTEMPS@
Packit aea12f
_GL_FUNCDECL_SYS (mkostemps, int,
Packit aea12f
                  (char * /*template*/, int /*suffixlen*/, int /*flags*/)
Packit aea12f
                  _GL_ARG_NONNULL ((1)));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (mkostemps, int,
Packit aea12f
                  (char * /*template*/, int /*suffixlen*/, int /*flags*/));
Packit aea12f
_GL_CXXALIASWARN (mkostemps);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef mkostemps
Packit aea12f
# if HAVE_RAW_DECL_MKOSTEMPS
Packit aea12f
_GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
Packit aea12f
                 "use gnulib module mkostemps for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_MKSTEMP@
Packit aea12f
/* Create a unique temporary file from TEMPLATE.
Packit aea12f
   The last six characters of TEMPLATE must be "XXXXXX";
Packit aea12f
   they are replaced with a string that makes the file name unique.
Packit aea12f
   The file is then created, ensuring it didn't exist before.
Packit aea12f
   The file is created read-write (mask at least 0600 & ~umask), but it may be
Packit aea12f
   world-readable and world-writable (mask 0666 & ~umask), depending on the
Packit aea12f
   implementation.
Packit aea12f
   Returns the open file descriptor if successful, otherwise -1 and errno
Packit aea12f
   set.  */
Packit aea12f
# if @REPLACE_MKSTEMP@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   define mkstemp rpl_mkstemp
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
Packit aea12f
_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
Packit aea12f
# else
Packit aea12f
#  if ! @HAVE_MKSTEMP@
Packit aea12f
_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
Packit aea12f
#  endif
Packit aea12f
_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (mkstemp);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef mkstemp
Packit aea12f
# if HAVE_RAW_DECL_MKSTEMP
Packit aea12f
_GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
Packit aea12f
                 "use gnulib module mkstemp for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_MKSTEMPS@
Packit aea12f
/* Create a unique temporary file from TEMPLATE.
Packit aea12f
   The last six characters of TEMPLATE prior to a suffix of length
Packit aea12f
   SUFFIXLEN must be "XXXXXX";
Packit aea12f
   they are replaced with a string that makes the file name unique.
Packit aea12f
   The file is then created, ensuring it didn't exist before.
Packit aea12f
   The file is created read-write (mask at least 0600 & ~umask), but it may be
Packit aea12f
   world-readable and world-writable (mask 0666 & ~umask), depending on the
Packit aea12f
   implementation.
Packit aea12f
   Returns the open file descriptor if successful, otherwise -1 and errno
Packit aea12f
   set.  */
Packit aea12f
# if !@HAVE_MKSTEMPS@
Packit aea12f
_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
Packit aea12f
                                 _GL_ARG_NONNULL ((1)));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
Packit aea12f
_GL_CXXALIASWARN (mkstemps);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef mkstemps
Packit aea12f
# if HAVE_RAW_DECL_MKSTEMPS
Packit aea12f
_GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
Packit aea12f
                 "use gnulib module mkstemps for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_POSIX_OPENPT@
Packit aea12f
/* Return an FD open to the master side of a pseudo-terminal.  Flags should
Packit aea12f
   include O_RDWR, and may also include O_NOCTTY.  */
Packit aea12f
# if !@HAVE_POSIX_OPENPT@
Packit aea12f
_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
Packit aea12f
_GL_CXXALIASWARN (posix_openpt);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef posix_openpt
Packit aea12f
# if HAVE_RAW_DECL_POSIX_OPENPT
Packit aea12f
_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
Packit aea12f
                 "use gnulib module posix_openpt for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_PTSNAME@
Packit aea12f
/* Return the pathname of the pseudo-terminal slave associated with
Packit aea12f
   the master FD is open on, or NULL on errors.  */
Packit aea12f
# if @REPLACE_PTSNAME@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef ptsname
Packit aea12f
#   define ptsname rpl_ptsname
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (ptsname, char *, (int fd));
Packit aea12f
_GL_CXXALIAS_RPL (ptsname, char *, (int fd));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_PTSNAME@
Packit aea12f
_GL_FUNCDECL_SYS (ptsname, char *, (int fd));
Packit aea12f
#  endif
Packit aea12f
_GL_CXXALIAS_SYS (ptsname, char *, (int fd));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (ptsname);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef ptsname
Packit aea12f
# if HAVE_RAW_DECL_PTSNAME
Packit aea12f
_GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
Packit aea12f
                 "use gnulib module ptsname for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_PTSNAME_R@
Packit aea12f
/* Set the pathname of the pseudo-terminal slave associated with
Packit aea12f
   the master FD is open on and return 0, or set errno and return
Packit aea12f
   non-zero on errors.  */
Packit aea12f
# if @REPLACE_PTSNAME_R@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef ptsname_r
Packit aea12f
#   define ptsname_r rpl_ptsname_r
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
Packit aea12f
_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_PTSNAME_R@
Packit aea12f
_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
Packit aea12f
#  endif
Packit aea12f
_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
Packit aea12f
# endif
Packit Service 991b93
# ifndef GNULIB_defined_ptsname_r
Packit Service 991b93
#  define GNULIB_defined_ptsname_r (!@HAVE_PTSNAME_R@ || @REPLACE_PTSNAME_R@)
Packit Service 991b93
# endif
Packit aea12f
_GL_CXXALIASWARN (ptsname_r);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef ptsname_r
Packit aea12f
# if HAVE_RAW_DECL_PTSNAME_R
Packit aea12f
_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
Packit aea12f
                 "use gnulib module ptsname_r for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_PUTENV@
Packit aea12f
# if @REPLACE_PUTENV@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef putenv
Packit aea12f
#   define putenv rpl_putenv
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
Packit aea12f
_GL_CXXALIAS_RPL (putenv, int, (char *string));
Packit aea12f
# else
Packit aea12f
_GL_CXXALIAS_SYS (putenv, int, (char *string));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (putenv);
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_QSORT_R@
Packit aea12f
/* Sort an array of NMEMB elements, starting at address BASE, each element
Packit aea12f
   occupying SIZE bytes, in ascending order according to the comparison
Packit aea12f
   function COMPARE.  */
Packit aea12f
# if @REPLACE_QSORT_R@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef qsort_r
Packit aea12f
#   define qsort_r rpl_qsort_r
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
Packit aea12f
                                  int (*compare) (void const *, void const *,
Packit aea12f
                                                  void *),
Packit aea12f
                                  void *arg) _GL_ARG_NONNULL ((1, 4)));
Packit aea12f
_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
Packit aea12f
                                  int (*compare) (void const *, void const *,
Packit aea12f
                                                  void *),
Packit aea12f
                                  void *arg));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_QSORT_R@
Packit aea12f
_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
Packit aea12f
                                  int (*compare) (void const *, void const *,
Packit aea12f
                                                  void *),
Packit aea12f
                                  void *arg) _GL_ARG_NONNULL ((1, 4)));
Packit aea12f
#  endif
Packit aea12f
_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
Packit aea12f
                                  int (*compare) (void const *, void const *,
Packit aea12f
                                                  void *),
Packit aea12f
                                  void *arg));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (qsort_r);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef qsort_r
Packit aea12f
# if HAVE_RAW_DECL_QSORT_R
Packit aea12f
_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
Packit aea12f
                 "use gnulib module qsort_r for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
Packit aea12f
#if @GNULIB_RANDOM_R@
Packit aea12f
# if !@HAVE_RANDOM_R@
Packit aea12f
#  ifndef RAND_MAX
Packit aea12f
#   define RAND_MAX 2147483647
Packit aea12f
#  endif
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
Packit aea12f
#if @GNULIB_RANDOM@
Packit aea12f
# if @REPLACE_RANDOM@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef random
Packit aea12f
#   define random rpl_random
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (random, long, (void));
Packit aea12f
_GL_CXXALIAS_RPL (random, long, (void));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_RANDOM@
Packit aea12f
_GL_FUNCDECL_SYS (random, long, (void));
Packit aea12f
#  endif
Packit Service 991b93
/* Need to cast, because on Haiku, the return type is
Packit Service 991b93
                               int.  */
Packit Service 991b93
_GL_CXXALIAS_SYS_CAST (random, long, (void));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (random);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef random
Packit aea12f
# if HAVE_RAW_DECL_RANDOM
Packit aea12f
_GL_WARN_ON_USE (random, "random is unportable - "
Packit aea12f
                 "use gnulib module random for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_RANDOM@
Packit aea12f
# if @REPLACE_RANDOM@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef srandom
Packit aea12f
#   define srandom rpl_srandom
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed));
Packit aea12f
_GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_RANDOM@
Packit aea12f
_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
Packit aea12f
#  endif
Packit Service 991b93
/* Need to cast, because on FreeBSD, the first parameter is
Packit Service 991b93
                                       unsigned long seed.  */
Packit Service 991b93
_GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (srandom);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef srandom
Packit aea12f
# if HAVE_RAW_DECL_SRANDOM
Packit aea12f
_GL_WARN_ON_USE (srandom, "srandom is unportable - "
Packit aea12f
                 "use gnulib module random for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_RANDOM@
Packit aea12f
# if @REPLACE_INITSTATE@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef initstate
Packit aea12f
#   define initstate rpl_initstate
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (initstate, char *,
Packit aea12f
                  (unsigned int seed, char *buf, size_t buf_size)
Packit aea12f
                  _GL_ARG_NONNULL ((2)));
Packit aea12f
_GL_CXXALIAS_RPL (initstate, char *,
Packit aea12f
                  (unsigned int seed, char *buf, size_t buf_size));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
Packit aea12f
_GL_FUNCDECL_SYS (initstate, char *,
Packit aea12f
                  (unsigned int seed, char *buf, size_t buf_size)
Packit aea12f
                  _GL_ARG_NONNULL ((2)));
Packit aea12f
#  endif
Packit Service 991b93
/* Need to cast, because on FreeBSD, the first parameter is
Packit Service 991b93
                        unsigned long seed.  */
Packit Service 991b93
_GL_CXXALIAS_SYS_CAST (initstate, char *,
Packit Service 991b93
                       (unsigned int seed, char *buf, size_t buf_size));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (initstate);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef initstate
Packit aea12f
# if HAVE_RAW_DECL_INITSTATE
Packit aea12f
_GL_WARN_ON_USE (initstate, "initstate is unportable - "
Packit aea12f
                 "use gnulib module random for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_RANDOM@
Packit aea12f
# if @REPLACE_SETSTATE@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef setstate
Packit aea12f
#   define setstate rpl_setstate
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
Packit aea12f
_GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
Packit aea12f
_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
Packit aea12f
#  endif
Packit Service 991b93
/* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
Packit Service 991b93
   is                                     const char *arg_state.  */
Packit Service 991b93
_GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (setstate);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef setstate
Packit aea12f
# if HAVE_RAW_DECL_SETSTATE
Packit aea12f
_GL_WARN_ON_USE (setstate, "setstate is unportable - "
Packit aea12f
                 "use gnulib module random for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
Packit aea12f
#if @GNULIB_RANDOM_R@
Packit aea12f
# if @REPLACE_RANDOM_R@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef random_r
Packit aea12f
#   define random_r rpl_random_r
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
Packit aea12f
                                 _GL_ARG_NONNULL ((1, 2)));
Packit aea12f
_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_RANDOM_R@
Packit aea12f
_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
Packit aea12f
                                 _GL_ARG_NONNULL ((1, 2)));
Packit aea12f
#  endif
Packit aea12f
_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (random_r);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef random_r
Packit aea12f
# if HAVE_RAW_DECL_RANDOM_R
Packit aea12f
_GL_WARN_ON_USE (random_r, "random_r is unportable - "
Packit aea12f
                 "use gnulib module random_r for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_RANDOM_R@
Packit aea12f
# if @REPLACE_RANDOM_R@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef srandom_r
Packit aea12f
#   define srandom_r rpl_srandom_r
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (srandom_r, int,
Packit aea12f
                  (unsigned int seed, struct random_data *rand_state)
Packit aea12f
                  _GL_ARG_NONNULL ((2)));
Packit aea12f
_GL_CXXALIAS_RPL (srandom_r, int,
Packit aea12f
                  (unsigned int seed, struct random_data *rand_state));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_RANDOM_R@
Packit aea12f
_GL_FUNCDECL_SYS (srandom_r, int,
Packit aea12f
                  (unsigned int seed, struct random_data *rand_state)
Packit aea12f
                  _GL_ARG_NONNULL ((2)));
Packit aea12f
#  endif
Packit aea12f
_GL_CXXALIAS_SYS (srandom_r, int,
Packit aea12f
                  (unsigned int seed, struct random_data *rand_state));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (srandom_r);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef srandom_r
Packit aea12f
# if HAVE_RAW_DECL_SRANDOM_R
Packit aea12f
_GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
Packit aea12f
                 "use gnulib module random_r for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_RANDOM_R@
Packit aea12f
# if @REPLACE_RANDOM_R@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef initstate_r
Packit aea12f
#   define initstate_r rpl_initstate_r
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (initstate_r, int,
Packit aea12f
                  (unsigned int seed, char *buf, size_t buf_size,
Packit aea12f
                   struct random_data *rand_state)
Packit aea12f
                  _GL_ARG_NONNULL ((2, 4)));
Packit aea12f
_GL_CXXALIAS_RPL (initstate_r, int,
Packit aea12f
                  (unsigned int seed, char *buf, size_t buf_size,
Packit aea12f
                   struct random_data *rand_state));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_RANDOM_R@
Packit aea12f
_GL_FUNCDECL_SYS (initstate_r, int,
Packit aea12f
                  (unsigned int seed, char *buf, size_t buf_size,
Packit aea12f
                   struct random_data *rand_state)
Packit aea12f
                  _GL_ARG_NONNULL ((2, 4)));
Packit aea12f
#  endif
Packit Service 991b93
/* Need to cast, because on Haiku, the third parameter is
Packit Service 991b93
                                                     unsigned long buf_size.  */
Packit Service 991b93
_GL_CXXALIAS_SYS_CAST (initstate_r, int,
Packit Service 991b93
                       (unsigned int seed, char *buf, size_t buf_size,
Packit Service 991b93
                        struct random_data *rand_state));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (initstate_r);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef initstate_r
Packit aea12f
# if HAVE_RAW_DECL_INITSTATE_R
Packit aea12f
_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
Packit aea12f
                 "use gnulib module random_r for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_RANDOM_R@
Packit aea12f
# if @REPLACE_RANDOM_R@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef setstate_r
Packit aea12f
#   define setstate_r rpl_setstate_r
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (setstate_r, int,
Packit aea12f
                  (char *arg_state, struct random_data *rand_state)
Packit aea12f
                  _GL_ARG_NONNULL ((1, 2)));
Packit aea12f
_GL_CXXALIAS_RPL (setstate_r, int,
Packit aea12f
                  (char *arg_state, struct random_data *rand_state));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_RANDOM_R@
Packit aea12f
_GL_FUNCDECL_SYS (setstate_r, int,
Packit aea12f
                  (char *arg_state, struct random_data *rand_state)
Packit aea12f
                  _GL_ARG_NONNULL ((1, 2)));
Packit aea12f
#  endif
Packit Service 991b93
/* Need to cast, because on Haiku, the first parameter is
Packit Service 991b93
                        void *arg_state.  */
Packit Service 991b93
_GL_CXXALIAS_SYS_CAST (setstate_r, int,
Packit Service 991b93
                       (char *arg_state, struct random_data *rand_state));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (setstate_r);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef setstate_r
Packit aea12f
# if HAVE_RAW_DECL_SETSTATE_R
Packit aea12f
_GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
Packit aea12f
                 "use gnulib module random_r for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
Packit aea12f
#if @GNULIB_REALLOC_POSIX@
Packit aea12f
# if @REPLACE_REALLOC@
Packit aea12f
#  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
Packit aea12f
        || _GL_USE_STDLIB_ALLOC)
Packit aea12f
#   undef realloc
Packit aea12f
#   define realloc rpl_realloc
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size));
Packit aea12f
_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
Packit aea12f
# else
Packit aea12f
_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
Packit aea12f
# endif
Packit Service 991b93
# if __GLIBC__ >= 2
Packit aea12f
_GL_CXXALIASWARN (realloc);
Packit Service 991b93
# endif
Packit aea12f
#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
Packit aea12f
# undef realloc
Packit aea12f
/* Assume realloc is always declared.  */
Packit aea12f
_GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
Packit aea12f
                 "use gnulib module realloc-posix for portability");
Packit aea12f
#endif
Packit aea12f
Packit aea12f
Packit aea12f
#if @GNULIB_REALLOCARRAY@
Packit aea12f
# if ! @HAVE_REALLOCARRAY@
Packit aea12f
_GL_FUNCDECL_SYS (reallocarray, void *,
Packit aea12f
                  (void *ptr, size_t nmemb, size_t size));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (reallocarray, void *,
Packit aea12f
                  (void *ptr, size_t nmemb, size_t size));
Packit aea12f
_GL_CXXALIASWARN (reallocarray);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef reallocarray
Packit aea12f
# if HAVE_RAW_DECL_REALLOCARRAY
Packit aea12f
_GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
Packit aea12f
                 "use gnulib module reallocarray for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_REALPATH@
Packit aea12f
# if @REPLACE_REALPATH@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   define realpath rpl_realpath
Packit aea12f
#  endif
Packit Service 991b93
_GL_FUNCDECL_RPL (realpath, char *,
Packit Service 991b93
                  (const char *restrict name, char *restrict resolved)
Packit Service 991b93
                  _GL_ARG_NONNULL ((1)));
Packit Service 991b93
_GL_CXXALIAS_RPL (realpath, char *,
Packit Service 991b93
                  (const char *restrict name, char *restrict resolved));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_REALPATH@
Packit Service 991b93
_GL_FUNCDECL_SYS (realpath, char *,
Packit Service 991b93
                  (const char *restrict name, char *restrict resolved)
Packit Service 991b93
                  _GL_ARG_NONNULL ((1)));
Packit aea12f
#  endif
Packit Service 991b93
_GL_CXXALIAS_SYS (realpath, char *,
Packit Service 991b93
                  (const char *restrict name, char *restrict resolved));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (realpath);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef realpath
Packit aea12f
# if HAVE_RAW_DECL_REALPATH
Packit aea12f
_GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
Packit aea12f
                 "canonicalize or canonicalize-lgpl for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_RPMATCH@
Packit aea12f
/* Test a user response to a question.
Packit aea12f
   Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
Packit aea12f
# if !@HAVE_RPMATCH@
Packit aea12f
_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
Packit aea12f
_GL_CXXALIASWARN (rpmatch);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef rpmatch
Packit aea12f
# if HAVE_RAW_DECL_RPMATCH
Packit aea12f
_GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
Packit aea12f
                 "use gnulib module rpmatch for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_SECURE_GETENV@
Packit aea12f
/* Look up NAME in the environment, returning 0 in insecure situations.  */
Packit aea12f
# if !@HAVE_SECURE_GETENV@
Packit aea12f
_GL_FUNCDECL_SYS (secure_getenv, char *,
Packit aea12f
                  (char const *name) _GL_ARG_NONNULL ((1)));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
Packit aea12f
_GL_CXXALIASWARN (secure_getenv);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef secure_getenv
Packit aea12f
# if HAVE_RAW_DECL_SECURE_GETENV
Packit aea12f
_GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
Packit aea12f
                 "use gnulib module secure_getenv for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_SETENV@
Packit aea12f
/* Set NAME to VALUE in the environment.
Packit aea12f
   If REPLACE is nonzero, overwrite an existing value.  */
Packit aea12f
# if @REPLACE_SETENV@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef setenv
Packit aea12f
#   define setenv rpl_setenv
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (setenv, int,
Packit aea12f
                  (const char *name, const char *value, int replace)
Packit aea12f
                  _GL_ARG_NONNULL ((1)));
Packit aea12f
_GL_CXXALIAS_RPL (setenv, int,
Packit aea12f
                  (const char *name, const char *value, int replace));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_DECL_SETENV@
Packit aea12f
_GL_FUNCDECL_SYS (setenv, int,
Packit aea12f
                  (const char *name, const char *value, int replace)
Packit aea12f
                  _GL_ARG_NONNULL ((1)));
Packit aea12f
#  endif
Packit aea12f
_GL_CXXALIAS_SYS (setenv, int,
Packit aea12f
                  (const char *name, const char *value, int replace));
Packit aea12f
# endif
Packit aea12f
# if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
Packit aea12f
_GL_CXXALIASWARN (setenv);
Packit aea12f
# endif
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef setenv
Packit aea12f
# if HAVE_RAW_DECL_SETENV
Packit aea12f
_GL_WARN_ON_USE (setenv, "setenv is unportable - "
Packit aea12f
                 "use gnulib module setenv for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_STRTOD@
Packit aea12f
 /* Parse a double from STRING, updating ENDP if appropriate.  */
Packit aea12f
# if @REPLACE_STRTOD@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   define strtod rpl_strtod
Packit aea12f
#  endif
Packit aea12f
#  define GNULIB_defined_strtod_function 1
Packit Service 991b93
_GL_FUNCDECL_RPL (strtod, double,
Packit Service 991b93
                  (const char *restrict str, char **restrict endp)
Packit Service 991b93
                  _GL_ARG_NONNULL ((1)));
Packit Service 991b93
_GL_CXXALIAS_RPL (strtod, double,
Packit Service 991b93
                  (const char *restrict str, char **restrict endp));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_STRTOD@
Packit Service 991b93
_GL_FUNCDECL_SYS (strtod, double,
Packit Service 991b93
                  (const char *restrict str, char **restrict endp)
Packit Service 991b93
                  _GL_ARG_NONNULL ((1)));
Packit aea12f
#  endif
Packit Service 991b93
_GL_CXXALIAS_SYS (strtod, double,
Packit Service 991b93
                  (const char *restrict str, char **restrict endp));
Packit aea12f
# endif
Packit Service 991b93
# if __GLIBC__ >= 2
Packit aea12f
_GL_CXXALIASWARN (strtod);
Packit Service 991b93
# endif
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef strtod
Packit aea12f
# if HAVE_RAW_DECL_STRTOD
Packit aea12f
_GL_WARN_ON_USE (strtod, "strtod is unportable - "
Packit aea12f
                 "use gnulib module strtod for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_STRTOLD@
Packit aea12f
 /* Parse a 'long double' from STRING, updating ENDP if appropriate.  */
Packit aea12f
# if @REPLACE_STRTOLD@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   define strtold rpl_strtold
Packit aea12f
#  endif
Packit aea12f
#  define GNULIB_defined_strtold_function 1
Packit Service 991b93
_GL_FUNCDECL_RPL (strtold, long double,
Packit Service 991b93
                  (const char *restrict str, char **restrict endp)
Packit Service 991b93
                  _GL_ARG_NONNULL ((1)));
Packit Service 991b93
_GL_CXXALIAS_RPL (strtold, long double,
Packit Service 991b93
                  (const char *restrict str, char **restrict endp));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_STRTOLD@
Packit Service 991b93
_GL_FUNCDECL_SYS (strtold, long double,
Packit Service 991b93
                  (const char *restrict str, char **restrict endp)
Packit Service 991b93
                  _GL_ARG_NONNULL ((1)));
Packit aea12f
#  endif
Packit Service 991b93
_GL_CXXALIAS_SYS (strtold, long double,
Packit Service 991b93
                  (const char *restrict str, char **restrict endp));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIASWARN (strtold);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef strtold
Packit aea12f
# if HAVE_RAW_DECL_STRTOLD
Packit aea12f
_GL_WARN_ON_USE (strtold, "strtold is unportable - "
Packit aea12f
                 "use gnulib module strtold for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_STRTOLL@
Packit aea12f
/* Parse a signed integer whose textual representation starts at STRING.
Packit aea12f
   The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
Packit aea12f
   it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
Packit aea12f
   "0x").
Packit aea12f
   If ENDPTR is not NULL, the address of the first byte after the integer is
Packit aea12f
   stored in *ENDPTR.
Packit aea12f
   Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
Packit aea12f
   to ERANGE.  */
Packit aea12f
# if !@HAVE_STRTOLL@
Packit aea12f
_GL_FUNCDECL_SYS (strtoll, long long,
Packit Service 991b93
                  (const char *restrict string, char **restrict endptr,
Packit Service 991b93
                   int base)
Packit aea12f
                  _GL_ARG_NONNULL ((1)));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (strtoll, long long,
Packit Service 991b93
                  (const char *restrict string, char **restrict endptr,
Packit Service 991b93
                   int base));
Packit aea12f
_GL_CXXALIASWARN (strtoll);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef strtoll
Packit aea12f
# if HAVE_RAW_DECL_STRTOLL
Packit aea12f
_GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
Packit aea12f
                 "use gnulib module strtoll for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_STRTOULL@
Packit aea12f
/* Parse an unsigned integer whose textual representation starts at STRING.
Packit aea12f
   The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
Packit aea12f
   it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
Packit aea12f
   "0x").
Packit aea12f
   If ENDPTR is not NULL, the address of the first byte after the integer is
Packit aea12f
   stored in *ENDPTR.
Packit aea12f
   Upon overflow, the return value is ULLONG_MAX, and errno is set to
Packit aea12f
   ERANGE.  */
Packit aea12f
# if !@HAVE_STRTOULL@
Packit aea12f
_GL_FUNCDECL_SYS (strtoull, unsigned long long,
Packit Service 991b93
                  (const char *restrict string, char **restrict endptr,
Packit Service 991b93
                   int base)
Packit aea12f
                  _GL_ARG_NONNULL ((1)));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (strtoull, unsigned long long,
Packit Service 991b93
                  (const char *restrict string, char **restrict endptr,
Packit Service 991b93
                   int base));
Packit aea12f
_GL_CXXALIASWARN (strtoull);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef strtoull
Packit aea12f
# if HAVE_RAW_DECL_STRTOULL
Packit aea12f
_GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
Packit aea12f
                 "use gnulib module strtoull for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_UNLOCKPT@
Packit aea12f
/* Unlock the slave side of the pseudo-terminal whose master side is specified
Packit aea12f
   by FD, so that it can be opened.  */
Packit aea12f
# if !@HAVE_UNLOCKPT@
Packit aea12f
_GL_FUNCDECL_SYS (unlockpt, int, (int fd));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (unlockpt, int, (int fd));
Packit aea12f
_GL_CXXALIASWARN (unlockpt);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef unlockpt
Packit aea12f
# if HAVE_RAW_DECL_UNLOCKPT
Packit aea12f
_GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
Packit aea12f
                 "use gnulib module unlockpt for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#if @GNULIB_UNSETENV@
Packit aea12f
/* Remove the variable NAME from the environment.  */
Packit aea12f
# if @REPLACE_UNSETENV@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef unsetenv
Packit aea12f
#   define unsetenv rpl_unsetenv
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
Packit aea12f
_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
Packit aea12f
# else
Packit aea12f
#  if !@HAVE_DECL_UNSETENV@
Packit aea12f
_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
Packit aea12f
#  endif
Packit aea12f
_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
Packit aea12f
# endif
Packit aea12f
# if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
Packit aea12f
_GL_CXXALIASWARN (unsetenv);
Packit aea12f
# endif
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef unsetenv
Packit aea12f
# if HAVE_RAW_DECL_UNSETENV
Packit aea12f
_GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
Packit aea12f
                 "use gnulib module unsetenv for portability");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
/* Convert a wide character to a multibyte character.  */
Packit aea12f
#if @GNULIB_WCTOMB@
Packit aea12f
# if @REPLACE_WCTOMB@
Packit aea12f
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit aea12f
#   undef wctomb
Packit aea12f
#   define wctomb rpl_wctomb
Packit aea12f
#  endif
Packit aea12f
_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
Packit aea12f
_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
Packit aea12f
# else
Packit aea12f
_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
Packit aea12f
# endif
Packit Service 991b93
# if __GLIBC__ >= 2
Packit aea12f
_GL_CXXALIASWARN (wctomb);
Packit Service 991b93
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
Packit aea12f
#endif /* _@GUARD_PREFIX@_STDLIB_H */
Packit aea12f
#endif /* _@GUARD_PREFIX@_STDLIB_H */
Packit aea12f
#endif