Sign in
cobalt
/
cobalt
/
d2bc3b69d823bbaf46d1c4355b23486a85a6d791
/
.
/
third_party
/
musl
/
src
/
legacy
/
getdtablesize.c
blob: b30c1933a272d13b3d7918afd053dcd328d700c2 [
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_cur
<
INT_MAX
?
rl
.
rlim_cur
:
INT_MAX
;
}