data is sent to the kernel using write(2). fsync'ing a
file descriptor is not required -- writing to a fd has the same
affect as calling fflush after each fwrite.
assert(data != NULL);
- if (data->fd >= 0) {
- return fsync(data->fd);
- } else {
+ /*
+ * stdio buffers data in user land. By calling fflush(3), this
+ * data is send to the kernel using write(2). fsync'ing is
+ * something completely different.
+ */
+ if (data->fd < 0) {
return fflush(data->file);
}
+ return 0;
}
static int php_stdiop_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC)