diff options
author | Andrey Belov <defan@nginx.com> | 2012-02-13 20:13:21 +0400 |
---|---|---|
committer | Andrey Belov <defan@nginx.com> | 2012-02-13 20:13:21 +0400 |
commit | 71205c3fbc530ec810e18b0cfb6f8db5bb8d1cd1 (patch) | |
tree | 6a6c614abe64bd017a0ab803960a5b660806dc4a /src/os/unix/ngx_files.h | |
parent | 9f38b20db50a22b434d35c9bf3c5b08d5ddfbd8b (diff) |
Added openat()/fstatat().
Diffstat (limited to 'src/os/unix/ngx_files.h')
-rw-r--r-- | src/os/unix/ngx_files.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h index abeb1570b..1526f9b77 100644 --- a/src/os/unix/ngx_files.h +++ b/src/os/unix/ngx_files.h @@ -76,6 +76,10 @@ typedef struct { #define NGX_FILE_APPEND O_WRONLY|O_APPEND #define NGX_FILE_NONBLOCK O_NONBLOCK +#if (NGX_HAVE_OPENAT) +#define NGX_FILE_NOFOLLOW O_NOFOLLOW +#endif + #define NGX_FILE_DEFAULT_ACCESS 0644 #define NGX_FILE_OWNER_ACCESS 0600 @@ -324,6 +328,21 @@ ngx_int_t ngx_directio_off(ngx_fd_t fd); size_t ngx_fs_bsize(u_char *name); +#if (NGX_HAVE_OPENAT) + +#define ngx_openat_file(fd, name, mode, create, access) \ + openat(fd, (const char *) name, mode|create, access) + +#define ngx_openat_file_n "openat()" + +#define ngx_file_at_info(fd, name, sb, flag) \ + fstatat(fd, (const char *) name, sb, flag) + +#define ngx_file_at_info_n "fstatat()" + +#endif + + #define ngx_stderr STDERR_FILENO #define ngx_set_stderr(fd) dup2(fd, STDERR_FILENO) #define ngx_set_stderr_n "dup2(STDERR_FILENO)" |