+#elif defined(HAVE_PSTAT_GETPROC)
+void
+closefrom(int lowfd)
+{
+ struct pst_status pstat;
+ int fd;
+
+ if (pstat_getproc(&pstat, sizeof(pstat), 0, getpid()) != -1) {
+ for (fd = lowfd; fd <= pstat.pst_highestfd; fd++)
+ (void) close(fd);
+ } else {
+ closefrom_fallback(lowfd);
+ }
+}
+#elif defined(HAVE_DIRFD)