Mercurial > hg > Applications > mh
view sbr/closefds.c @ 17:76d91e545ea8 default tip
addrsbr and dtimep fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 Nov 2014 14:49:25 +0900 |
parents | 441a2190cfae |
children |
line wrap: on
line source
/* closefds.c - close-up fd:s */ #ifndef lint static char ident[] = "@(#)$Id: closefds.c,v 1.1.1.1 2005/04/18 14:46:06 kono Exp $"; #endif /* lint */ #include "../h/mh.h" #ifndef BSD42 #include <stdio.h> #endif /* not BSD42 */ void closefds (i) register int i; { #if !defined(BSD42) && !defined(linux) && defined(_NFILE) int nbits = _NFILE; #else /* BSD42 || linux */ int nbits = getdtablesize (); #endif /* BSD42 || linux */ for (; i < nbits; i++) #ifdef OVERHEAD if (i != fd_def && i != fd_ctx) #endif /* OVERHEAD */ (void) close (i); }