|
1 /* |
|
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @publishedAll |
|
23 @released |
|
24 */ |
|
25 |
|
26 #ifndef _SYS_STAT_H |
|
27 #define _SYS_STAT_H |
|
28 |
|
29 #ifdef __cplusplus |
|
30 extern "C" { |
|
31 #endif |
|
32 |
|
33 #include <_ansi.h> |
|
34 #include <time.h> |
|
35 #include <sys/types.h> |
|
36 |
|
37 struct stat |
|
38 { |
|
39 dev_t st_dev; |
|
40 ino_t st_ino; |
|
41 mode_t st_mode; |
|
42 short st_nlink; |
|
43 uid_t st_uid; |
|
44 gid_t st_gid; |
|
45 dev_t st_rdev; |
|
46 off_t st_size; |
|
47 /* SysV/sco doesn't have the rest... */ |
|
48 #ifdef __svr4__ |
|
49 time_t st_atime; |
|
50 time_t st_mtime; |
|
51 time_t st_ctime; |
|
52 #else |
|
53 time_t st_atime; |
|
54 int st_spare1; |
|
55 time_t st_mtime; |
|
56 int st_spare2; |
|
57 time_t st_ctime; |
|
58 int st_spare3; |
|
59 long st_blksize; |
|
60 long st_blocks; |
|
61 long st_spare4[2]; |
|
62 #endif |
|
63 }; |
|
64 |
|
65 #define _IFMT 0170000 /* type of file */ |
|
66 #define _IFDIR 0040000 /* directory */ |
|
67 #define _IFCHR 0020000 /* character special */ |
|
68 #define _IFBLK 0060000 /* block special */ |
|
69 #define _IFREG 0100000 /* regular */ |
|
70 #define _IFLNK 0120000 /* symbolic link */ |
|
71 #define _IFSOCK 0140000 /* socket */ |
|
72 #define _IFIFO 0010000 /* fifo */ |
|
73 |
|
74 #define S_BLKSIZE 1024 /* size of a block */ |
|
75 |
|
76 #define S_ISUID 0004000 /* set user id on execution */ |
|
77 #define S_ISGID 0002000 /* set group id on execution */ |
|
78 #ifndef _POSIX_SOURCE |
|
79 #define S_ISVTX 0001000 /* save swapped text even after use */ |
|
80 #define S_IREAD 0000400 /* read permission, owner */ |
|
81 #define S_IWRITE 0000200 /* write permission, owner */ |
|
82 #define S_IEXEC 0000100 /* execute/search permission, owner */ |
|
83 |
|
84 #define S_ENFMT 0002000 /* enforcement-mode locking */ |
|
85 |
|
86 #define S_IFMT _IFMT |
|
87 #define S_IFDIR _IFDIR |
|
88 #define S_IFCHR _IFCHR |
|
89 #define S_IFBLK _IFBLK |
|
90 #define S_IFREG _IFREG |
|
91 #define S_IFLNK _IFLNK |
|
92 #define S_IFSOCK _IFSOCK |
|
93 #define S_IFIFO _IFIFO |
|
94 #endif /* !_POSIX_SOURCE */ |
|
95 |
|
96 #define S_IRWXU 0000700 /* rwx, owner */ |
|
97 #define S_IRUSR 0000400 /* read permission, owner */ |
|
98 #define S_IWUSR 0000200 /* write permission, owner */ |
|
99 #define S_IXUSR 0000100 /* execute/search permission, owner */ |
|
100 #define S_IRWXG 0000070 /* rwx, group */ |
|
101 #define S_IRGRP 0000040 /* read permission, group */ |
|
102 #define S_IWGRP 0000020 /* write permission, grougroup */ |
|
103 #define S_IXGRP 0000010 /* execute/search permission, group */ |
|
104 #define S_IRWXO 0000007 /* rwx, other */ |
|
105 #define S_IROTH 0000004 /* read permission, other */ |
|
106 #define S_IWOTH 0000002 /* write permission, other */ |
|
107 #define S_IXOTH 0000001 /* execute/search permission, other */ |
|
108 |
|
109 #define S_ISBLK(m) (((m)&_IFMT) == _IFBLK) |
|
110 #define S_ISCHR(m) (((m)&_IFMT) == _IFCHR) |
|
111 #define S_ISDIR(m) (((m)&_IFMT) == _IFDIR) |
|
112 #define S_ISFIFO(m) (((m)&_IFMT) == _IFIFO) |
|
113 #define S_ISREG(m) (((m)&_IFMT) == _IFREG) |
|
114 #define S_ISLNK(m) (((m)&_IFMT) == _IFLNK) |
|
115 #define S_ISSOCK(m) (((m)&_IFMT) == _IFSOCK) |
|
116 |
|
117 IMPORT_C int chmod ( const char *_path, mode_t _mode ); |
|
118 IMPORT_C int wchmod ( const wchar_t *_path, mode_t _mode ); |
|
119 IMPORT_C int fstat ( int _fd, struct stat *_sbuf ); |
|
120 IMPORT_C int mkdir ( const char *_path, mode_t _mode ); |
|
121 IMPORT_C int wmkdir ( const wchar_t *_path, mode_t _mode ); |
|
122 IMPORT_C int stat ( const char *_path, struct stat *_sbuf ); |
|
123 IMPORT_C int wstat ( const wchar_t *_path, struct stat *_sbuf ); |
|
124 IMPORT_C char* realpath (const char *_path, char *resolved); |
|
125 IMPORT_C wchar_t* wrealpath (const wchar_t * _path, wchar_t * resolved); |
|
126 |
|
127 int mkfifo ( char *_path, mode_t _mode ); |
|
128 mode_t umask ( mode_t _mask ); |
|
129 |
|
130 #ifdef __cplusplus |
|
131 } |
|
132 #endif |
|
133 #endif /* _SYS_STAT_H */ |