nginx-quic/src/os/unix/ngx_files.h

32 lines
737 B
C
Raw Normal View History

2002-09-02 10:48:24 -04:00
#ifndef _NGX_FILES_H_INCLUDED_
#define _NGX_FILES_H_INCLUDED_
2002-08-20 10:48:28 -04:00
#include <sys/types.h>
#include <sys/stat.h>
2002-08-26 11:18:19 -04:00
typedef int ngx_fd_t;
2002-08-20 10:48:28 -04:00
typedef struct stat ngx_file_info_t;
#define ngx_open_file open
2002-08-23 12:14:30 -04:00
#define ngx_open_file_n "open()"
#define ngx_read_file_n "read()"
2002-08-20 10:48:28 -04:00
#define NGX_FILE_RDONLY O_RDONLY
#define ngx_file_type(file, sb) stat(file, sb)
2002-08-23 12:14:30 -04:00
#define ngx_file_type_n "stat()"
2002-08-20 10:48:28 -04:00
#define ngx_stat_fd(fd, sb) fstat(fd, sb)
2002-08-23 12:14:30 -04:00
#define ngx_stat_fd_n "fstat()"
2002-08-20 10:48:28 -04:00
#define ngx_is_dir(sb) (S_ISDIR(sb.st_mode))
#define ngx_file_size(sb) sb.st_size
#define ngx_file_mtime(sb) sb.st_mtime
2002-09-02 10:48:24 -04:00
#endif /* _NGX_FILES_H_INCLUDED_ */