¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

xephemdbd (3.4.1)


graemecoates
 

I'm attempting to get xephemdbd (using the 3.4.1 source) working to
run cgi queries on a web server. However, when I attempt to make the
cgi script, I get a make error due to the variable "OPEN_MAX" being
undefined. To what does the variable refer, and is there a work around
to this?

I assume setting it to a value will get round the problem - but are
there acceptable or recommended values for use?

Cheers,

Graeme


ecdowney2002
 

--- In xephem@y..., "graemecoates" <graemecoates@y...> wrote:
I'm attempting to get xephemdbd (using the 3.4.1 source) working to
run cgi queries on a web server. However, when I attempt to make the
cgi script, I get a make error due to the variable "OPEN_MAX" being
undefined. To what does the variable refer, and is there a work around
to this?

I assume setting it to a value will get round the problem - but are
there acceptable or recommended values for use?
OPEN_MAX is the traditional means to get the maximum number of files a
process may have open at one time. It used to be in <sys/param.h>
until Berkeley UNIX made the number dynamic to support their new
fangled sockets (circa 1982?). The more contemporary way to get the
value is to call sysconf(_SC_OPEN_MAX). It's probably time I switched.

The xephemdbd uses it to close all file descriptors it knows it will
not use, like a good daemon should. Since close() fails gracefully
when given a bogus file descriptor, it is harmless to hack in a value
that is too large. I see linux sets OPEN_MAX to 256 in
<linux/limits.h> but its ssconf(_SC_OPEN_MAX) returns 1024.