version 1.20, 2010/01/10 21:47:41 |
version 1.21, 2010/01/11 13:06:32 |
|
|
struct safile *f = (struct safile *)file; |
struct safile *f = (struct safile *)file; |
unsigned n; |
unsigned n; |
|
|
n = sio_read(f->hdl, data, count); |
n = f->started ? sio_read(f->hdl, data, count) : 0; |
if (n == 0) { |
if (n == 0) { |
f->file.state &= ~FILE_ROK; |
f->file.state &= ~FILE_ROK; |
if (sio_eof(f->hdl)) { |
if (sio_eof(f->hdl)) { |
|
|
struct safile *f = (struct safile *)file; |
struct safile *f = (struct safile *)file; |
unsigned n; |
unsigned n; |
|
|
n = sio_write(f->hdl, data, count); |
n = f->started ? sio_write(f->hdl, data, count) : 0; |
if (n == 0) { |
if (n == 0) { |
f->file.state &= ~FILE_WOK; |
f->file.state &= ~FILE_WOK; |
if (sio_eof(f->hdl)) { |
if (sio_eof(f->hdl)) { |
|
|
int |
int |
safile_pollfd(struct file *file, struct pollfd *pfd, int events) |
safile_pollfd(struct file *file, struct pollfd *pfd, int events) |
{ |
{ |
|
struct safile *f = (struct safile *)file; |
|
|
|
if (!f->started) |
|
events &= ~(POLLIN | POLLOUT); |
return sio_pollfd(((struct safile *)file)->hdl, pfd, events); |
return sio_pollfd(((struct safile *)file)->hdl, pfd, events); |
} |
} |
|
|