2016-12-19 23:46:28 +01:00
|
|
|
#pragma once
|
2017-01-25 23:43:55 +01:00
|
|
|
#include "..\crtheaders.h"
|
2017-01-30 08:54:24 +01:00
|
|
|
#include "types.h"
|
2017-01-25 23:43:55 +01:00
|
|
|
#include SYS_STAT_H
|
2016-12-19 23:46:28 +01:00
|
|
|
|
|
|
|
#define _S_IFLNK 0xA000 // symbolic link
|
|
|
|
#define _S_IFSOCK 0xC000 // socket
|
|
|
|
|
|
|
|
#define S_IFMT _S_IFMT
|
|
|
|
#define S_IFDIR _S_IFDIR
|
|
|
|
#define S_IFCHR _S_IFCHR
|
|
|
|
#define S_IFREG _S_IFREG
|
|
|
|
#define S_IREAD _S_IREAD
|
|
|
|
#define S_IWRITE _S_IWRITE
|
|
|
|
#define S_IEXEC _S_IEXEC
|
|
|
|
#define S_IFLNK _S_IFLNK
|
|
|
|
#define S_IFSOCK _S_IFSOCK
|
|
|
|
|
|
|
|
# define S_ISUID 0x800
|
|
|
|
# define S_ISGID 0x400
|
|
|
|
|
2017-01-25 23:43:55 +01:00
|
|
|
int w32_fstat(int fd, struct w32_stat *buf);
|
|
|
|
#define fstat(a,b) w32_fstat((a), (b))
|
|
|
|
|
|
|
|
int w32_stat(const char *path, struct w32_stat *buf);
|
2016-12-19 23:46:28 +01:00
|
|
|
#define stat w32_stat
|
|
|
|
#define lstat w32_stat
|
2017-01-25 23:43:55 +01:00
|
|
|
|
|
|
|
int w32_mkdir(const char *pathname, unsigned short mode);
|
2016-12-19 23:46:28 +01:00
|
|
|
#define mkdir w32_mkdir
|
2017-01-25 23:43:55 +01:00
|
|
|
|
|
|
|
int w32_chmod(const char *, mode_t);
|
2016-12-19 23:46:28 +01:00
|
|
|
#define chmod w32_chmod
|
|
|
|
|
|
|
|
struct w32_stat {
|
|
|
|
dev_t st_dev; /* ID of device containing file */
|
|
|
|
unsigned short st_ino; /* inode number */
|
|
|
|
unsigned short st_mode; /* protection */
|
|
|
|
short st_nlink; /* number of hard links */
|
|
|
|
short st_uid; /* user ID of owner */
|
|
|
|
short st_gid; /* group ID of owner */
|
|
|
|
dev_t st_rdev; /* device ID (if special file) */
|
|
|
|
__int64 st_size; /* total size, in bytes */
|
|
|
|
__int64 st_atime; /* time of last access */
|
|
|
|
__int64 st_mtime; /* time of last modification */
|
|
|
|
__int64 st_ctime; /* time of last status change */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-01-25 23:43:55 +01:00
|
|
|
void strmode(mode_t mode, char *p);
|