/* Provide a more complete sys/stat header file.
- Copyright (C) 2005-2008 Free Software Foundation, Inc.
+ Copyright (C) 2005-2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#ifndef _GL_SYS_STAT_H
+/* Get nlink_t. */
+#include <sys/types.h>
+
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if @GNULIB_LSTAT@
+# if ! @HAVE_LSTAT@
/* mingw does not support symlinks, therefore it does not have lstat. But
without links, stat does just fine. */
-#if ! @HAVE_LSTAT@
-# define lstat stat
-#endif
-#if @GNULIB_LSTAT@ && @REPLACE_LSTAT@
-# undef lstat
-# define lstat rpl_lstat
+# define lstat stat
+# elif @REPLACE_LSTAT@
+# undef lstat
+# define lstat rpl_lstat
extern int rpl_lstat (const char *name, struct stat *buf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef lstat
+# define lstat(p,b) \
+ (GL_LINK_WARNING ("lstat is unportable - " \
+ "use gnulib module lstat for portability"), \
+ lstat (p, b))
#endif
lchmod (f, m))
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
#endif /* _GL_SYS_STAT_H */
#endif /* _GL_SYS_STAT_H */
#endif