1: size_t my_read(php_stream *stream,
2: char *buf, size_t count TSRMLS_DC)
3: {
4: int readret;
5: struct my_stream_data *data = stream->abstract;
6: readret = read(data->filedes, buf, count);
7: if (readret <= 0) {
8: return 0;
9: }
10: return readret;
11: }
12:
13: size_t my_write(php_stream *stream,
14: const char *buf, size_t count TSRMLS_DC)
15: {
16: int wrote;
17: struct my_stream_data *data = stream->abstract;
18: wrote = write(data->filedes, buf, count);
19: if (wrote <= 0) {
20: return 0;
21: }
22: return wrote;
23: }