aboutsummaryrefslogtreecommitdiffstats
path: root/libsimple.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libsimple.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libsimple.h b/libsimple.h
index f4238cb..9cc0f8f 100644
--- a/libsimple.h
+++ b/libsimple.h
@@ -191,6 +191,20 @@ libsimple_close(int *fdp__)
/**
+ * Close a range of file descriptors
+ *
+ * @param first The lowest file descriptor to close
+ * @param last The highest file descriptor to close
+ * @param next Output parameter for the potentially first unclosed file descriptor; may be `NULL`
+ * @return 0 on successful completion, -1 on failure
+ * @throws EINVAL If `first > last`
+ * @throws Any error for close(3) except EBADF
+ */
+int libsimple_close_range(unsigned int first, unsigned int last, unsigned int *next);
+#define LIBSIMPLE_CLOSE_RANGE_MAX (~0U)
+
+
+/**
* Remove an item from a list, keeping the list ordered
*
* `list` must be non-void pointer to a complete type,