MCPcopy Create free account
hub / github.com/axboe/liburing / setup_send_zc

Function setup_send_zc

examples/proxy.c:423–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423static int setup_send_zc(struct io_uring *ring, struct conn *c)
424{
425 struct iovec *iovs;
426 void *buf;
427 int i, ret;
428
429 if (snd_msg)
430 return 0;
431
432 buf = c->in_br.buf;
433 iovs = calloc(nr_bufs, sizeof(struct iovec));
434 for (i = 0; i < nr_bufs; i++) {
435 iovs[i].iov_base = buf;
436 iovs[i].iov_len = buf_size;
437 buf += buf_size;
438 }
439
440 ret = io_uring_register_buffers(ring, iovs, nr_bufs);
441 if (ret) {
442 fprintf(stderr, "failed registering buffers: %d\n", ret);
443 free(iovs);
444 return ret;
445 }
446 free(iovs);
447 return 0;
448}
449
450/*
451 * Setup an input and output buffer ring.

Callers 1

setup_buffer_ringsFunction · 0.85

Calls 1

Tested by

no test coverage detected