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

Function open_files

test/file-register.c:38–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38static int *open_files(int nr_files, int extra, int add)
39{
40 char fname[32];
41 int *files;
42 int i;
43
44 files = t_calloc(nr_files + extra, sizeof(int));
45
46 for (i = 0; i < nr_files; i++) {
47 if (!add)
48 sprintf(fname, ".reg.%d", i);
49 else
50 sprintf(fname, ".add.%d", i + add);
51 files[i] = open(fname, O_RDWR | O_CREAT, 0644);
52 if (files[i] < 0) {
53 perror("open");
54 free(files);
55 files = NULL;
56 break;
57 }
58 }
59 if (extra) {
60 for (i = nr_files; i < nr_files + extra; i++)
61 files[i] = -1;
62 }
63
64 return files;
65}
66
67static int test_shrink(struct io_uring *ring)
68{

Callers 12

test_shrinkFunction · 0.70
test_growFunction · 0.70
test_replace_allFunction · 0.70
test_replaceFunction · 0.70
test_removalsFunction · 0.70
test_additionsFunction · 0.70
test_sparseFunction · 0.70
test_basic_manyFunction · 0.70
test_basicFunction · 0.70
test_zeroFunction · 0.70
test_hugeFunction · 0.70
test_skipFunction · 0.70

Calls 1

t_callocFunction · 0.85

Tested by 12

test_shrinkFunction · 0.56
test_growFunction · 0.56
test_replace_allFunction · 0.56
test_replaceFunction · 0.56
test_removalsFunction · 0.56
test_additionsFunction · 0.56
test_sparseFunction · 0.56
test_basic_manyFunction · 0.56
test_basicFunction · 0.56
test_zeroFunction · 0.56
test_hugeFunction · 0.56
test_skipFunction · 0.56