view modules/getdtablesize @ 17508:52cc408447aa

getdtablesize: work around cygwin issue Cygwin 1.7.25 has a bug that even though it claims to support RLIMIT_NOFILE inheritance, there is no enforcement of the soft limit, and getdtablesize() automatically grows until it reaches the hard limit which cannot be changed by setrlimit(). Best is to just treat things as an invariant limit, as several other modules assume that getdtablesize() will not change without an intervening setrlimit(). * m4/getdtablesize.m4 (gl_FUNC_GETDTABLESIZE): Detect problem. * modules/getdtablesize (configure.ac): Build replacement. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set up a witness. * modules/unistd (Makefile.am): Expose the witness. * lib/unistd.in.h (getdtablesize): Declare replacement. * lib/getdtablesize.c (rpl_getdtablesize): Work around it. * tests/test-getdtablesize.c (main): Test it. * doc/glibc-functions/getdtablesize.texi (getdtablesize): Document it. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Thu, 26 Sep 2013 11:26:29 -0600
parents 4583838a5587
children 1f14c6dd175d
line wrap: on
line source

Description:
getdtablesize() function: return maximum number of file descriptors.

Files:
lib/getdtablesize.c
m4/getdtablesize.m4

Depends-on:
unistd
extensions
msvc-inval      [test $HAVE_GETDTABLESIZE = 0]

configure.ac:
gl_FUNC_GETDTABLESIZE
if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
  AC_LIBOBJ([getdtablesize])
  gl_PREREQ_GETDTABLESIZE
fi
gl_UNISTD_MODULE_INDICATOR([getdtablesize])

Makefile.am:

Include:
<unistd.h>

License:
LGPLv2+

Maintainer:
Bruno Haible, Eric Blake