diff options
author | Eric Wong <normalperson@yhbt.net> | 2014-02-15 14:03:10 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2014-02-15 14:03:10 +0000 |
commit | 35dcc336e7c3ae6e89c227ceb486e2f064a564ff (patch) | |
tree | 5989bf506b0360120a1f63de97b0778d9ae54a5d /ext/clogger_ext | |
parent | e7cb48172ca714beb03f858ab73fc60ae0521e78 (diff) | |
download | clogger-35dcc336e7c3ae6e89c227ceb486e2f064a564ff.tar.gz |
The fstat syscall should never take long, even on sockets and slow FSes.
Diffstat (limited to 'ext/clogger_ext')
-rw-r--r-- | ext/clogger_ext/blocking_helpers.h | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/ext/clogger_ext/blocking_helpers.h b/ext/clogger_ext/blocking_helpers.h index dd46cea..bb366ff 100644 --- a/ext/clogger_ext/blocking_helpers.h +++ b/ext/clogger_ext/blocking_helpers.h @@ -18,22 +18,6 @@ static int my_stat(const char *path, struct stat *buf) rb_thread_blocking_region((fn),(data), RUBY_UBF_IO, 0) #endif -struct fstat_args { int fd; struct stat *buf; }; -static VALUE ng_fstat(void *ptr) -{ - struct fstat_args *a = ptr; - return (VALUE)fstat(a->fd, a->buf); -} - -static int my_fstat(int fd, struct stat *buf) -{ - struct fstat_args a; - - a.fd = fd; - a.buf = buf; - return (int)rb_thread_io_blocking_region(ng_fstat, &a, fd); -} - struct write_args { int fd; const void *buf; size_t count; }; static VALUE ng_write(void *ptr) { @@ -53,6 +37,5 @@ static ssize_t my_write(int fd, const void *buf, size_t count) return r; } # define stat(fd,buf) my_stat((fd),(buf)) -# define fstat(fd,buf) my_fstat((fd),(buf)) # define write(fd,buf,count) my_write((fd),(buf),(count)) #endif |