summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix/close.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix/close.c')
-rw-r--r--otherlibs/unix/close.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/otherlibs/unix/close.c b/otherlibs/unix/close.c
index 41dfca5e9..355b27d23 100644
--- a/otherlibs/unix/close.c
+++ b/otherlibs/unix/close.c
@@ -20,3 +20,12 @@ value unix_close(fd) /* ML */
if (close(Int_val(fd)) == -1) uerror("close", Nothing);
return Val_unit;
}
+
+value unix_closeall(last_fd) /* ML */
+ value last_fd;
+{
+ int fd;
+ for (fd = 3; fd <= Int_val(last_fd); fd++) close(fd);
+ return Val_unit;
+}
+