Home
last modified time | relevance | path

Searched refs:cleanup_fn (Results 1 – 25 of 39) sorted by relevance

12

/external/ltp/include/old/
Dsafe_macros.h23 #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, fildes) \ argument
30 safe_close(__FILE__, __LINE__, (cleanup_fn), (fildes))
32 #define SAFE_CREAT(cleanup_fn, pathname, mode) \ argument
33 safe_creat(__FILE__, __LINE__, cleanup_fn, (pathname), (mode))
35 #define SAFE_DIRNAME(cleanup_fn, path) \ argument
36 safe_dirname(__FILE__, __LINE__, (cleanup_fn), (path))
[all …]
Dold_checkpoint.h40 #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);
46 #define TST_SAFE_CHECKPOINT_WAKE(cleanup_fn, id) \ argument
47 tst_safe_checkpoint_wake(__FILE__, __LINE__, cleanup_fn, id, 1);
49 #define TST_SAFE_CHECKPOINT_WAKE2(cleanup_fn, id, nr_wake) \ argument
50 tst_safe_checkpoint_wake(__FILE__, __LINE__, cleanup_fn, id, nr_wake);
52 #define TST_SAFE_CHECKPOINT_WAKE_AND_WAIT(cleanup_fn, id) \ argument
53 tst_safe_checkpoint_wake(__FILE__, __LINE__, cleanup_fn, id, 1); \
[all …]
Dold_safe_net.h30 #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, \
Dold_safe_stdio.h25 #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)
Dold_safe_file_ops.h37 #define SAFE_FILE_SCANF(cleanup_fn, path, fmt, ...) \ argument
38 safe_file_scanf(__FILE__, __LINE__, (cleanup_fn), \
45 #define SAFE_FILE_PRINTF(cleanup_fn, path, fmt, ...) \ argument
46 safe_file_printf(__FILE__, __LINE__, (cleanup_fn), \
49 #define SAFE_CP(cleanup_fn, src, dst) \ argument
50 safe_cp(__FILE__, __LINE__, (cleanup_fn), (src), (dst))
52 #define SAFE_TOUCH(cleanup_fn, pathname, mode, times) \ argument
53 safe_touch(__FILE__, __LINE__, (cleanup_fn), \
/external/ltp/include/
Dsafe_macros_fn.h28 void (*cleanup_fn)(void), char *path);
31 void (*cleanup_fn)(void), const char *path);
34 void (*cleanup_fn)(void), int fildes);
37 void (*cleanup_fn)(void), const char *pathname, mode_t mode);
40 void (*cleanup_fn)(void), char *path);
43 void (*cleanup_fn)(void), char *buf, size_t size);
46 void (*cleanup_fn)(void), const char *name);
49 void (*cleanup_fn)(void), int who, struct rusage *usage);
52 void (*cleanup_fn)(void), size_t size);
55 void (*cleanup_fn)(void), const char *pathname, mode_t mode);
[all …]
Dtst_pid.h26 pid_t tst_get_unused_pid_(void (*cleanup_fn)(void));
32 int tst_get_free_pids_(void (*cleanup_fn)(void));
45 static inline pid_t tst_get_unused_pid(void (*cleanup_fn)(void)) in tst_get_unused_pid()
47 return tst_get_unused_pid_(cleanup_fn); in tst_get_unused_pid()
50 static inline int tst_get_free_pids(void (*cleanup_fn)(void)) in tst_get_free_pids()
52 return tst_get_free_pids_(cleanup_fn); in tst_get_free_pids()
Dtst_cmd.h34 int tst_run_cmd_fds_(void (cleanup_fn)(void),
49 int tst_run_cmd_(void (cleanup_fn)(void),
74 static inline int tst_run_cmd_fds(void (cleanup_fn)(void), in tst_run_cmd_fds()
80 return tst_run_cmd_fds_(cleanup_fn, argv, in tst_run_cmd_fds()
84 static inline int tst_run_cmd(void (cleanup_fn)(void), in tst_run_cmd()
90 return tst_run_cmd_(cleanup_fn, argv, in tst_run_cmd()
Dsafe_net_fn.h31 int safe_socket(const char *file, const int lineno, void (cleanup_fn)(void),
34 int safe_bind(const char *file, const int lineno, void (cleanup_fn)(void),
38 int safe_listen(const char *file, const int lineno, void (cleanup_fn)(void),
41 int safe_connect(const char *file, const int lineno, void (cleanup_fn)(void),
45 void (cleanup_fn)(void), int sockfd, struct sockaddr *addr,
Dsafe_stdio_fn.h23 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),
Dsafe_file_ops_fn.h34 void (*cleanup_fn)(void),
46 void (*cleanup_fn)(void),
54 void (*cleanup_fn)(void),
70 void (*cleanup_fn)(void),
/external/ltp/lib/
Dsafe_macros.c21 void (*cleanup_fn) (void), char *path) in safe_basename()
27 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_basename()
36 safe_chdir(const char *file, const int lineno, void (*cleanup_fn) (void), in safe_chdir()
43 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_chdir()
52 safe_close(const char *file, const int lineno, void (*cleanup_fn) (void), in safe_close()
59 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_close()
68 safe_creat(const char *file, const int lineno, void (*cleanup_fn) (void), in safe_creat()
75 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_creat()
84 void (*cleanup_fn) (void), char *path) in safe_dirname()
90 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_dirname()
[all …]
Dtst_checkpoint.c40 void (*cleanup_fn)(void)) in tst_checkpoint_init()
46 tst_brkm(TBROK, cleanup_fn, in tst_checkpoint_init()
62 if (cleanup_fn && !tst_tmpdir_created()) { in tst_checkpoint_init()
63 tst_brkm(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()
129 void (*cleanup_fn)(void), unsigned int id) in tst_safe_checkpoint_wait()
134 tst_brkm(TBROK | TERRNO, cleanup_fn, in tst_safe_checkpoint_wait()
[all …]
Dsafe_file_ops.c132 void (*cleanup_fn) (void), in safe_file_scanf()
142 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_file_scanf()
154 tst_brkm(TBROK, cleanup_fn, in safe_file_scanf()
160 tst_brkm(TBROK, cleanup_fn, in safe_file_scanf()
166 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_file_scanf()
217 void (*cleanup_fn) (void), in safe_file_printf()
226 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_file_printf()
234 tst_brkm(TBROK, cleanup_fn, in safe_file_printf()
242 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_file_printf()
250 void (*cleanup_fn) (void), const char *src, const char *dst) in safe_cp()
[all …]
Dsafe_stdio.c26 FILE *safe_fopen(const char *file, const int lineno, void (cleanup_fn)(void), in safe_fopen()
32 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_fopen()
40 int safe_fclose(const char *file, const int lineno, void (cleanup_fn)(void), in safe_fclose()
48 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_fclose()
55 int safe_asprintf(const char *file, const int lineno, void (cleanup_fn)(void), in safe_asprintf()
66 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_asprintf()
73 FILE *safe_popen(const char *file, const int lineno, void (cleanup_fn)(void), in safe_popen()
84 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_popen()
88 tst_brkm(TBROK, cleanup_fn, in safe_popen()
Dtst_device.c130 static void attach_device(void (*cleanup_fn)(void), in attach_device()
135 dev_fd = SAFE_OPEN(cleanup_fn, dev, O_RDWR); in attach_device()
136 file_fd = SAFE_OPEN(cleanup_fn, file, O_RDWR); in attach_device()
142 tst_brkm(TBROK, cleanup_fn, in attach_device()
185 const char *tst_acquire_device(void (cleanup_fn)(void)) in tst_acquire_device()
191 tst_brkm(TBROK, cleanup_fn, "Device allready acquired"); in tst_acquire_device()
194 tst_brkm(TBROK, cleanup_fn, in tst_acquire_device()
203 SAFE_STAT(cleanup_fn, dev, &st); in tst_acquire_device()
206 tst_brkm(TBROK, cleanup_fn, in tst_acquire_device()
211 tst_brkm(TBROK | TERRNO, cleanup_fn, in tst_acquire_device()
[all …]
Dtst_module.c31 void tst_module_exists(void (cleanup_fn)(void), in tst_module_exists()
47 tst_brkm(TBROK | TERRNO, cleanup_fn, in tst_module_exists()
58 tst_brkm(TBROK | TERRNO, cleanup_fn, in tst_module_exists()
67 tst_brkm(TCONF, cleanup_fn, "Failed to find module '%s'", in tst_module_exists()
77 void tst_module_load(void (cleanup_fn)(void), in tst_module_load()
81 tst_module_exists(cleanup_fn, mod_name, &mod_path); in tst_module_load()
97 tst_run_cmd(cleanup_fn, mod_argv, NULL, NULL, 0); in tst_module_load()
101 void tst_module_unload(void (cleanup_fn)(void), const char *mod_name) in tst_module_unload()
117 tst_brkm(TBROK, cleanup_fn, in tst_module_unload()
Dsafe_net.c84 int safe_socket(const char *file, const int lineno, void (cleanup_fn)(void), in safe_socket()
92 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_socket()
100 int safe_bind(const char *file, const int lineno, void (cleanup_fn)(void), in safe_bind()
112 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_bind()
127 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_bind()
134 int safe_listen(const char *file, const int lineno, void (cleanup_fn)(void), in safe_listen()
142 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_listen()
150 int safe_connect(const char *file, const int lineno, void (cleanup_fn)(void), in safe_connect()
159 tst_brkm(TBROK | TERRNO, cleanup_fn, in safe_connect()
169 void (cleanup_fn)(void), int sockfd, struct sockaddr *addr, in safe_getsockname()
[all …]
Dtst_mkfs.c24 void tst_mkfs(void (cleanup_fn)(void), const char *dev, in tst_mkfs()
34 tst_brkm(TBROK, cleanup_fn, "No device specified"); in tst_mkfs()
37 tst_brkm(TBROK, cleanup_fn, "No fs_type specified"); in tst_mkfs()
46 tst_brkm(TBROK, cleanup_fn, in tst_mkfs()
62 tst_brkm(TBROK, cleanup_fn, in tst_mkfs()
71 ret = tst_run_cmd(cleanup_fn, argv, "/dev/null", NULL, 1); in tst_mkfs()
77 tst_brkm(TCONF, cleanup_fn, in tst_mkfs()
80 tst_brkm(TBROK, cleanup_fn, in tst_mkfs()
Dtst_resource.c81 void (*cleanup_fn)(void), const char *path, in file_copy()
93 safe_cp(file, lineno, cleanup_fn, buf, dest); in file_copy()
99 void (*cleanup_fn)(void), in tst_resource_copy()
103 tst_brkm(TBROK, cleanup_fn, in tst_resource_copy()
116 if (file_copy(file, lineno, cleanup_fn, dataroot, filename, dest)) in tst_resource_copy()
124 if (file_copy(file, lineno, cleanup_fn, buf, filename, dest)) in tst_resource_copy()
130 if (file_copy(file, lineno, cleanup_fn, startwd, filename, dest)) in tst_resource_copy()
133 tst_brkm(TBROK, cleanup_fn, "Failed to copy resource '%s' at %s:%d", in tst_resource_copy()
Dtst_run_cmd.c34 int tst_run_cmd_fds_(void (cleanup_fn)(void), in tst_run_cmd_fds_()
43 tst_brkm(TBROK, cleanup_fn, in tst_run_cmd_fds_()
59 tst_brkm(TBROK | TERRNO, cleanup_fn, "vfork failed at %s:%d", in tst_run_cmd_fds_()
83 tst_brkm(TBROK | TERRNO, cleanup_fn, "waitpid failed at %s:%d", in tst_run_cmd_fds_()
90 tst_brkm(TBROK, cleanup_fn, "failed to exec cmd '%s' at %s:%d", in tst_run_cmd_fds_()
97 tst_brkm(TBROK, cleanup_fn, in tst_run_cmd_fds_()
104 int tst_run_cmd_(void (cleanup_fn)(void), in tst_run_cmd_()
134 rc = tst_run_cmd_fds(cleanup_fn, argv, stdout_fd, stderr_fd, in tst_run_cmd_()
Dtst_net.c29 unsigned short tst_get_unused_port(void (cleanup_fn)(void), in tst_get_unused_port()
55 tst_brkm(TBROK, cleanup_fn, in tst_get_unused_port()
61 tst_brkm(TBROK | TERRNO, cleanup_fn, "socket failed"); in tst_get_unused_port()
64 tst_brkm(TBROK | TERRNO, cleanup_fn, "bind failed"); in tst_get_unused_port()
67 tst_brkm(TBROK | TERRNO, cleanup_fn, "getsockname failed"); in tst_get_unused_port()
70 tst_brkm(TBROK | TERRNO, cleanup_fn, "close failed"); in tst_get_unused_port()
Dtst_dir_is_empty.c28 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_()
Dtst_pid.c30 pid_t tst_get_unused_pid_(void (*cleanup_fn) (void)) in tst_get_unused_pid_()
34 SAFE_FILE_SCANF(cleanup_fn, PID_MAX_PATH, "%d", &pid); in tst_get_unused_pid_()
39 int tst_get_free_pids_(void (*cleanup_fn) (void)) in tst_get_free_pids_()
58 SAFE_FILE_SCANF(cleanup_fn, PID_MAX_PATH, "%d", &max_pids); in tst_get_free_pids_()
/external/ltp/testcases/kernel/mem/hugetlb/lib/
Dhugetlb.c52 int getipckey(void (*cleanup_fn) (void)) in getipckey()
63 tst_brkm(TBROK | TERRNO, cleanup_fn, "getcwd(curdir)"); in getipckey()
82 tst_brkm(TBROK | TERRNO, cleanup_fn, "ftok"); in getipckey()
90 int getuserid(void (*cleanup_fn) (void), char *user) in getuserid()
96 tst_brkm(TBROK | TERRNO, cleanup_fn, "getpwnam"); in getuserid()

12