os_calls: Add g_get_open_fds()

This commit is contained in:
matt335672
2023-04-17 20:02:59 +01:00
parent b811fdb36b
commit d712f3527a
2 changed files with 63 additions and 0 deletions
+10
View File
@@ -217,6 +217,16 @@ int g_file_lock(int fd, int start, int len);
int g_file_duplicate_on(int fd, int target_fd);
int g_file_get_cloexec(int fd);
int g_file_set_cloexec(int fd, int status);
/**
* Get a list of open file descriptors
*
* @param min Min FD to consider
* @param max Max FD to consider (+1), or -1 for no limit
* @result Array of file descriptors, in ascending order.
*
* Call delete_list() on the result when you've finished with it.
*/
struct list *g_get_open_fds(int min, int max);
int g_chmod_hex(const char *filename, int flags);
int g_umask_hex(int flags);
int g_chown(const char *name, int uid, int gid);