Added openat()/fstatat().
Andrey Belov
10 years ago
730 | 730 |
ngx_feature_libs=
|
731 | 731 |
ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)"
|
732 | 732 |
. auto/feature
|
|
733 |
|
|
734 |
|
|
735 |
ngx_feature="openat(), fstatat()"
|
|
736 |
ngx_feature_name="NGX_HAVE_OPENAT"
|
|
737 |
ngx_feature_run=no
|
|
738 |
ngx_feature_incs="#include <sys/types.h>
|
|
739 |
#include <sys/stat.h>
|
|
740 |
#include <fcntl.h>"
|
|
741 |
ngx_feature_path=
|
|
742 |
ngx_feature_libs=
|
|
743 |
ngx_feature_test="struct stat sb;
|
|
744 |
openat(AT_FDCWD, \".\", O_RDONLY|O_NOFOLLOW);
|
|
745 |
fstatat(AT_FDCWD, \".\", &sb, AT_SYMLINK_NOFOLLOW);"
|
|
746 |
. auto/feature
|
47 | 47 |
#define NGX_EILSEQ EILSEQ
|
48 | 48 |
#define NGX_ENOMOREFILES 0
|
49 | 49 |
|
|
50 |
#if (NGX_HAVE_OPENAT)
|
|
51 |
#define NGX_EMLINK EMLINK
|
|
52 |
#define NGX_ELOOP ELOOP
|
|
53 |
#endif
|
|
54 |
|
50 | 55 |
#if (__hpux__)
|
51 | 56 |
#define NGX_EAGAIN EWOULDBLOCK
|
52 | 57 |
#else
|
74 | 74 |
#define NGX_FILE_TRUNCATE O_CREAT|O_TRUNC
|
75 | 75 |
#define NGX_FILE_APPEND O_WRONLY|O_APPEND
|
76 | 76 |
#define NGX_FILE_NONBLOCK O_NONBLOCK
|
|
77 |
|
|
78 |
#if (NGX_HAVE_OPENAT)
|
|
79 |
#define NGX_FILE_NOFOLLOW O_NOFOLLOW
|
|
80 |
#endif
|
77 | 81 |
|
78 | 82 |
#define NGX_FILE_DEFAULT_ACCESS 0644
|
79 | 83 |
#define NGX_FILE_OWNER_ACCESS 0600
|
|
323 | 327 |
size_t ngx_fs_bsize(u_char *name);
|
324 | 328 |
|
325 | 329 |
|
|
330 |
#if (NGX_HAVE_OPENAT)
|
|
331 |
|
|
332 |
#define ngx_openat_file(fd, name, mode, create, access) \
|
|
333 |
openat(fd, (const char *) name, mode|create, access)
|
|
334 |
|
|
335 |
#define ngx_openat_file_n "openat()"
|
|
336 |
|
|
337 |
#define ngx_file_at_info(fd, name, sb, flag) \
|
|
338 |
fstatat(fd, (const char *) name, sb, flag)
|
|
339 |
|
|
340 |
#define ngx_file_at_info_n "fstatat()"
|
|
341 |
|
|
342 |
#endif
|
|
343 |
|
|
344 |
|
326 | 345 |
#define ngx_stderr STDERR_FILENO
|
327 | 346 |
#define ngx_set_stderr(fd) dup2(fd, STDERR_FILENO)
|
328 | 347 |
#define ngx_set_stderr_n "dup2(STDERR_FILENO)"
|