fdset: optionally, close remaining fds asynchronously
This commit is contained in:
+4
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user