78 #include <sys/types.h> 93 #define HPCIO_OUTBUF_MAGIC 0x494F4246 106 ssize_t amt_done, ret;
109 while (amt_done < outbuf->in_use) {
112 outbuf->
in_use - amt_done);
115 if (ret > 0 || (ret == 0 && errno == EINTR)) {
127 outbuf->
in_use - amt_done);
128 outbuf->
in_use = amt_done;
149 void *buf_start,
size_t buf_size,
int flags)
153 if (outbuf ==
NULL || fd < 0 || buf_start ==
NULL || buf_size == 0) {
162 outbuf->
flags = flags;
177 size_t amt, amt_done;
187 while (amt_done < size) {
253 && close(outbuf->
fd) == 0) {
ssize_t MONITOR_EXT_WRAP_NAME() write(int fd, const void *buf, size_t count)
ssize_t hpcio_outbuf_write(hpcio_outbuf_t *outbuf, const void *data, size_t size)
static void spinlock_unlock(spinlock_t *l)
#define HPCIO_OUTBUF_MAGIC
int hpcio_outbuf_close(hpcio_outbuf_t *outbuf)
static void spinlock_lock(spinlock_t *l)
static int outbuf_flush_buffer(hpcio_outbuf_t *outbuf)
int hpcio_outbuf_attach(hpcio_outbuf_t *outbuf, int fd, void *buf_start, size_t buf_size, int flags)
#define HPCIO_OUTBUF_LOCKED
int hpcio_outbuf_flush(hpcio_outbuf_t *outbuf)