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

Function setup_context

examples/ucontext-cp.c:93–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93static int setup_context(async_context *pctx, struct io_uring *ring)
94{
95 int ret;
96
97 pctx->ring = ring;
98 ret = getcontext(&pctx->ctx_fnew);
99 if (ret < 0) {
100 perror("getcontext");
101 return -1;
102 }
103 pctx->stack_buf = malloc(SIGSTKSZ);
104 if (!pctx->stack_buf) {
105 perror("malloc");
106 return -1;
107 }
108 pctx->ctx_fnew.uc_stack.ss_sp = pctx->stack_buf;
109 pctx->ctx_fnew.uc_stack.ss_size = SIGSTKSZ;
110 pctx->ctx_fnew.uc_link = &pctx->ctx_main;
111
112 return 0;
113}
114
115static int copy_file(async_context *pctx, int infd, int outfd, struct iovec* piov)
116{

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected