Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
64bit offsets for fs operations and cleanup uv_fs_* for uv-win
  • Loading branch information
Igor Zinkovsky committed Apr 18, 2012
1 parent 132fe60 commit d5acfd0
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 120 deletions.
22 changes: 14 additions & 8 deletions include/uv-private/uv-win.h
Expand Up @@ -421,20 +421,26 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
HANDLE close_handle;

#define UV_FS_PRIVATE_FIELDS \
wchar_t* pathw; \
int flags; \
DWORD sys_errno_; \
struct _stati64 stat; \
void* arg0; \
union { \
wchar_t* pathw; \
int file; \
}; \
union { \
struct { \
void* arg1; \
void* arg2; \
void* arg3; \
int mode; \
wchar_t* new_pathw; \
int file_flags; \
int file_out; \
void* buf; \
size_t length; \
int64_t offset; \
}; \
struct _stati64 stat; \
struct { \
ssize_t arg4; \
ssize_t arg5; \
double atime; \
double mtime; \
}; \
};

Expand Down
8 changes: 4 additions & 4 deletions include/uv.h
Expand Up @@ -1269,13 +1269,13 @@ UV_EXTERN int uv_fs_open(uv_loop_t* loop, uv_fs_t* req, const char* path,
int flags, int mode, uv_fs_cb cb);

UV_EXTERN int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, uv_file file,
void* buf, size_t length, off_t offset, uv_fs_cb cb);
void* buf, size_t length, int64_t offset, uv_fs_cb cb);

UV_EXTERN int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path,
uv_fs_cb cb);

UV_EXTERN int uv_fs_write(uv_loop_t* loop, uv_fs_t* req, uv_file file,
void* buf, size_t length, off_t offset, uv_fs_cb cb);
void* buf, size_t length, int64_t offset, uv_fs_cb cb);

UV_EXTERN int uv_fs_mkdir(uv_loop_t* loop, uv_fs_t* req, const char* path,
int mode, uv_fs_cb cb);
Expand All @@ -1302,10 +1302,10 @@ UV_EXTERN int uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file,
uv_fs_cb cb);

UV_EXTERN int uv_fs_ftruncate(uv_loop_t* loop, uv_fs_t* req, uv_file file,
off_t offset, uv_fs_cb cb);
int64_t offset, uv_fs_cb cb);

UV_EXTERN int uv_fs_sendfile(uv_loop_t* loop, uv_fs_t* req, uv_file out_fd,
uv_file in_fd, off_t in_offset, size_t length, uv_fs_cb cb);
uv_file in_fd, int64_t in_offset, size_t length, uv_fs_cb cb);

UV_EXTERN int uv_fs_chmod(uv_loop_t* loop, uv_fs_t* req, const char* path,
int mode, uv_fs_cb cb);
Expand Down
8 changes: 4 additions & 4 deletions src/unix/fs.c
Expand Up @@ -215,7 +215,7 @@ int uv_fs_open(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags,


int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, uv_file fd, void* buf,
size_t length, off_t offset, uv_fs_cb cb) {
size_t length, int64_t offset, uv_fs_cb cb) {
uv_fs_req_init(loop, req, UV_FS_READ, NULL, cb);

if (cb) {
Expand Down Expand Up @@ -253,7 +253,7 @@ int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) {


int uv_fs_write(uv_loop_t* loop, uv_fs_t* req, uv_file file, void* buf,
size_t length, off_t offset, uv_fs_cb cb) {
size_t length, int64_t offset, uv_fs_cb cb) {
uv_fs_req_init(loop, req, UV_FS_WRITE, NULL, cb);

if (cb) {
Expand Down Expand Up @@ -461,15 +461,15 @@ int uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {
}


int uv_fs_ftruncate(uv_loop_t* loop, uv_fs_t* req, uv_file file, off_t offset,
int uv_fs_ftruncate(uv_loop_t* loop, uv_fs_t* req, uv_file file, int64_t offset,
uv_fs_cb cb) {
char* path = NULL;
WRAP_EIO(UV_FS_FTRUNCATE, eio_ftruncate, ftruncate, ARGS2(file, offset))
}


int uv_fs_sendfile(uv_loop_t* loop, uv_fs_t* req, uv_file out_fd, uv_file in_fd,
off_t in_offset, size_t length, uv_fs_cb cb) {
int64_t in_offset, size_t length, uv_fs_cb cb) {
char* path = NULL;
WRAP_EIO(UV_FS_SENDFILE, eio_sendfile, eio_sendfile_sync,
ARGS4(out_fd, in_fd, in_offset, length))
Expand Down

0 comments on commit d5acfd0

Please sign in to comment.