Blame lib/sys_stat.in.h

Packit Service a2489d
/* Provide a more complete sys/stat.h header file.
Packit Service a2489d
   Copyright (C) 2005-2018 Free Software Foundation, Inc.
Packit Service a2489d
Packit Service a2489d
   This program is free software; you can redistribute it and/or modify
Packit Service a2489d
   it under the terms of the GNU General Public License as published by
Packit Service a2489d
   the Free Software Foundation; either version 3, or (at your option)
Packit Service a2489d
   any later version.
Packit Service a2489d
Packit Service a2489d
   This program is distributed in the hope that it will be useful,
Packit Service a2489d
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service a2489d
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service a2489d
   GNU General Public License for more details.
Packit Service a2489d
Packit Service a2489d
   You should have received a copy of the GNU General Public License
Packit Service a2489d
   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
Packit Service a2489d
Packit Service a2489d
/* Written by Eric Blake, Paul Eggert, and Jim Meyering.  */
Packit Service a2489d
Packit Service a2489d
/* This file is supposed to be used on platforms where <sys/stat.h> is
Packit Service a2489d
   incomplete.  It is intended to provide definitions and prototypes
Packit Service a2489d
   needed by an application.  Start with what the system provides.  */
Packit Service a2489d
Packit Service a2489d
#if __GNUC__ >= 3
Packit Service a2489d
@PRAGMA_SYSTEM_HEADER@
Packit Service a2489d
#endif
Packit Service a2489d
@PRAGMA_COLUMNS@
Packit Service a2489d
Packit Service a2489d
#if defined __need_system_sys_stat_h
Packit Service a2489d
/* Special invocation convention.  */
Packit Service a2489d
Packit Service a2489d
#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
Packit Service a2489d
Packit Service a2489d
#else
Packit Service a2489d
/* Normal invocation convention.  */
Packit Service a2489d
Packit Service a2489d
#ifndef _@GUARD_PREFIX@_SYS_STAT_H
Packit Service a2489d
Packit Service a2489d
/* Get nlink_t.
Packit Service a2489d
   May also define off_t to a 64-bit type on native Windows.  */
Packit Service a2489d
#include <sys/types.h>
Packit Service a2489d
Packit Service a2489d
/* Get struct timespec.  */
Packit Service a2489d
#include <time.h>
Packit Service a2489d
Packit Service a2489d
/* The include_next requires a split double-inclusion guard.  */
Packit Service a2489d
#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
Packit Service a2489d
Packit Service a2489d
#ifndef _@GUARD_PREFIX@_SYS_STAT_H
Packit Service a2489d
#define _@GUARD_PREFIX@_SYS_STAT_H
Packit Service a2489d
Packit Service a2489d
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
Packit Service a2489d
Packit Service a2489d
/* The definition of _GL_ARG_NONNULL is copied here.  */
Packit Service a2489d
Packit Service a2489d
/* The definition of _GL_WARN_ON_USE is copied here.  */
Packit Service a2489d
Packit Service a2489d
/* Before doing "#define mkdir rpl_mkdir" below, we need to include all
Packit Service a2489d
   headers that may declare mkdir().  Native Windows platforms declare mkdir
Packit Service a2489d
   in <io.h> and/or <direct.h>, not in <unistd.h>.  */
Packit Service a2489d
#if defined _WIN32 && ! defined __CYGWIN__
Packit Service a2489d
# include <io.h>     /* mingw32, mingw64 */
Packit Service a2489d
# include <direct.h> /* mingw64, MSVC 9 */
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* Native Windows platforms declare umask() in <io.h>.  */
Packit Service a2489d
#if 0 && (defined _WIN32 && ! defined __CYGWIN__)
Packit Service a2489d
# include <io.h>
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* Large File Support on native Windows.  */
Packit Service a2489d
#if @WINDOWS_64_BIT_ST_SIZE@
Packit Service a2489d
# define stat _stati64
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* Optionally, override 'struct stat' on native Windows.  */
Packit Service a2489d
#if @GNULIB_OVERRIDES_STRUCT_STAT@
Packit Service a2489d
Packit Service a2489d
# undef stat
Packit Service a2489d
# if @GNULIB_STAT@
Packit Service a2489d
#  define stat rpl_stat
Packit Service a2489d
# else
Packit Service a2489d
   /* Provoke a clear link error if stat() is used as a function and
Packit Service a2489d
      module 'stat' is not in use.  */
Packit Service a2489d
#  define stat stat_used_without_requesting_gnulib_module_stat
Packit Service a2489d
# endif
Packit Service a2489d
Packit Service a2489d
# if !GNULIB_defined_struct_stat
Packit Service a2489d
struct stat
Packit Service a2489d
{
Packit Service a2489d
  dev_t st_dev;
Packit Service a2489d
  ino_t st_ino;
Packit Service a2489d
  mode_t st_mode;
Packit Service a2489d
  nlink_t st_nlink;
Packit Service a2489d
#  if 0
Packit Service a2489d
  uid_t st_uid;
Packit Service a2489d
#  else /* uid_t is not defined by default on native Windows.  */
Packit Service a2489d
  short st_uid;
Packit Service a2489d
#  endif
Packit Service a2489d
#  if 0
Packit Service a2489d
  gid_t st_gid;
Packit Service a2489d
#  else /* gid_t is not defined by default on native Windows.  */
Packit Service a2489d
  short st_gid;
Packit Service a2489d
#  endif
Packit Service a2489d
  dev_t st_rdev;
Packit Service a2489d
  off_t st_size;
Packit Service a2489d
#  if 0
Packit Service a2489d
  blksize_t st_blksize;
Packit Service a2489d
  blkcnt_t st_blocks;
Packit Service a2489d
#  endif
Packit Service a2489d
Packit Service a2489d
#  if @WINDOWS_STAT_TIMESPEC@
Packit Service a2489d
  struct timespec st_atim;
Packit Service a2489d
  struct timespec st_mtim;
Packit Service a2489d
  struct timespec st_ctim;
Packit Service a2489d
#  else
Packit Service a2489d
  time_t st_atime;
Packit Service a2489d
  time_t st_mtime;
Packit Service a2489d
  time_t st_ctime;
Packit Service a2489d
#  endif
Packit Service a2489d
};
Packit Service a2489d
#  if @WINDOWS_STAT_TIMESPEC@
Packit Service a2489d
#   define st_atime st_atim.tv_sec
Packit Service a2489d
#   define st_mtime st_mtim.tv_sec
Packit Service a2489d
#   define st_ctime st_ctim.tv_sec
Packit Service a2489d
    /* Indicator, for gnulib internal purposes.  */
Packit Service a2489d
#   define _GL_WINDOWS_STAT_TIMESPEC 1
Packit Service a2489d
#  endif
Packit Service a2489d
#  define GNULIB_defined_struct_stat 1
Packit Service a2489d
# endif
Packit Service a2489d
Packit Service a2489d
/* Other possible values of st_mode.  */
Packit Service a2489d
# if 0
Packit Service a2489d
#  define _S_IFBLK  0x6000
Packit Service a2489d
# endif
Packit Service a2489d
# if 0
Packit Service a2489d
#  define _S_IFLNK  0xA000
Packit Service a2489d
# endif
Packit Service a2489d
# if 0
Packit Service a2489d
#  define _S_IFSOCK 0xC000
Packit Service a2489d
# endif
Packit Service a2489d
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_IFIFO
Packit Service a2489d
# ifdef _S_IFIFO
Packit Service a2489d
#  define S_IFIFO _S_IFIFO
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_IFMT
Packit Service a2489d
# define S_IFMT 0170000
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#if STAT_MACROS_BROKEN
Packit Service a2489d
# undef S_ISBLK
Packit Service a2489d
# undef S_ISCHR
Packit Service a2489d
# undef S_ISDIR
Packit Service a2489d
# undef S_ISFIFO
Packit Service a2489d
# undef S_ISLNK
Packit Service a2489d
# undef S_ISNAM
Packit Service a2489d
# undef S_ISMPB
Packit Service a2489d
# undef S_ISMPC
Packit Service a2489d
# undef S_ISNWK
Packit Service a2489d
# undef S_ISREG
Packit Service a2489d
# undef S_ISSOCK
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISBLK
Packit Service a2489d
# ifdef S_IFBLK
Packit Service a2489d
#  define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
Packit Service a2489d
# else
Packit Service a2489d
#  define S_ISBLK(m) 0
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISCHR
Packit Service a2489d
# ifdef S_IFCHR
Packit Service a2489d
#  define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
Packit Service a2489d
# else
Packit Service a2489d
#  define S_ISCHR(m) 0
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISDIR
Packit Service a2489d
# ifdef S_IFDIR
Packit Service a2489d
#  define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
Packit Service a2489d
# else
Packit Service a2489d
#  define S_ISDIR(m) 0
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISDOOR /* Solaris 2.5 and up */
Packit Service a2489d
# define S_ISDOOR(m) 0
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISFIFO
Packit Service a2489d
# ifdef S_IFIFO
Packit Service a2489d
#  define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
Packit Service a2489d
# else
Packit Service a2489d
#  define S_ISFIFO(m) 0
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISLNK
Packit Service a2489d
# ifdef S_IFLNK
Packit Service a2489d
#  define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
Packit Service a2489d
# else
Packit Service a2489d
#  define S_ISLNK(m) 0
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISMPB /* V7 */
Packit Service a2489d
# ifdef S_IFMPB
Packit Service a2489d
#  define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
Packit Service a2489d
#  define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
Packit Service a2489d
# else
Packit Service a2489d
#  define S_ISMPB(m) 0
Packit Service a2489d
#  define S_ISMPC(m) 0
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISMPX /* AIX */
Packit Service a2489d
# define S_ISMPX(m) 0
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISNAM /* Xenix */
Packit Service a2489d
# ifdef S_IFNAM
Packit Service a2489d
#  define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
Packit Service a2489d
# else
Packit Service a2489d
#  define S_ISNAM(m) 0
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISNWK /* HP/UX */
Packit Service a2489d
# ifdef S_IFNWK
Packit Service a2489d
#  define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
Packit Service a2489d
# else
Packit Service a2489d
#  define S_ISNWK(m) 0
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISPORT /* Solaris 10 and up */
Packit Service a2489d
# define S_ISPORT(m) 0
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISREG
Packit Service a2489d
# ifdef S_IFREG
Packit Service a2489d
#  define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
Packit Service a2489d
# else
Packit Service a2489d
#  define S_ISREG(m) 0
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_ISSOCK
Packit Service a2489d
# ifdef S_IFSOCK
Packit Service a2489d
#  define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
Packit Service a2489d
# else
Packit Service a2489d
#  define S_ISSOCK(m) 0
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#ifndef S_TYPEISMQ
Packit Service a2489d
# define S_TYPEISMQ(p) 0
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_TYPEISTMO
Packit Service a2489d
# define S_TYPEISTMO(p) 0
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#ifndef S_TYPEISSEM
Packit Service a2489d
# ifdef S_INSEM
Packit Service a2489d
#  define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM)
Packit Service a2489d
# else
Packit Service a2489d
#  define S_TYPEISSEM(p) 0
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_TYPEISSHM
Packit Service a2489d
# ifdef S_INSHD
Packit Service a2489d
#  define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD)
Packit Service a2489d
# else
Packit Service a2489d
#  define S_TYPEISSHM(p) 0
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* high performance ("contiguous data") */
Packit Service a2489d
#ifndef S_ISCTG
Packit Service a2489d
# define S_ISCTG(p) 0
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* Cray DMF (data migration facility): off line, with data  */
Packit Service a2489d
#ifndef S_ISOFD
Packit Service a2489d
# define S_ISOFD(p) 0
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* Cray DMF (data migration facility): off line, with no data  */
Packit Service a2489d
#ifndef S_ISOFL
Packit Service a2489d
# define S_ISOFL(p) 0
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* 4.4BSD whiteout */
Packit Service a2489d
#ifndef S_ISWHT
Packit Service a2489d
# define S_ISWHT(m) 0
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* If any of the following are undefined,
Packit Service a2489d
   define them to their de facto standard values.  */
Packit Service a2489d
#if !S_ISUID
Packit Service a2489d
# define S_ISUID 04000
Packit Service a2489d
#endif
Packit Service a2489d
#if !S_ISGID
Packit Service a2489d
# define S_ISGID 02000
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* S_ISVTX is a common extension to POSIX.  */
Packit Service a2489d
#ifndef S_ISVTX
Packit Service a2489d
# define S_ISVTX 01000
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#if !S_IRUSR && S_IREAD
Packit Service a2489d
# define S_IRUSR S_IREAD
Packit Service a2489d
#endif
Packit Service a2489d
#if !S_IRUSR
Packit Service a2489d
# define S_IRUSR 00400
Packit Service a2489d
#endif
Packit Service a2489d
#if !S_IRGRP
Packit Service a2489d
# define S_IRGRP (S_IRUSR >> 3)
Packit Service a2489d
#endif
Packit Service a2489d
#if !S_IROTH
Packit Service a2489d
# define S_IROTH (S_IRUSR >> 6)
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#if !S_IWUSR && S_IWRITE
Packit Service a2489d
# define S_IWUSR S_IWRITE
Packit Service a2489d
#endif
Packit Service a2489d
#if !S_IWUSR
Packit Service a2489d
# define S_IWUSR 00200
Packit Service a2489d
#endif
Packit Service a2489d
#if !S_IWGRP
Packit Service a2489d
# define S_IWGRP (S_IWUSR >> 3)
Packit Service a2489d
#endif
Packit Service a2489d
#if !S_IWOTH
Packit Service a2489d
# define S_IWOTH (S_IWUSR >> 6)
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#if !S_IXUSR && S_IEXEC
Packit Service a2489d
# define S_IXUSR S_IEXEC
Packit Service a2489d
#endif
Packit Service a2489d
#if !S_IXUSR
Packit Service a2489d
# define S_IXUSR 00100
Packit Service a2489d
#endif
Packit Service a2489d
#if !S_IXGRP
Packit Service a2489d
# define S_IXGRP (S_IXUSR >> 3)
Packit Service a2489d
#endif
Packit Service a2489d
#if !S_IXOTH
Packit Service a2489d
# define S_IXOTH (S_IXUSR >> 6)
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#if !S_IRWXU
Packit Service a2489d
# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
Packit Service a2489d
#endif
Packit Service a2489d
#if !S_IRWXG
Packit Service a2489d
# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
Packit Service a2489d
#endif
Packit Service a2489d
#if !S_IRWXO
Packit Service a2489d
# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* S_IXUGO is a common extension to POSIX.  */
Packit Service a2489d
#if !S_IXUGO
Packit Service a2489d
# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef S_IRWXUGO
Packit Service a2489d
# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* Macros for futimens and utimensat.  */
Packit Service a2489d
#ifndef UTIME_NOW
Packit Service a2489d
# define UTIME_NOW (-1)
Packit Service a2489d
# define UTIME_OMIT (-2)
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_FCHMODAT@
Packit Service a2489d
# if !@HAVE_FCHMODAT@
Packit Service a2489d
_GL_FUNCDECL_SYS (fchmodat, int,
Packit Service a2489d
                  (int fd, char const *file, mode_t mode, int flag)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2)));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (fchmodat, int,
Packit Service a2489d
                  (int fd, char const *file, mode_t mode, int flag));
Packit Service a2489d
_GL_CXXALIASWARN (fchmodat);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef fchmodat
Packit Service a2489d
# if HAVE_RAW_DECL_FCHMODAT
Packit Service a2489d
_GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - "
Packit Service a2489d
                 "use gnulib module openat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_FSTAT@
Packit Service a2489d
# if @REPLACE_FSTAT@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef fstat
Packit Service a2489d
#   define fstat rpl_fstat
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
Packit Service a2489d
# else
Packit Service a2489d
_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (fstat);
Packit Service a2489d
#elif @GNULIB_OVERRIDES_STRUCT_STAT@
Packit Service a2489d
# undef fstat
Packit Service a2489d
# define fstat fstat_used_without_requesting_gnulib_module_fstat
Packit Service a2489d
#elif @WINDOWS_64_BIT_ST_SIZE@
Packit Service a2489d
/* Above, we define stat to _stati64.  */
Packit Service a2489d
# define fstat _fstati64
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef fstat
Packit Service a2489d
# if HAVE_RAW_DECL_FSTAT
Packit Service a2489d
_GL_WARN_ON_USE (fstat, "fstat has portability problems - "
Packit Service a2489d
                 "use gnulib module fstat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_FSTATAT@
Packit Service a2489d
# if @REPLACE_FSTATAT@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef fstatat
Packit Service a2489d
#   define fstatat rpl_fstatat
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (fstatat, int,
Packit Service a2489d
                  (int fd, char const *name, struct stat *st, int flags)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2, 3)));
Packit Service a2489d
_GL_CXXALIAS_RPL (fstatat, int,
Packit Service a2489d
                  (int fd, char const *name, struct stat *st, int flags));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_FSTATAT@
Packit Service a2489d
_GL_FUNCDECL_SYS (fstatat, int,
Packit Service a2489d
                  (int fd, char const *name, struct stat *st, int flags)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2, 3)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (fstatat, int,
Packit Service a2489d
                  (int fd, char const *name, struct stat *st, int flags));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (fstatat);
Packit Service a2489d
#elif @GNULIB_OVERRIDES_STRUCT_STAT@
Packit Service a2489d
# undef fstatat
Packit Service a2489d
# define fstatat fstatat_used_without_requesting_gnulib_module_fstatat
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef fstatat
Packit Service a2489d
# if HAVE_RAW_DECL_FSTATAT
Packit Service a2489d
_GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
Packit Service a2489d
                 "use gnulib module openat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_FUTIMENS@
Packit Service a2489d
/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens
Packit Service a2489d
   implementation relies on futimesat, which on Solaris 10 makes an invocation
Packit Service a2489d
   to futimens that is meant to invoke the libc's futimens(), not gnulib's
Packit Service a2489d
   futimens().  */
Packit Service a2489d
# if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun)
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef futimens
Packit Service a2489d
#   define futimens rpl_futimens
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]));
Packit Service a2489d
_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2]));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_FUTIMENS@
Packit Service a2489d
_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
Packit Service a2489d
# endif
Packit Service a2489d
# if @HAVE_FUTIMENS@
Packit Service a2489d
_GL_CXXALIASWARN (futimens);
Packit Service a2489d
# endif
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef futimens
Packit Service a2489d
# if HAVE_RAW_DECL_FUTIMENS
Packit Service a2489d
_GL_WARN_ON_USE (futimens, "futimens is not portable - "
Packit Service a2489d
                 "use gnulib module futimens for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_LCHMOD@
Packit Service a2489d
/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
Packit Service a2489d
   denotes a symbolic link.  */
Packit Service a2489d
# if !@HAVE_LCHMOD@
Packit Service a2489d
/* The lchmod replacement follows symbolic links.  Callers should take
Packit Service a2489d
   this into account; lchmod should be applied only to arguments that
Packit Service a2489d
   are known to not be symbolic links.  On hosts that lack lchmod,
Packit Service a2489d
   this can lead to race conditions between the check and the
Packit Service a2489d
   invocation of lchmod, but we know of no workarounds that are
Packit Service a2489d
   reliable in general.  You might try requesting support for lchmod
Packit Service a2489d
   from your operating system supplier.  */
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define lchmod chmod
Packit Service a2489d
#  endif
Packit Service a2489d
/* Need to cast, because on mingw, the second parameter of chmod is
Packit Service a2489d
                                                int mode.  */
Packit Service a2489d
_GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int,
Packit Service a2489d
                         (const char *filename, mode_t mode));
Packit Service a2489d
# else
Packit Service a2489d
#  if 0 /* assume already declared */
Packit Service a2489d
_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
Packit Service a2489d
                               _GL_ARG_NONNULL ((1)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
Packit Service a2489d
# endif
Packit Service a2489d
# if @HAVE_LCHMOD@
Packit Service a2489d
_GL_CXXALIASWARN (lchmod);
Packit Service a2489d
# endif
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef lchmod
Packit Service a2489d
# if HAVE_RAW_DECL_LCHMOD
Packit Service a2489d
_GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
Packit Service a2489d
                 "use gnulib module lchmod for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_LSTAT@
Packit Service a2489d
# if ! @HAVE_LSTAT@
Packit Service a2489d
/* mingw does not support symlinks, therefore it does not have lstat.  But
Packit Service a2489d
   without links, stat does just fine.  */
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define lstat stat
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_RPL_1 (lstat, stat, int, (const char *name, struct stat *buf));
Packit Service a2489d
# elif @REPLACE_LSTAT@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef lstat
Packit Service a2489d
#   define lstat rpl_lstat
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf)
Packit Service a2489d
                              _GL_ARG_NONNULL ((1, 2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf));
Packit Service a2489d
# else
Packit Service a2489d
_GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf));
Packit Service a2489d
# endif
Packit Service a2489d
# if @HAVE_LSTAT@
Packit Service a2489d
_GL_CXXALIASWARN (lstat);
Packit Service a2489d
# endif
Packit Service a2489d
#elif @GNULIB_OVERRIDES_STRUCT_STAT@
Packit Service a2489d
# undef lstat
Packit Service a2489d
# define lstat lstat_used_without_requesting_gnulib_module_lstat
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef lstat
Packit Service a2489d
# if HAVE_RAW_DECL_LSTAT
Packit Service a2489d
_GL_WARN_ON_USE (lstat, "lstat is unportable - "
Packit Service a2489d
                 "use gnulib module lstat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @REPLACE_MKDIR@
Packit Service a2489d
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#  undef mkdir
Packit Service a2489d
#  define mkdir rpl_mkdir
Packit Service a2489d
# endif
Packit Service a2489d
_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
Packit Service a2489d
                              _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
Packit Service a2489d
#else
Packit Service a2489d
/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
Packit Service a2489d
   Additionally, it declares _mkdir (and depending on compile flags, an
Packit Service a2489d
   alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
Packit Service a2489d
   which are included above.  */
Packit Service a2489d
# if defined _WIN32 && ! defined __CYGWIN__
Packit Service a2489d
Packit Service a2489d
#  if !GNULIB_defined_rpl_mkdir
Packit Service a2489d
static int
Packit Service a2489d
rpl_mkdir (char const *name, mode_t mode)
Packit Service a2489d
{
Packit Service a2489d
  return _mkdir (name);
Packit Service a2489d
}
Packit Service a2489d
#   define GNULIB_defined_rpl_mkdir 1
Packit Service a2489d
#  endif
Packit Service a2489d
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define mkdir rpl_mkdir
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
Packit Service a2489d
# else
Packit Service a2489d
_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
_GL_CXXALIASWARN (mkdir);
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_MKDIRAT@
Packit Service a2489d
# if !@HAVE_MKDIRAT@
Packit Service a2489d
_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)
Packit Service a2489d
                                _GL_ARG_NONNULL ((2)));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode));
Packit Service a2489d
_GL_CXXALIASWARN (mkdirat);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef mkdirat
Packit Service a2489d
# if HAVE_RAW_DECL_MKDIRAT
Packit Service a2489d
_GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - "
Packit Service a2489d
                 "use gnulib module openat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_MKFIFO@
Packit Service a2489d
# if @REPLACE_MKFIFO@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef mkfifo
Packit Service a2489d
#   define mkfifo rpl_mkfifo
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode)
Packit Service a2489d
                               _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_MKFIFO@
Packit Service a2489d
_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode)
Packit Service a2489d
                               _GL_ARG_NONNULL ((1)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (mkfifo);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef mkfifo
Packit Service a2489d
# if HAVE_RAW_DECL_MKFIFO
Packit Service a2489d
_GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - "
Packit Service a2489d
                 "use gnulib module mkfifo for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_MKFIFOAT@
Packit Service a2489d
# if !@HAVE_MKFIFOAT@
Packit Service a2489d
_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
Packit Service a2489d
                                 _GL_ARG_NONNULL ((2)));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
Packit Service a2489d
_GL_CXXALIASWARN (mkfifoat);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef mkfifoat
Packit Service a2489d
# if HAVE_RAW_DECL_MKFIFOAT
Packit Service a2489d
_GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - "
Packit Service a2489d
                 "use gnulib module mkfifoat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_MKNOD@
Packit Service a2489d
# if @REPLACE_MKNOD@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef mknod
Packit Service a2489d
#   define mknod rpl_mknod
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)
Packit Service a2489d
                              _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_MKNOD@
Packit Service a2489d
_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)
Packit Service a2489d
                              _GL_ARG_NONNULL ((1)));
Packit Service a2489d
#  endif
Packit Service a2489d
/* Need to cast, because on OSF/1 5.1, the third parameter is '...'.  */
Packit Service a2489d
_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (mknod);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef mknod
Packit Service a2489d
# if HAVE_RAW_DECL_MKNOD
Packit Service a2489d
_GL_WARN_ON_USE (mknod, "mknod is not portable - "
Packit Service a2489d
                 "use gnulib module mknod for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_MKNODAT@
Packit Service a2489d
# if !@HAVE_MKNODAT@
Packit Service a2489d
_GL_FUNCDECL_SYS (mknodat, int,
Packit Service a2489d
                  (int fd, char const *file, mode_t mode, dev_t dev)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2)));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (mknodat, int,
Packit Service a2489d
                  (int fd, char const *file, mode_t mode, dev_t dev));
Packit Service a2489d
_GL_CXXALIASWARN (mknodat);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef mknodat
Packit Service a2489d
# if HAVE_RAW_DECL_MKNODAT
Packit Service a2489d
_GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
Packit Service a2489d
                 "use gnulib module mkfifoat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_STAT@
Packit Service a2489d
# if @REPLACE_STAT@
Packit Service a2489d
#  if !@GNULIB_OVERRIDES_STRUCT_STAT@
Packit Service a2489d
    /* We can't use the object-like #define stat rpl_stat, because of
Packit Service a2489d
       struct stat.  This means that rpl_stat will not be used if the user
Packit Service a2489d
       does (stat)(a,b).  Oh well.  */
Packit Service a2489d
#   if defined _AIX && defined stat && defined _LARGE_FILES
Packit Service a2489d
     /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
Packit Service a2489d
        so we have to replace stat64() instead of stat(). */
Packit Service a2489d
#    undef stat64
Packit Service a2489d
#    define stat64(name, st) rpl_stat (name, st)
Packit Service a2489d
#   elif @WINDOWS_64_BIT_ST_SIZE@
Packit Service a2489d
     /* Above, we define stat to _stati64.  */
Packit Service a2489d
#    if defined __MINGW32__ && defined _stati64
Packit Service a2489d
#     ifndef _USE_32BIT_TIME_T
Packit Service a2489d
       /* The system headers define _stati64 to _stat64.  */
Packit Service a2489d
#      undef _stat64
Packit Service a2489d
#      define _stat64(name, st) rpl_stat (name, st)
Packit Service a2489d
#     endif
Packit Service a2489d
#    elif defined _MSC_VER && defined _stati64
Packit Service a2489d
#     ifdef _USE_32BIT_TIME_T
Packit Service a2489d
       /* The system headers define _stati64 to _stat32i64.  */
Packit Service a2489d
#      undef _stat32i64
Packit Service a2489d
#      define _stat32i64(name, st) rpl_stat (name, st)
Packit Service a2489d
#     else
Packit Service a2489d
       /* The system headers define _stati64 to _stat64.  */
Packit Service a2489d
#      undef _stat64
Packit Service a2489d
#      define _stat64(name, st) rpl_stat (name, st)
Packit Service a2489d
#     endif
Packit Service a2489d
#    else
Packit Service a2489d
#     undef _stati64
Packit Service a2489d
#     define _stati64(name, st) rpl_stat (name, st)
Packit Service a2489d
#    endif
Packit Service a2489d
#   elif defined __MINGW32__ && defined stat
Packit Service a2489d
#    ifdef _USE_32BIT_TIME_T
Packit Service a2489d
      /* The system headers define stat to _stat32i64.  */
Packit Service a2489d
#     undef _stat32i64
Packit Service a2489d
#     define _stat32i64(name, st) rpl_stat (name, st)
Packit Service a2489d
#    else
Packit Service a2489d
      /* The system headers define stat to _stat64.  */
Packit Service a2489d
#     undef _stat64
Packit Service a2489d
#     define _stat64(name, st) rpl_stat (name, st)
Packit Service a2489d
#    endif
Packit Service a2489d
#   elif defined _MSC_VER && defined stat
Packit Service a2489d
#    ifdef _USE_32BIT_TIME_T
Packit Service a2489d
      /* The system headers define stat to _stat32.  */
Packit Service a2489d
#     undef _stat32
Packit Service a2489d
#     define _stat32(name, st) rpl_stat (name, st)
Packit Service a2489d
#    else
Packit Service a2489d
      /* The system headers define stat to _stat64i32.  */
Packit Service a2489d
#     undef _stat64i32
Packit Service a2489d
#     define _stat64i32(name, st) rpl_stat (name, st)
Packit Service a2489d
#    endif
Packit Service a2489d
#   else /* !(_AIX || __MINGW32__ || _MSC_VER) */
Packit Service a2489d
#    undef stat
Packit Service a2489d
#    define stat(name, st) rpl_stat (name, st)
Packit Service a2489d
#   endif /* !_LARGE_FILES */
Packit Service a2489d
#  endif /* !@GNULIB_OVERRIDES_STRUCT_STAT@ */
Packit Service a2489d
_GL_EXTERN_C int stat (const char *name, struct stat *buf)
Packit Service a2489d
                      _GL_ARG_NONNULL ((1, 2));
Packit Service a2489d
# endif
Packit Service a2489d
#elif @GNULIB_OVERRIDES_STRUCT_STAT@
Packit Service a2489d
/* see above:
Packit Service a2489d
  #define stat stat_used_without_requesting_gnulib_module_stat
Packit Service a2489d
 */
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef stat
Packit Service a2489d
# if HAVE_RAW_DECL_STAT
Packit Service a2489d
_GL_WARN_ON_USE (stat, "stat is unportable - "
Packit Service a2489d
                 "use gnulib module stat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_UTIMENSAT@
Packit Service a2489d
/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat
Packit Service a2489d
   implementation relies on futimesat, which on Solaris 10 makes an invocation
Packit Service a2489d
   to utimensat that is meant to invoke the libc's utimensat(), not gnulib's
Packit Service a2489d
   utimensat().  */
Packit Service a2489d
# if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun)
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef utimensat
Packit Service a2489d
#   define utimensat rpl_utimensat
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name,
Packit Service a2489d
                                   struct timespec const times[2], int flag)
Packit Service a2489d
                                  _GL_ARG_NONNULL ((2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name,
Packit Service a2489d
                                   struct timespec const times[2], int flag));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_UTIMENSAT@
Packit Service a2489d
_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
Packit Service a2489d
                                   struct timespec const times[2], int flag)
Packit Service a2489d
                                  _GL_ARG_NONNULL ((2)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
Packit Service a2489d
                                   struct timespec const times[2], int flag));
Packit Service a2489d
# endif
Packit Service a2489d
# if @HAVE_UTIMENSAT@
Packit Service a2489d
_GL_CXXALIASWARN (utimensat);
Packit Service a2489d
# endif
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef utimensat
Packit Service a2489d
# if HAVE_RAW_DECL_UTIMENSAT
Packit Service a2489d
_GL_WARN_ON_USE (utimensat, "utimensat is not portable - "
Packit Service a2489d
                 "use gnulib module utimensat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
Packit Service a2489d
#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
Packit Service a2489d
#endif