/* sys/stat.h supplied with MSVCRT uses too narrow data types for
inode and user/group id, so we replace them with our own.
- Copyright (C) 2008 Free Software Foundation, Inc.
+Copyright (C) 2008-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include <sys/types.h>
#include <time.h>
-#define S_IFMT 0xF000
+#define S_IFMT 0xF800
#define S_IFREG 0x8000
#define S_IFDIR 0x4000
#define S_IFBLK 0x3000
#define S_IFCHR 0x2000
#define S_IFIFO 0x1000
+#define S_IFLNK 0x0800
#define S_IREAD 0x0100
#define S_IWRITE 0x0080
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+
+/* These don't exist on Windows, but lib/filemode.c wants them. */
+#define S_ISUID 0
+#define S_ISGID 0
+#define S_ISVTX 0
+#define S_IRGRP (S_IRUSR >> 3)
+#define S_IROTH (S_IRUSR >> 6)
+#define S_IWGRP (S_IWUSR >> 3)
+#define S_IWOTH (S_IWUSR >> 6)
+#define S_IXGRP (S_IXUSR >> 3)
+#define S_IXOTH (S_IXUSR >> 6)
+
+#define S_ISSOCK(m) 0
+#define S_ISCTG(p) 0
+#define S_ISDOOR(m) 0
+#define S_ISMPB(m) 0
+#define S_ISMPC(m) 0
+#define S_ISMPX(m) 0
+#define S_ISNWK(m) 0
+#define S_ISPORT(m) 0
+#define S_ISWHT(m) 0
+#define S_TYPEISMQ(p) 0
+#define S_TYPEISSEM(p) 0
+#define S_TYPEISSHM(p) 0
+#define S_TYPEISTMO(p) 0
struct stat {
unsigned __int64 st_ino; /* ino_t in sys/types.h is too narrow */
dev_t st_dev;
unsigned short st_mode;
short st_nlink;
- int st_uid;
- int st_gid;
+ unsigned st_uid; /* Vista's TrustedInstaller has a very large RID */
+ unsigned st_gid;
unsigned __int64 st_size;
dev_t st_rdev;
time_t st_atime;
char st_gname[260];
};
+/* Internal variable for asking 'stat'/'lstat' to produce accurate
+ info about owner and group of files. */
+extern int w32_stat_get_owner_group;
+
+/* Prevent redefinition by other headers, e.g. wchar.h. */
+#define _STAT_DEFINED
+
_CRTIMP int __cdecl __MINGW_NOTHROW fstat (int, struct stat*);
_CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int);
_CRTIMP int __cdecl __MINGW_NOTHROW stat (const char*, struct stat*);
+_CRTIMP int __cdecl __MINGW_NOTHROW lstat (const char*, struct stat*);
+_CRTIMP int __cdecl __MINGW_NOTHROW fstatat (int, char const *,
+ struct stat *, int);
#endif /* INC_SYS_STAT_H_ */
-
-/* arch-tag: 17d8fc06-f2e5-4d10-a01e-af819918fe42
- (do not change this comment) */