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

Function __t_create_file

test/helpers.c:77–94  ·  view source on GitHub ↗

* Helper for creating file and write @size byte buf with 0xaa value in the file. */

Source from the content-addressed store, hash-verified

75 * Helper for creating file and write @size byte buf with 0xaa value in the file.
76 */
77static void __t_create_file(const char *file, size_t size, char pattern)
78{
79 ssize_t ret;
80 char *buf;
81 int fd;
82
83 buf = t_malloc(size);
84 memset(buf, pattern, size);
85
86 fd = open(file, O_WRONLY | O_CREAT, 0644);
87 assert(fd >= 0);
88
89 ret = write(fd, buf, size);
90 fsync(fd);
91 close(fd);
92 free(buf);
93 assert(ret == size);
94}
95
96void t_create_file(const char *file, size_t size)
97{

Callers 2

t_create_fileFunction · 0.85
t_create_file_patternFunction · 0.85

Calls 1

t_mallocFunction · 0.85

Tested by

no test coverage detected