1: int my_flush(php_stream *stream TSRMLS_DC)
2: {
3: struct my_stream_data *data = stream->abstract;
4:
5: return fsync(data->fildes);
6: }
7:
8: int my_seek(php_stream *stream,
9: off_t offset, int whence, off_t *newoffset TSRMLS_DC)
10: {
11: int seekret;
12: struct my_stream_data *data = stream->abstract;
13:
14: seekret = lseek(data->filedes, offset, whence);
15: if (seekret == (off_t)-1) {
16: return -1;
17: }
18: *newoffset = seekret;
19: return 0;
20: }