Klaus Demo nginx / 71205c3
Added openat()/fstatat(). Andrey Belov 10 years ago
3 changed file(s) with 38 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
730730 ngx_feature_libs=
731731 ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)"
732732 . 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
4747 #define NGX_EILSEQ EILSEQ
4848 #define NGX_ENOMOREFILES 0
4949
50 #if (NGX_HAVE_OPENAT)
51 #define NGX_EMLINK EMLINK
52 #define NGX_ELOOP ELOOP
53 #endif
54
5055 #if (__hpux__)
5156 #define NGX_EAGAIN EWOULDBLOCK
5257 #else
7474 #define NGX_FILE_TRUNCATE O_CREAT|O_TRUNC
7575 #define NGX_FILE_APPEND O_WRONLY|O_APPEND
7676 #define NGX_FILE_NONBLOCK O_NONBLOCK
77
78 #if (NGX_HAVE_OPENAT)
79 #define NGX_FILE_NOFOLLOW O_NOFOLLOW
80 #endif
7781
7882 #define NGX_FILE_DEFAULT_ACCESS 0644
7983 #define NGX_FILE_OWNER_ACCESS 0600
323327 size_t ngx_fs_bsize(u_char *name);
324328
325329
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
326345 #define ngx_stderr STDERR_FILENO
327346 #define ngx_set_stderr(fd) dup2(fd, STDERR_FILENO)
328347 #define ngx_set_stderr_n "dup2(STDERR_FILENO)"