/third_party/ltp/include/old/ |
D | safe_macros.h | 23 #define SAFE_BASENAME(cleanup_fn, path) \ argument 24 safe_basename(__FILE__, __LINE__, (cleanup_fn), (path)) 26 #define SAFE_CHDIR(cleanup_fn, path) \ argument 27 safe_chdir(__FILE__, __LINE__, (cleanup_fn), (path)) 29 #define SAFE_CLOSE(cleanup_fn, fd) ({ \ argument 30 int ret = safe_close(__FILE__, __LINE__, (cleanup_fn), (fd)); \ 35 #define SAFE_CREAT(cleanup_fn, pathname, mode) \ argument 36 safe_creat(__FILE__, __LINE__, cleanup_fn, (pathname), (mode)) 38 #define SAFE_DIRNAME(cleanup_fn, path) \ argument 39 safe_dirname(__FILE__, __LINE__, (cleanup_fn), (path)) [all …]
|
D | old_checkpoint.h | 40 #define TST_CHECKPOINT_INIT(cleanup_fn) \ argument 41 tst_checkpoint_init(__FILE__, __LINE__, cleanup_fn) 43 #define TST_SAFE_CHECKPOINT_WAIT(cleanup_fn, id) \ argument 44 tst_safe_checkpoint_wait(__FILE__, __LINE__, cleanup_fn, id, 0); 46 #define TST_SAFE_CHECKPOINT_WAIT2(cleanup_fn, id, msec_timeout) \ argument 47 tst_safe_checkpoint_wait(__FILE__, __LINE__, cleanup_fn, id, msec_timeout); 49 #define TST_SAFE_CHECKPOINT_WAKE(cleanup_fn, id) \ argument 50 tst_safe_checkpoint_wake(__FILE__, __LINE__, cleanup_fn, id, 1); 52 #define TST_SAFE_CHECKPOINT_WAKE2(cleanup_fn, id, nr_wake) \ argument 53 tst_safe_checkpoint_wake(__FILE__, __LINE__, cleanup_fn, id, nr_wake); [all …]
|
D | old_safe_net.h | 30 #define SAFE_SOCKET(cleanup_fn, domain, type, protocol) \ argument 31 safe_socket(__FILE__, __LINE__, (cleanup_fn), domain, type, protocol) 33 #define SAFE_BIND(cleanup_fn, socket, address, address_len) \ argument 34 safe_bind(__FILE__, __LINE__, (cleanup_fn), socket, address, \ 37 #define SAFE_LISTEN(cleanup_fn, socket, backlog) \ argument 38 safe_listen(__FILE__, __LINE__, (cleanup_fn), socket, backlog) 40 #define SAFE_CONNECT(cleanup_fn, sockfd, addr, addrlen) \ argument 41 safe_connect(__FILE__, __LINE__, (cleanup_fn), sockfd, addr, addrlen) 43 #define SAFE_GETSOCKNAME(cleanup_fn, sockfd, addr, addrlen) \ argument 44 safe_getsockname(__FILE__, __LINE__, (cleanup_fn), sockfd, addr, \ [all …]
|
D | old_safe_file_ops.h | 37 #define SAFE_FILE_SCANF(cleanup_fn, path, fmt, ...) \ argument 38 safe_file_scanf(__FILE__, __LINE__, (cleanup_fn), \ 41 #define FILE_LINES_SCANF(cleanup_fn, path, fmt, ...) \ argument 42 file_lines_scanf(__FILE__, __LINE__, (cleanup_fn), 0, \ 45 #define SAFE_FILE_LINES_SCANF(cleanup_fn, path, fmt, ...) \ argument 46 file_lines_scanf(__FILE__, __LINE__, (cleanup_fn), 1, \ 53 #define SAFE_FILE_PRINTF(cleanup_fn, path, fmt, ...) \ argument 54 safe_file_printf(__FILE__, __LINE__, (cleanup_fn), \ 57 #define SAFE_CP(cleanup_fn, src, dst) \ argument 58 safe_cp(__FILE__, __LINE__, (cleanup_fn), (src), (dst)) [all …]
|
D | old_module.h | 37 void tst_module_exists_(void (cleanup_fn)(void), const char *mod_name, 40 void tst_module_load_(void (cleanup_fn)(void), const char *mod_name, 43 void tst_module_unload_(void (cleanup_fn)(void), const char *mod_name); 55 static inline void tst_module_exists(void (cleanup_fn)(void), in tst_module_exists() 58 tst_module_exists_(cleanup_fn, mod_name, mod_path); in tst_module_exists() 72 static inline void tst_module_load(void (cleanup_fn)(void), in tst_module_load() 75 tst_module_load_(cleanup_fn, mod_name, argv); in tst_module_load() 84 static inline void tst_module_unload(void (cleanup_fn)(void), const char *mod_name) in tst_module_unload() 86 tst_module_unload_(cleanup_fn, mod_name); in tst_module_unload()
|
D | old_safe_stdio.h | 25 #define SAFE_FOPEN(cleanup_fn, path, mode) \ argument 26 safe_fopen(__FILE__, __LINE__, cleanup_fn, path, mode) 28 #define SAFE_FCLOSE(cleanup_fn, f) \ argument 29 safe_fclose(__FILE__, __LINE__, cleanup_fn, f) 31 #define SAFE_ASPRINTF(cleanup_fn, strp, fmt, ...) \ argument 32 safe_asprintf(__FILE__, __LINE__, cleanup_fn, strp, fmt, __VA_ARGS__) 34 #define SAFE_POPEN(cleanup_fn, command, type) \ argument 35 safe_popen(__FILE__, __LINE__, cleanup_fn, command, type)
|
D | old_resource.h | 47 #define TST_RESOURCE_COPY(cleanup_fn, filename, dest) \ argument 48 tst_resource_copy(__FILE__, __LINE__, (cleanup_fn), \ 52 void (*cleanup_fn)(void),
|
D | old_device.h | 46 const char *tst_acquire_device_(void (cleanup_fn)(void), unsigned int size); 50 static inline const char *tst_acquire_device(void (cleanup_fn)(void)) in tst_acquire_device() 52 return tst_acquire_device_(cleanup_fn, 0); in tst_acquire_device()
|
/third_party/ltp/include/ |
D | safe_macros_fn.h | 40 void (*cleanup_fn)(void), char *path); 43 void (*cleanup_fn)(void), const char *path); 46 void (*cleanup_fn)(void), int fildes); 49 void (*cleanup_fn)(void), const char *pathname, mode_t mode); 52 void (*cleanup_fn)(void), char *path); 55 void (*cleanup_fn)(void), char *buf, size_t size); 58 void (*cleanup_fn)(void), const char *name); 61 void (*cleanup_fn)(void), int who, struct rusage *usage); 64 void (*cleanup_fn)(void), size_t size); 67 void (*cleanup_fn)(void), const char *pathname, mode_t mode); [all …]
|
D | tst_pid.h | 13 pid_t tst_get_unused_pid_(void (*cleanup_fn)(void)); 21 int tst_get_free_pids_(void (*cleanup_fn)(void)); 34 static inline pid_t tst_get_unused_pid(void (*cleanup_fn)(void)) in tst_get_unused_pid() 36 return tst_get_unused_pid_(cleanup_fn); in tst_get_unused_pid() 39 static inline int tst_get_free_pids(void (*cleanup_fn)(void)) in tst_get_free_pids() 41 return tst_get_free_pids_(cleanup_fn); in tst_get_free_pids()
|
D | tst_cmd.h | 30 int tst_cmd_fds_(void (cleanup_fn)(void), 43 int tst_cmd_(void (cleanup_fn)(void), 68 static inline int tst_cmd_fds(void (cleanup_fn)(void), in tst_cmd_fds() 74 return tst_cmd_fds_(cleanup_fn, argv, in tst_cmd_fds() 78 static inline int tst_cmd(void (cleanup_fn)(void), in tst_cmd() 84 return tst_cmd_(cleanup_fn, argv, in tst_cmd()
|
D | safe_file_ops_fn.h | 44 void (*cleanup_fn)(void), 49 void (*cleanup_fn)(void), int strict, 61 void (*cleanup_fn)(void), 66 void (*cleanup_fn)(void), const char *path, const char *fmt, ...) 73 void (*cleanup_fn)(void), 89 void (*cleanup_fn)(void),
|
D | safe_net_fn.h | 28 int safe_socket(const char *file, const int lineno, void (cleanup_fn)(void), 56 int safe_bind(const char *file, const int lineno, void (cleanup_fn)(void), 60 int safe_listen(const char *file, const int lineno, void (cleanup_fn)(void), 63 int safe_accept(const char *file, const int lineno, void (cleanup_fn)(void), 66 int safe_connect(const char *file, const int lineno, void (cleanup_fn)(void), 70 void (cleanup_fn)(void), int sockfd, struct sockaddr *addr, 82 void (cleanup_fn)(void), unsigned short family, int type);
|
D | safe_stdio_fn.h | 23 FILE *safe_fopen(const char *file, const int lineno, void (cleanup_fn)(void), 26 int safe_fclose(const char *file, const int lineno, void (cleanup_fn)(void), 29 int safe_asprintf(const char *file, const int lineno, void (cleanup_fn)(void), 32 FILE *safe_popen(const char *file, const int lineno, void (cleanup_fn)(void),
|
/third_party/ltp/lib/ |
D | safe_macros.c | 29 void (*cleanup_fn) (void), char *path) in safe_basename() 36 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_basename() 44 safe_chdir(const char *file, const int lineno, void (*cleanup_fn) (void), in safe_chdir() 52 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_chdir() 55 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_chdir() 63 safe_close(const char *file, const int lineno, void (*cleanup_fn) (void), in safe_close() 71 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_close() 74 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_close() 82 safe_creat(const char *file, const int lineno, void (*cleanup_fn) (void), in safe_creat() 90 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_creat() [all …]
|
D | safe_file_ops.c | 121 void (*cleanup_fn) (void), in safe_file_scanf() 131 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_file_scanf() 143 tst_brkm_(file, lineno, TBROK, cleanup_fn, in safe_file_scanf() 149 tst_brkm_(file, lineno, TBROK, cleanup_fn, in safe_file_scanf() 156 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_file_scanf() 169 void (*cleanup_fn)(void), int strict, in file_lines_scanf() 179 tst_brkm_(file, lineno, TBROK, cleanup_fn, "pattern is NULL"); in file_lines_scanf() 185 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in file_lines_scanf() 203 tst_brkm_(file, lineno, TBROK, cleanup_fn, in file_lines_scanf() 254 void (*cleanup_fn)(void), const char *path, const char *fmt, in safe_file_vprintf() [all …]
|
D | tst_pid.c | 42 pid_t tst_get_unused_pid_(void (*cleanup_fn) (void)) in tst_get_unused_pid_() 46 SAFE_FILE_SCANF(cleanup_fn, PID_MAX_PATH, "%d", &pid); in tst_get_unused_pid_() 73 void (*cleanup_fn) (void)) in read_session_pids_limit() 88 SAFE_FILE_SCANF(cleanup_fn, path, "%s", max_pid_value); in read_session_pids_limit() 90 SAFE_FILE_SCANF(cleanup_fn, PID_MAX_PATH, "%d", &max_pids); in read_session_pids_limit() 100 static int get_session_pids_limit(void (*cleanup_fn) (void)) in get_session_pids_limit() 105 max_pids = read_session_pids_limit(CGROUPS_V2_SLICE_FMT, uid, cleanup_fn); in get_session_pids_limit() 108 cleanup_fn); in get_session_pids_limit() 116 static int get_used_pids(void (*cleanup_fn) (void)) in get_used_pids() 128 if (!FILE_LINES_SCANF(cleanup_fn, status_path, "Threads: %d", &used_threads)) in get_used_pids() [all …]
|
D | tst_checkpoint.c | 39 void (*cleanup_fn)(void)) in tst_checkpoint_init() 45 tst_brkm_(file, lineno, TBROK, cleanup_fn, in tst_checkpoint_init() 61 if (cleanup_fn && !tst_tmpdir_created()) { in tst_checkpoint_init() 62 tst_brkm_(file, lineno, TBROK, cleanup_fn, in tst_checkpoint_init() 70 fd = SAFE_OPEN(cleanup_fn, "checkpoint_futex_base_file", in tst_checkpoint_init() 73 SAFE_FTRUNCATE(cleanup_fn, fd, page_size); in tst_checkpoint_init() 75 tst_futexes = SAFE_MMAP(cleanup_fn, NULL, page_size, in tst_checkpoint_init() 80 SAFE_CLOSE(cleanup_fn, fd); in tst_checkpoint_init() 140 void (*cleanup_fn)(void), unsigned int id, in tst_safe_checkpoint_wait() 151 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in tst_safe_checkpoint_wait() [all …]
|
D | safe_stdio.c | 26 FILE *safe_fopen(const char *file, const int lineno, void (cleanup_fn)(void), in safe_fopen() 32 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_fopen() 39 int safe_fclose(const char *file, const int lineno, void (cleanup_fn)(void), in safe_fclose() 47 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_fclose() 50 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_fclose() 57 int safe_asprintf(const char *file, const int lineno, void (cleanup_fn)(void), in safe_asprintf() 68 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_asprintf() 71 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_asprintf() 78 FILE *safe_popen(const char *file, const int lineno, void (cleanup_fn)(void), in safe_popen() 89 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_popen() [all …]
|
D | safe_net.c | 108 int safe_socket(const char *file, const int lineno, void (cleanup_fn)(void), in safe_socket() 128 tst_brkm_(file, lineno, ttype | TERRNO, cleanup_fn, in safe_socket() 131 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_socket() 325 int safe_bind(const char *file, const int lineno, void (cleanup_fn)(void), in safe_bind() 339 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_bind() 345 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_bind() 360 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_bind() 367 int safe_listen(const char *file, const int lineno, void (cleanup_fn)(void), in safe_listen() 378 tst_brkm_(file, lineno, res | TERRNO, cleanup_fn, in safe_listen() 381 tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn, in safe_listen() [all …]
|
D | tst_module.c | 31 void tst_module_exists_(void (cleanup_fn)(void), in tst_module_exists_() 47 tst_brkm(TBROK | TERRNO, cleanup_fn, in tst_module_exists_() 59 tst_brkm(TBROK | TERRNO, cleanup_fn, in tst_module_exists_() 69 tst_brkm(TCONF, cleanup_fn, "Failed to find module '%s'", in tst_module_exists_() 80 void tst_module_load_(void (cleanup_fn)(void), in tst_module_load_() 84 tst_module_exists_(cleanup_fn, mod_name, &mod_path); in tst_module_load_() 100 tst_cmd(cleanup_fn, mod_argv, NULL, NULL, 0); in tst_module_load_() 104 void tst_module_unload_(void (cleanup_fn)(void), const char *mod_name) in tst_module_unload_() 121 tst_brkm(TBROK, cleanup_fn, in tst_module_unload_()
|
D | tst_mkfs.c | 25 void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void), in tst_mkfs_() 36 tst_brkm_(file, lineno, TBROK, cleanup_fn, in tst_mkfs_() 42 tst_brkm_(file, lineno, TBROK, cleanup_fn, in tst_mkfs_() 60 tst_brkm_(file, lineno, TBROK, cleanup_fn, in tst_mkfs_() 78 tst_brkm_(file, lineno, TBROK, cleanup_fn, in tst_mkfs_() 92 tst_brkm_(file, lineno, TBROK, cleanup_fn, in tst_mkfs_() 99 ret = tst_cmd(cleanup_fn, argv, "/dev/null", NULL, TST_CMD_PASS_RETVAL | in tst_mkfs_() 106 tst_brkm_(file, lineno, TCONF, cleanup_fn, in tst_mkfs_() 110 tst_brkm_(file, lineno, TBROK, cleanup_fn, in tst_mkfs_()
|
D | tst_resource.c | 83 void (*cleanup_fn)(void), const char *path, in file_copy() 95 safe_cp(file, lineno, cleanup_fn, buf, dest); in file_copy() 101 void (*cleanup_fn)(void), in tst_resource_copy() 105 tst_brkm_(file, lineno, TBROK, cleanup_fn, in tst_resource_copy() 118 if (file_copy(file, lineno, cleanup_fn, dataroot, filename, dest)) in tst_resource_copy() 126 if (file_copy(file, lineno, cleanup_fn, buf, filename, dest)) in tst_resource_copy() 132 if (file_copy(file, lineno, cleanup_fn, startwd, filename, dest)) in tst_resource_copy() 135 tst_brkm_(file, lineno, TBROK, cleanup_fn, in tst_resource_copy()
|
D | tst_cmd.c | 47 int tst_cmd_fds_(void (cleanup_fn)(void), in tst_cmd_fds_() 56 tst_brkm(TBROK, cleanup_fn, in tst_cmd_fds_() 75 tst_brkm(TCONF, cleanup_fn, "Couldn't find '%s' in $PATH at %s:%d", argv[0], in tst_cmd_fds_() 83 tst_brkm(TBROK | TERRNO, cleanup_fn, "vfork failed at %s:%d", in tst_cmd_fds_() 105 tst_brkm(TBROK | TERRNO, cleanup_fn, "waitpid failed at %s:%d", in tst_cmd_fds_() 113 tst_brkm(TBROK, cleanup_fn, "failed to exec cmd '%s' at %s:%d", in tst_cmd_fds_() 121 tst_brkm(TBROK, cleanup_fn, in tst_cmd_fds_() 130 int tst_cmd_(void (cleanup_fn)(void), in tst_cmd_() 160 rc = tst_cmd_fds(cleanup_fn, argv, stdout_fd, stderr_fd, flags); in tst_cmd_()
|
D | tst_dir_is_empty.c | 28 int tst_dir_is_empty_(void (cleanup_fn)(void), const char *name, int verbose) in tst_dir_is_empty_() 31 DIR *dir = SAFE_OPENDIR(cleanup_fn, name); in tst_dir_is_empty_() 34 while ((entry = SAFE_READDIR(cleanup_fn, dir)) != NULL) { in tst_dir_is_empty_() 46 SAFE_CLOSEDIR(cleanup_fn, dir); in tst_dir_is_empty_()
|