--- glib/gspawn.c.old 2019-07-30 10:13:36.414370000 -0500 +++ glib/gspawn.c 2019-07-30 10:30:03.800529000 -0500 @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -39,6 +40,8 @@ #include #endif /* HAVE_SYS_RESOURCE_H */ +#include + #include "gspawn.h" #include "gthread.h" #include "glib/gstdio.h" @@ -1126,6 +1129,12 @@ * rlimit trick */ #endif + + int count; + struct kinfo_file *files = kinfo_getfile(getpid(), &count); + for (fd = 0; fd < count; fd++) + cb(data, files[fd].kf_fd); + free(files); #ifdef HAVE_SYS_RESOURCE_H