[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: OpenVMS getdtablesize.c
From: |
Bruno Haible |
Subject: |
Re: OpenVMS getdtablesize.c |
Date: |
Wed, 28 Jun 2017 22:56:13 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-81-generic; KDE/5.18.0; x86_64; ; ) |
John E. Malmberg wrote:
> OpenVMS has the function. Configure detects it exists, but the test for
> it working is failing.
> ...
> The OpenVMS getdtablesize() is returning the maximum number of open
> files that a process can have.
>
> It is not returning the highest file descriptor + 1 that can be used in
> the system. That number is 65535 for OpenVMS Alpha and Integrity.
>
> That is why it is failing the configure test.
There are two possibilities:
(a) change the configure test so that is duplicates
fd 0 to 1, 2, 3, ..., getdtablesize() and see if that fails.
(b) special-case OpenVMS.
I'm not in favour of (a) because it might allocate so many file descriptors
that the kernel gets problems.
So (b). Just add a few lines
case "$host_os" in
vms*) ...
at the appropriate place. Can you propose such a patch?
> If I have a replacement getdtablesize() return 65535, that could cause
> programs to assume that they could actually open that many descriptors.
This is only a theoretical risk. I know of no programs that are that
aggressive.
> And if an OpenVMS getrlimit() is provided, what value should it provide
> for RLIMIT_NOFILE?
Please try to approximate the wording of POSIX [1] as closely as possible.
Bruno
[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html