fdset: optionally, close remaining fds asynchronously

This commit is contained in:
Lennart Poettering
2024-10-17 09:48:05 +02:00
parent 5df9ebad70
commit 33dd894546
5 changed files with 20 additions and 7 deletions
+4 -1
View File
@@ -11,6 +11,7 @@ typedef struct FDSet FDSet;
FDSet* fdset_new(void);
FDSet* fdset_free(FDSet *s);
FDSet* fdset_free_async(FDSet *s);
int fdset_put(FDSet *s, int fd);
int fdset_consume(FDSet *s, int fd);
@@ -36,7 +37,7 @@ int fdset_iterate(FDSet *s, Iterator *i);
int fdset_steal_first(FDSet *fds);
void fdset_close(FDSet *fds);
void fdset_close(FDSet *fds, bool async);
#define _FDSET_FOREACH(fd, fds, i) \
for (Iterator i = ITERATOR_FIRST; ((fd) = fdset_iterate((fds), &i)) >= 0; )
@@ -45,3 +46,5 @@ void fdset_close(FDSet *fds);
DEFINE_TRIVIAL_CLEANUP_FUNC(FDSet*, fdset_free);
#define _cleanup_fdset_free_ _cleanup_(fdset_freep)
DEFINE_TRIVIAL_CLEANUP_FUNC(FDSet*, fdset_free_async);