Home | History | Annotate | Download | only in memfd_create

Lines Matching refs:filename

42 int check_fallocate(const char *filename, const int lineno, int fd,
49 tst_brk_(filename, lineno, TFAIL | TERRNO,
54 tst_res_(filename, lineno, TPASS,
61 int check_fallocate_fail(const char *filename, const int lineno, int fd,
68 tst_res_(filename, lineno, TFAIL,
75 tst_res_(filename, lineno, TPASS | TERRNO,
82 void check_ftruncate(const char *filename, const int lineno, int fd,
85 safe_ftruncate(filename, lineno, fd, length);
87 tst_res_(filename, lineno, TPASS, "ftruncate(%d, %ld) succeeded", fd,
91 void check_ftruncate_fail(const char *filename, const int lineno,
95 tst_res_(filename, lineno, TFAIL,
102 tst_res_(filename, lineno, TPASS | TERRNO,
106 int get_mfd_all_available_flags(const char *filename, const int lineno)
114 tst_brk_(filename, lineno, TCONF,
128 int mfd_flags_available(const char *filename, const int lineno,
134 tst_brk_(filename, lineno, TBROK | TTERRNO,
146 int check_mfd_new(const char *filename, const int lineno,
153 tst_brk_(filename, lineno, TBROK | TERRNO,
157 tst_res_(filename, lineno, TPASS, "memfd_create(%s, %d) succeeded",
160 check_ftruncate(filename, lineno, fd, sz);
165 void check_mfd_fail_new(const char *filename, const int lineno,
172 safe_close(filename, lineno, NULL, fd);
173 tst_brk_(filename, lineno, TFAIL,
178 tst_res_(filename, lineno, TPASS | TERRNO,
245 void check_mfd_fail_add_seals(const char *filename, const int lineno,
249 tst_brk_(filename, lineno, TFAIL,
253 tst_res_(filename, lineno, TPASS | TERRNO,
258 void check_mfd_size(const char *filename, const int lineno, int fd,
263 safe_fstat(filename, lineno, fd, &st);
266 tst_brk_(filename, lineno, TFAIL,
270 tst_res_(filename, lineno, TPASS,
274 int check_mfd_open(const char *filename, const int lineno, int fd,
282 r = safe_open(filename, lineno, NULL, buf, flags, mode);
284 tst_res_(filename, lineno, TPASS, "open(%s, %d, %d) succeeded", buf,
290 void check_mfd_fail_open(const char *filename, const int lineno, int fd,
299 safe_close(filename, lineno, NULL, fd);
300 tst_res_(filename, lineno, TFAIL,
304 tst_res_(filename, lineno, TPASS | TERRNO,
310 void check_mfd_readable(const char *filename, const int lineno, int fd)
315 safe_read(filename, lineno, NULL, 1, fd, buf, sizeof(buf));
316 tst_res_(filename, lineno, TPASS, "read(%d, %s, %zu) succeeded", fd,
320 p = check_mmap(filename, lineno, NULL, MFD_DEF_SIZE, PROT_READ,
323 check_munmap(filename, lineno, p, MFD_DEF_SIZE);
326 p = check_mmap(filename, lineno, NULL, MFD_DEF_SIZE,
329 check_munmap(filename, lineno, p, MFD_DEF_SIZE);
332 void check_mfd_writeable(const char *filename, const int lineno, int fd)
337 safe_write(filename, lineno, NULL, 1, fd, "\0\0\0\0", 4);
338 tst_res_(filename, lineno, TPASS, "write(%d, %s, %d) succeeded", fd,
342 p = check_mmap(filename, lineno, NULL, MFD_DEF_SIZE,
346 check_munmap(filename, lineno, p, MFD_DEF_SIZE);
349 p = check_mmap(filename, lineno, NULL, MFD_DEF_SIZE,
353 check_munmap(filename, lineno, p, MFD_DEF_SIZE);
358 p = check_mmap(filename, lineno, NULL, MFD_DEF_SIZE,
361 check_mprotect(filename, lineno, p, MFD_DEF_SIZE,
365 check_munmap(filename, lineno, p, MFD_DEF_SIZE);
368 check_fallocate(filename, lineno, fd,
373 void check_mfd_non_writeable(const char *filename, const int lineno,
382 tst_brk_(filename, lineno, TFAIL | TTERRNO,
386 tst_brk_(filename, lineno, TFAIL,
389 tst_res_(filename, lineno, TPASS | TTERRNO, "write failed as expected");
392 check_mmap_fail(filename, lineno, NULL, MFD_DEF_SIZE,
396 check_mmap_fail(filename, lineno, NULL, MFD_DEF_SIZE,
405 tst_brk_(filename, lineno, TFAIL | TERRNO,
411 check_fallocate_fail(filename, lineno, fd,
416 void check_mfd_shrinkable(const char *filename, const int lineno, int fd)
420 check_ftruncate(filename, lineno, fd, MFD_DEF_SIZE / 2);
421 check_mfd_size(filename, lineno, fd, MFD_DEF_SIZE / 2);
423 fd2 = check_mfd_open(filename, lineno, fd,
425 safe_close(filename, lineno, NULL, fd2);
427 check_mfd_size(filename, lineno, fd, 0);
430 void check_mfd_non_shrinkable(const char *filename, const int lineno, int fd)
432 check_ftruncate_fail(filename, lineno, fd, MFD_DEF_SIZE / 2);
433 check_mfd_fail_open(filename, lineno, fd,
437 void check_mfd_growable(const char *filename, const int lineno, int fd)
439 check_ftruncate(filename, lineno, fd, MFD_DEF_SIZE * 2);
440 check_mfd_size(filename, lineno, fd, MFD_DEF_SIZE * 2);
442 check_fallocate(filename, lineno, fd, 0, 0, MFD_DEF_SIZE * 4);
443 check_mfd_size(filename, lineno, fd, MFD_DEF_SIZE * 4);
446 void check_mfd_non_growable(const char *filename, const int lineno, int fd)
448 check_ftruncate_fail(filename, lineno, fd, MFD_DEF_SIZE * 2);
449 check_fallocate_fail(filename, lineno, fd, 0, 0, MFD_DEF_SIZE * 4);
452 void check_mfd_growable_by_write(const char *filename, const int lineno, int fd)
457 tst_res_(filename, lineno, TFAIL | TERRNO,
464 tst_res_(filename, lineno, TPASS, "pwrite(%d, %s, %zu, %d) succeeded",
467 check_mfd_size(filename, lineno, fd, MFD_DEF_SIZE * 8);
470 void check_mfd_non_growable_by_write(const char *filename, const int lineno,
476 tst_res_(filename, lineno, TFAIL,
483 tst_res_(filename, lineno, TPASS, "pwrite(%d, %s, %zu, %d) succeeded",