shared/async: introduce asynchronous_close_many() helper
This commit is contained in:
@@ -133,6 +133,13 @@ int asynchronous_close(int fd) {
|
||||
return -EBADF; /* return an invalidated fd */
|
||||
}
|
||||
|
||||
void asynchronous_close_many(const int fds[], size_t n_fds) {
|
||||
assert(fds || n_fds == 0);
|
||||
|
||||
FOREACH_ARRAY(i, fds, n_fds)
|
||||
asynchronous_close(*i);
|
||||
}
|
||||
|
||||
int asynchronous_rm_rf(const char *p, RemoveFlags flags) {
|
||||
int r;
|
||||
|
||||
|
||||
+4
-1
@@ -21,7 +21,10 @@
|
||||
|
||||
int asynchronous_sync(pid_t *ret_pid);
|
||||
int asynchronous_fsync(int fd, pid_t *ret_pid);
|
||||
|
||||
int asynchronous_close(int fd);
|
||||
int asynchronous_rm_rf(const char *p, RemoveFlags flags);
|
||||
void asynchronous_close_many(const int fds[], size_t n_fds);
|
||||
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(int, asynchronous_close);
|
||||
|
||||
int asynchronous_rm_rf(const char *p, RemoveFlags flags);
|
||||
|
||||
Reference in New Issue
Block a user