aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2014-01-07 14:43:08 +0000
committerRon Yorston <rmy@pobox.com>2014-01-07 14:43:08 +0000
commit94150aba92d308e417aa552a1b3a957be264b423 (patch)
treed9b570e2641188c68917e85d7cb387fe0bbfbecc /include
parent63b71e4a6f8c65a4bef7617efb50a2b473e388b3 (diff)
downloadbusybox-w32-94150aba92d308e417aa552a1b3a957be264b423.tar.gz
busybox-w32-94150aba92d308e417aa552a1b3a957be264b423.tar.bz2
busybox-w32-94150aba92d308e417aa552a1b3a957be264b423.zip
Revise mingw_stat to minimise changes from upstream BusyBox
Diffstat (limited to 'include')
-rw-r--r--include/mingw.h45
1 files changed, 26 insertions, 19 deletions
diff --git a/include/mingw.h b/include/mingw.h
index e8c55f646..b3fc603c0 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -204,9 +204,6 @@ NOIMPL(mingw_bind,SOCKET s UNUSED_PARAM,const struct sockaddr* sa UNUSED_PARAM,i
204/* 204/*
205 * sys/stat.h 205 * sys/stat.h
206 */ 206 */
207typedef int blkcnt_t;
208typedef int nlink_t;
209
210#define S_ISUID 04000 207#define S_ISUID 04000
211#define S_ISGID 02000 208#define S_ISGID 02000
212#define S_ISVTX 01000 209#define S_ISVTX 01000
@@ -233,27 +230,37 @@ NOIMPL(fchown,int fd UNUSED_PARAM, uid_t uid UNUSED_PARAM, gid_t gid UNUSED_PARA
233int mingw_mkdir(const char *path, int mode); 230int mingw_mkdir(const char *path, int mode);
234#define mkdir mingw_mkdir 231#define mkdir mingw_mkdir
235 232
236/* Use mingw_lstat()/mingw_stat() instead of lstat()/stat() and
237 * mingw_fstat() instead of fstat() on Windows.
238 */
239#if ENABLE_LFS 233#if ENABLE_LFS
240# define off_t off64_t 234# define off_t off64_t
241#endif 235#endif
242#define lseek _lseeki64 236#define lseek _lseeki64
243#define stat _stati64
244int mingw_lstat(const char *file_name, struct stat *buf);
245int mingw_stat(const char *file_name, struct stat *buf);
246int mingw_fstat(int fd, struct stat *buf);
247#define fstat mingw_fstat
248#define lstat mingw_lstat
249#define _stati64(x,y) mingw_stat(x,y)
250 237
251/* The Windows stat structure doesn't have the st_blocks member. This 238typedef int nlink_t;
252 * macro calculates st_blocks from st_size. It would be better if we 239typedef int blksize_t;
253 * could put brackets around it but most references to st_blocks in BusyBox 240typedef off_t blkcnt_t;
254 * are pretty simple and work without brackets. 241
255 */ 242struct mingw_stat {
256#define st_blocks st_size+511>>9 243 dev_t st_dev;
244 ino_t st_ino;
245 mode_t st_mode;
246 nlink_t st_nlink;
247 uid_t st_uid;
248 gid_t st_gid;
249 dev_t st_rdev;
250 off_t st_size;
251 time_t st_atime;
252 time_t st_mtime;
253 time_t st_ctime;
254 blksize_t st_blksize;
255 blkcnt_t st_blocks;
256};
257
258int mingw_lstat(const char *file_name, struct mingw_stat *buf);
259int mingw_stat(const char *file_name, struct mingw_stat *buf);
260int mingw_fstat(int fd, struct mingw_stat *buf);
261#define lstat mingw_lstat
262#define stat mingw_stat
263#define fstat mingw_fstat
257 264
258/* 265/*
259 * sys/sysmacros.h 266 * sys/sysmacros.h