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

Function main

examples/proxy.c:2357–2530  ·  view source on GitHub ↗

* Options parsing the ring / net setup */

Source from the content-addressed store, hash-verified

2355 * Options parsing the ring / net setup
2356 */
2357int main(int argc, char *argv[])
2358{
2359 struct io_uring ring;
2360 struct sigaction sa = { };
2361 const char *optstring;
2362 int opt, ret, fd;
2363
2364 setlocale(LC_NUMERIC, "en_US");
2365
2366 page_size = sysconf(_SC_PAGESIZE);
2367 if (page_size < 0) {
2368 perror("sysconf(_SC_PAGESIZE)");
2369 return 1;
2370 }
2371
2372 pthread_mutex_init(&thread_lock, NULL);
2373
2374 optstring = "m:d:S:s:b:f:H:r:p:n:B:N:T:w:t:M:R:u:c:C:q:a:x:z:i:6Vh?";
2375 while ((opt = getopt(argc, argv, optstring)) != -1) {
2376 switch (opt) {
2377 case 'm':
2378 recv_mshot = !!atoi(optarg);
2379 break;
2380 case 'S':
2381 sqpoll = !!atoi(optarg);
2382 break;
2383 case 'd':
2384 defer_tw = !!atoi(optarg);
2385 break;
2386 case 'b':
2387 buf_size = atoi(optarg);
2388 break;
2389 case 'n':
2390 nr_bufs = atoi(optarg);
2391 break;
2392 case 'u':
2393 send_ring = !!atoi(optarg);
2394 break;
2395 case 'c':
2396 rcv_bundle = !!atoi(optarg);
2397 break;
2398 case 'C':
2399 snd_bundle = !!atoi(optarg);
2400 break;
2401 case 'w':
2402 wait_batch = atoi(optarg);
2403 break;
2404 case 't':
2405 wait_usec = atoi(optarg);
2406 break;
2407 case 's':
2408 is_sink = !!atoi(optarg);
2409 break;
2410 case 'f':
2411 fixed_files = !!atoi(optarg);
2412 break;
2413 case 'H':
2414 host = strdup(optarg);

Callers

nothing calls this directly

Calls 5

setup_listening_socketFunction · 0.85
init_ringFunction · 0.85
parent_loopFunction · 0.85
usageFunction · 0.70
sigactionClass · 0.70

Tested by

no test coverage detected