File: fd.c

package info (click to toggle)
troffcvt 1.04%2Brepack1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,416 kB
  • sloc: ansic: 13,110; makefile: 6,847; perl: 1,583; cpp: 333; sh: 215
file content (27 lines) | stat: -rw-r--r-- 291 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * MaxFileDesc ()
 *
 * Returns the maximum number of file descriptors allowed.
 */

#include	"portlib.h"

#if HAS_SYSCONF

#include	<unistd.h>

int
MaxFileDesc ()
{
	return (sysconf (_SC_OPEN_MAX));
}

# else

int
MaxFileDesc ()
{
	return (getdtablesize ());
}

#endif /* HAS_SYSCONF */