Sign in
mojo
/
mojo-tools
/
ed4bdf2b045dcf76699eb5095f037df4b8750a28
/
.
/
fusl
/
src
/
legacy
/
getdtablesize.c
blob: 682da6d067583f4382d9b1f2accc8115e66af3ab [
file
] [
log
] [
blame
]
#define
_GNU_SOURCE
#include
<unistd.h>
#include
<limits.h>
#include
<sys/resource.h>
int
getdtablesize
(
void
)
{
struct
rlimit rl
;
getrlimit
(
RLIMIT_NOFILE
,
&
rl
);
return
rl
.
rlim_max
<
INT_MAX
?
rl
.
rlim_max
:
INT_MAX
;
}