Mercurial > hg > nginx
annotate src/os/unix/ngx_files.h @ 2504:9e9a985d956a
load SSL engine before certificates,
otherwise RSA keys will use built-in RSA methods
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 16 Feb 2009 13:37:58 +0000 |
parents | 2abf14c952a2 |
children | 5e87ddb4764f |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
336
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
336
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
336
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
336
diff
changeset
|
5 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
336
diff
changeset
|
6 |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
6
diff
changeset
|
7 #ifndef _NGX_FILES_H_INCLUDED_ |
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
6
diff
changeset
|
8 #define _NGX_FILES_H_INCLUDED_ |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 |
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
57
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
11 #include <ngx_config.h> |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
12 #include <ngx_core.h> |
57
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
13 |
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
14 |
2234
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
15 typedef int ngx_fd_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
16 typedef struct stat ngx_file_info_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
17 typedef ino_t ngx_file_uniq_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
18 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
19 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
20 typedef struct { |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
21 DIR *dir; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
22 struct dirent *de; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
23 struct stat info; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
24 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
25 unsigned type:8; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
26 unsigned valid_info:1; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
27 unsigned valid_type:1; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
28 } ngx_dir_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
29 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
30 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
31 typedef struct { |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
32 size_t n; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
33 glob_t pglob; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
34 u_char *pattern; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
35 ngx_log_t *log; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
36 ngx_uint_t test; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
37 } ngx_glob_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
38 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
39 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
40 #define NGX_INVALID_FILE -1 |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
41 #define NGX_FILE_ERROR -1 |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
42 |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
43 |
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
44 |
1975 | 45 #ifdef __CYGWIN__ |
46 | |
2126
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
47 #define NGX_HAVE_CASELESS_FILESYSTEM 1 |
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
48 |
1975 | 49 #define ngx_open_file(name, mode, create, access) \ |
50 open((const char *) name, mode|create|O_BINARY, access) | |
51 | |
52 #else | |
53 | |
1048
c4f666fc3a7e
ngx_open_file(name, access, create) > ngx_open_file(name, mode, create, access)
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
54 #define ngx_open_file(name, mode, create, access) \ |
c4f666fc3a7e
ngx_open_file(name, access, create) > ngx_open_file(name, mode, create, access)
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
55 open((const char *) name, mode|create, access) |
1975 | 56 |
57 #endif | |
58 | |
5
62b1a364857c
nginx-0.0.1-2002-08-23-20:14:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
3
diff
changeset
|
59 #define ngx_open_file_n "open()" |
62b1a364857c
nginx-0.0.1-2002-08-23-20:14:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
3
diff
changeset
|
60 |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
75
diff
changeset
|
61 #define NGX_FILE_RDONLY O_RDONLY |
1054 | 62 #define NGX_FILE_WRONLY O_WRONLY |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
75
diff
changeset
|
63 #define NGX_FILE_RDWR O_RDWR |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
75
diff
changeset
|
64 #define NGX_FILE_CREATE_OR_OPEN O_CREAT |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
75
diff
changeset
|
65 #define NGX_FILE_OPEN 0 |
333
be40e9893a19
nginx-0.0.3-2004-05-11-20:16:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
303
diff
changeset
|
66 #define NGX_FILE_TRUNCATE O_TRUNC |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
75
diff
changeset
|
67 #define NGX_FILE_APPEND O_APPEND |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
75
diff
changeset
|
68 |
1048
c4f666fc3a7e
ngx_open_file(name, access, create) > ngx_open_file(name, mode, create, access)
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
69 #define NGX_FILE_DEFAULT_ACCESS 0644 |
c4f666fc3a7e
ngx_open_file(name, access, create) > ngx_open_file(name, mode, create, access)
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
70 |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
75
diff
changeset
|
71 |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
72 #define ngx_close_file close |
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
73 #define ngx_close_file_n "close()" |
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
74 |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
75
diff
changeset
|
75 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
76 #define ngx_delete_file(name) unlink((const char *) name) |
185
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
77 #define ngx_delete_file_n "unlink()" |
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
78 |
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
79 |
633 | 80 ngx_fd_t ngx_open_tempfile(u_char *name, ngx_uint_t persistent, |
1046 | 81 ngx_uint_t access); |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
82 #define ngx_open_tempfile_n "open()" |
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
83 |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
75
diff
changeset
|
84 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
85 ssize_t ngx_read_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset); |
2180 | 86 #if (NGX_HAVE_PREAD) |
87 #define ngx_read_file_n "pread()" | |
88 #else | |
5
62b1a364857c
nginx-0.0.1-2002-08-23-20:14:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
3
diff
changeset
|
89 #define ngx_read_file_n "read()" |
2180 | 90 #endif |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
91 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
92 ssize_t ngx_write_file(ngx_file_t *file, u_char *buf, size_t size, |
497 | 93 off_t offset); |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
94 |
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
95 ssize_t ngx_write_chain_to_file(ngx_file_t *file, ngx_chain_t *ce, |
497 | 96 off_t offset, ngx_pool_t *pool); |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
97 |
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
98 |
1055 | 99 #define ngx_read_fd read |
100 #define ngx_read_fd_n "read()" | |
101 | |
2302
2abf14c952a2
compatibility with glibc 2.3, warn_unused_result attribute for write()
Igor Sysoev <igor@sysoev.ru>
parents:
2259
diff
changeset
|
102 /* |
2abf14c952a2
compatibility with glibc 2.3, warn_unused_result attribute for write()
Igor Sysoev <igor@sysoev.ru>
parents:
2259
diff
changeset
|
103 * we use inlined function instead of simple #define |
2abf14c952a2
compatibility with glibc 2.3, warn_unused_result attribute for write()
Igor Sysoev <igor@sysoev.ru>
parents:
2259
diff
changeset
|
104 * because glibc 2.3 sets warn_unused_result attribute for write() |
2abf14c952a2
compatibility with glibc 2.3, warn_unused_result attribute for write()
Igor Sysoev <igor@sysoev.ru>
parents:
2259
diff
changeset
|
105 * and in this case gcc 4.3 ignores (void) cast |
2abf14c952a2
compatibility with glibc 2.3, warn_unused_result attribute for write()
Igor Sysoev <igor@sysoev.ru>
parents:
2259
diff
changeset
|
106 */ |
2abf14c952a2
compatibility with glibc 2.3, warn_unused_result attribute for write()
Igor Sysoev <igor@sysoev.ru>
parents:
2259
diff
changeset
|
107 static ngx_inline ssize_t |
2abf14c952a2
compatibility with glibc 2.3, warn_unused_result attribute for write()
Igor Sysoev <igor@sysoev.ru>
parents:
2259
diff
changeset
|
108 ngx_write_fd(ngx_fd_t fd, void *buf, size_t n) |
2abf14c952a2
compatibility with glibc 2.3, warn_unused_result attribute for write()
Igor Sysoev <igor@sysoev.ru>
parents:
2259
diff
changeset
|
109 { |
2abf14c952a2
compatibility with glibc 2.3, warn_unused_result attribute for write()
Igor Sysoev <igor@sysoev.ru>
parents:
2259
diff
changeset
|
110 return write(fd, buf, n); |
2abf14c952a2
compatibility with glibc 2.3, warn_unused_result attribute for write()
Igor Sysoev <igor@sysoev.ru>
parents:
2259
diff
changeset
|
111 } |
2abf14c952a2
compatibility with glibc 2.3, warn_unused_result attribute for write()
Igor Sysoev <igor@sysoev.ru>
parents:
2259
diff
changeset
|
112 |
1055 | 113 #define ngx_write_fd_n "write()" |
114 | |
571 | 115 #define ngx_linefeed(p) *p++ = LF; |
116 #define NGX_LINEFEED_SIZE 1 | |
117 | |
118 | |
633 | 119 #define ngx_rename_file(o, n) rename((const char *) o, (const char *) n) |
681 | 120 #define ngx_rename_file_n "rename()" |
170
c42be4185301
nginx-0.0.1-2003-11-03-01:56:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
121 |
c42be4185301
nginx-0.0.1-2003-11-03-01:56:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
122 |
669 | 123 #define ngx_change_file_access(n, a) chmod((const char *) n, a) |
681 | 124 #define ngx_change_file_access_n "chmod()" |
125 | |
126 | |
127 ngx_int_t ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s); | |
128 #define ngx_set_file_time_n "utimes()" | |
669 | 129 |
130 | |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
131 #define ngx_file_info(file, sb) stat((const char *) file, sb) |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
132 #define ngx_file_info_n "stat()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
133 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
134 #define ngx_fd_info(fd, sb) fstat(fd, sb) |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
135 #define ngx_fd_info_n "fstat()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
136 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
137 #define ngx_is_dir(sb) (S_ISDIR((sb)->st_mode)) |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
138 #define ngx_is_file(sb) (S_ISREG((sb)->st_mode)) |
669 | 139 #define ngx_is_link(sb) (S_ISLNK((sb)->st_mode)) |
140 #define ngx_is_exec(sb) ((sb)->st_mode & S_IXUSR) | |
1053
b9fa23cda4cc
ngx_file_access() and ngx_de_access()
Igor Sysoev <igor@sysoev.ru>
parents:
1048
diff
changeset
|
141 #define ngx_file_access(sb) ((sb)->st_mode & 0777) |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
142 #define ngx_file_size(sb) (sb)->st_size |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
143 #define ngx_file_mtime(sb) (sb)->st_mtime |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
144 #define ngx_file_uniq(sb) (sb)->st_ino |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
145 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
146 |
2126
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
147 #if (NGX_HAVE_CASELESS_FILESYSTEM) |
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
148 |
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
149 #define ngx_filename_cmp(s1, s2, n) strncasecmp((char *) s1, (char *) s2, n) |
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
150 |
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
151 #else |
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
152 |
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
153 #define ngx_filename_cmp ngx_memcmp |
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
154 |
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
155 #endif |
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
156 |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
333
diff
changeset
|
157 |
2259 | 158 #define ngx_realpath(p, r) realpath((char *) p, (char *) r) |
159 #define ngx_realpath_n "realpath()" | |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
333
diff
changeset
|
160 #define ngx_getcwd(buf, size) (getcwd(buf, size) != NULL) |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
333
diff
changeset
|
161 #define ngx_getcwd_n "getcwd()" |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
333
diff
changeset
|
162 #define NGX_MAX_PATH PATH_MAX |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
333
diff
changeset
|
163 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
164 #define NGX_DIR_MASK_LEN 0 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
165 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
166 |
467 | 167 ngx_int_t ngx_open_dir(ngx_str_t *name, ngx_dir_t *dir); |
185
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
168 #define ngx_open_dir_n "opendir()" |
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
169 |
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
170 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
171 #define ngx_close_dir(d) closedir((d)->dir) |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
172 #define ngx_close_dir_n "closedir()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
173 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
174 |
2234
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
175 ngx_int_t ngx_read_dir(ngx_dir_t *dir); |
185
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
176 #define ngx_read_dir_n "readdir()" |
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
177 |
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
178 |
669 | 179 #define ngx_create_dir(name, access) mkdir((const char *) name, access) |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
180 #define ngx_create_dir_n "mkdir()" |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
181 |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
182 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
183 #define ngx_delete_dir(name) rmdir((const char *) name) |
185
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
184 #define ngx_delete_dir_n "rmdir()" |
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
185 |
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
186 |
1089
b2e6eb425770
use ngx_dir_access() to enable search bits for directory
Igor Sysoev <igor@sysoev.ru>
parents:
1055
diff
changeset
|
187 #define ngx_dir_access(a) (a | (a & 0444) >> 2) |
b2e6eb425770
use ngx_dir_access() to enable search bits for directory
Igor Sysoev <igor@sysoev.ru>
parents:
1055
diff
changeset
|
188 |
b2e6eb425770
use ngx_dir_access() to enable search bits for directory
Igor Sysoev <igor@sysoev.ru>
parents:
1055
diff
changeset
|
189 |
457 | 190 #define ngx_de_name(dir) ((u_char *) (dir)->de->d_name) |
2234
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
191 #if (NGX_HAVE_D_NAMLEN) |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
192 #define ngx_de_namelen(dir) (dir)->de->d_namlen |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
193 #else |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
194 #define ngx_de_namelen(dir) ngx_strlen((dir)->de->d_name) |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
195 #endif |
497 | 196 #define ngx_de_info(name, dir) stat((const char *) name, &(dir)->info) |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
197 #define ngx_de_info_n "stat()" |
497 | 198 #define ngx_de_link_info(name, dir) lstat((const char *) name, &(dir)->info) |
199 #define ngx_de_link_info_n "lstat()" | |
2234
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
200 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
201 #if (NGX_HAVE_D_TYPE) |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
202 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
203 #define ngx_de_is_dir(dir) ((dir)->type == DT_DIR) |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
204 #define ngx_de_is_file(dir) ((dir)->type == DT_REG) |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
205 #define ngx_de_is_link(dir) ((dir)->type == DT_LINK) |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
206 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
207 #else |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
208 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
209 #define ngx_de_is_dir(dir) (S_ISDIR((dir)->info.st_mode)) |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
210 #define ngx_de_is_file(dir) (S_ISREG((dir)->info.st_mode)) |
497 | 211 #define ngx_de_is_link(dir) (S_ISLNK((dir)->info.st_mode)) |
2234
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
212 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
213 #endif |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
214 |
1053
b9fa23cda4cc
ngx_file_access() and ngx_de_access()
Igor Sysoev <igor@sysoev.ru>
parents:
1048
diff
changeset
|
215 #define ngx_de_access(dir) (((dir)->info.st_mode) & 0777) |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
216 #define ngx_de_size(dir) (dir)->info.st_size |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
217 #define ngx_de_mtime(dir) (dir)->info.st_mtime |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
218 |
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
219 |
727 | 220 ngx_int_t ngx_open_glob(ngx_glob_t *gl); |
221 #define ngx_open_glob_n "glob()" | |
222 ngx_int_t ngx_read_glob(ngx_glob_t *gl, ngx_str_t *name); | |
223 void ngx_close_glob(ngx_glob_t *gl); | |
224 | |
225 | |
611 | 226 ngx_err_t ngx_trylock_fd(ngx_fd_t fd); |
227 ngx_err_t ngx_lock_fd(ngx_fd_t fd); | |
228 ngx_err_t ngx_unlock_fd(ngx_fd_t fd); | |
229 | |
230 #define ngx_trylock_fd_n "fcntl(F_SETLK, F_WRLCK)" | |
231 #define ngx_lock_fd_n "fcntl(F_SETLKW, F_WRLCK)" | |
232 #define ngx_unlock_fd_n "fcntl(F_SETLK, F_UNLCK)" | |
233 | |
234 | |
2129 | 235 #if (NGX_HAVE_O_DIRECT) |
236 | |
2248
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
237 ngx_int_t ngx_directio_on(ngx_fd_t fd); |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
238 #define ngx_directio_on_n "fcntl(O_DIRECT)" |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
239 |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
240 ngx_int_t ngx_directio_off(ngx_fd_t fd); |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
241 #define ngx_directio_off_n "fcntl(!O_DIRECT)" |
2129 | 242 |
243 #elif (NGX_HAVE_F_NOCACHE) | |
244 | |
2248
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
245 #define ngx_directio_on(fd) fcntl(fd, F_NOCACHE, 1) |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
246 #define ngx_directio_on_n "fcntl(F_NOCACHE, 1)" |
2129 | 247 |
2143 | 248 #elif (NGX_HAVE_DIRECTIO) |
249 | |
2248
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
250 #define ngx_directio_on(fd) directio(fd, DIRECTIO_ON) |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
251 #define ngx_directio_on_n "directio(DIRECTIO_ON)" |
2143 | 252 |
2129 | 253 #else |
254 | |
2248
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
255 #define ngx_directio_on(fd) 0 |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
256 #define ngx_directio_on_n "ngx_directio_on_n" |
2129 | 257 |
258 #endif | |
259 | |
260 | |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
6
diff
changeset
|
261 #endif /* _NGX_FILES_H_INCLUDED_ */ |