Mercurial > hg > nginx
view src/os/win32/ngx_files.c @ 122:cd91e4a1ad0d
nginx-0.0.1-2003-07-23-17:10:12 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 23 Jul 2003 13:10:12 +0000 |
parents | 7ebc8b7fb816 |
children | b75602822f64 |
line wrap: on
line source
#include <ngx_config.h> #include <ngx_core.h> ssize_t ngx_read_file(ngx_file_t *file, char *buf, size_t size, off_t offset) { size_t n; if (ReadFile(file->fd, buf, size, &n, NULL) == 0) { ngx_log_error(NGX_LOG_ERR, file->log, ngx_errno, "ReadFile() failed"); return NGX_ERROR; } file->offset += n; return n; } int ngx_file_append_mode(ngx_fd_t *fd) { if (SetFilePointer(fd, 0, NULL, FILE_END) == 0xFFFFFFFF) { if (GetLastError() != NO_ERROR) { return NGX_ERROR; } } return NGX_OK; }