Welcome to mirror list, hosted at ThFree Co, Russian Federation.

stat.h « cygwin « include « cygwin « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 73f3e93104b0f3ac8e9a38ea94d170bbdb545270 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* cygwin/stat.h

   Copyright 2002, 2007, 2010, 2013 Red Hat Inc.
   Written by Corinna Vinschen <corinna@vinschen.de>

This file is part of Cygwin.

This software is a copyrighted work licensed under the terms of the
Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
details. */

#ifndef _CYGWIN_STAT_H
#define _CYGWIN_STAT_H

#ifdef __cplusplus
extern "C" {
#endif

struct stat
{
  dev_t         st_dev;
  ino_t         st_ino;
  mode_t        st_mode;
  nlink_t       st_nlink;
  uid_t         st_uid;
  gid_t         st_gid;
  dev_t         st_rdev;
  off_t         st_size;
  timestruc_t   st_atim;
  timestruc_t   st_mtim;
  timestruc_t   st_ctim;
  blksize_t     st_blksize;
  blkcnt_t      st_blocks;
  timestruc_t   st_birthtim;
};

#if defined (__INSIDE_CYGWIN__) || defined (_COMPILING_NEWLIB)
#ifndef __x86_64__
struct __stat32
{
  __dev16_t	st_dev;
  __ino32_t	st_ino;
  mode_t	st_mode;
  nlink_t       st_nlink;
  __uid16_t     st_uid;
  __gid16_t     st_gid;
  __dev16_t     st_rdev;
  _off_t        st_size;
  timestruc_t   st_atim;
  timestruc_t   st_mtim;
  timestruc_t   st_ctim;
  blksize_t     st_blksize;
  __blkcnt32_t  st_blocks;
  long          st_spare4[2];
};
#endif

extern int fstat64 (int fd, struct stat *buf);
extern int stat64 (const char *__restrict file_name,
		   struct stat *__restrict buf);
extern int lstat64 (const char *__restrict file_name,
		    struct stat *__restrict buf);

#endif

#define st_atime st_atim.tv_sec
#define st_mtime st_mtim.tv_sec
#define st_ctime st_ctim.tv_sec
#define st_birthtime st_birthtim.tv_sec

/* POSIX IPC objects are not implemented as distinct file types, so the
   below macros have to return 0.  The expression is supposed to catch
   illegal usage with non-stat parameters. */
#define S_TYPEISMQ(buf)  ((void)(buf)->st_mode,0)
#define S_TYPEISSEM(buf) ((void)(buf)->st_mode,0)
#define S_TYPEISSHM(buf) ((void)(buf)->st_mode,0)

#ifdef __cplusplus
}
#endif

#endif /* _CYGWIN_STAT_H */