Installation guide

8.3 Using File Descriptors
On both the ULTRIX and UWS and the DIGITAL UNIX systems, the
number of open file descriptors a process can use is configurable. By
default, the number for DIGITAL UNIX systems is 4096; on ULTRIX
systems the default is 64. Your system administrator configures the
number of open file descriptors. For information about configuring this
number, see the System Administration manual.
Because the system administrator can configure the maximum number of
open file descriptors your processes can use, you might want to modify your
program before you recompile it on a DIGITAL UNIX system. The following
list describes the changes needed:
Use the getdtablesize call to determine the maximum number of
open file descriptors configured on the system.
The following example shows a call to getdtablesize to get the
maximum number of open file descriptors:
int maxfds;
maxfds = getdtablesize():
Use the maxfds variable in other calls, such as the select call, that
require you to pass the number of open file descriptors of interest. For
more information, see getdtablesize
(2).
Use a short integer or longer data type to store file descriptors.
On ULTRIX systems, you might have used a character data type to
store file descriptors. Because file descriptor values on DIGITAL UNIX
systems can be greater than 128, you must use at least a short integer
to store file descriptors.
Use the fd_set data type and its associated macros as defined in the
/usr/include/sys/types.h file to declare parameters to the select
call.
Using the fd_set data type ensures that the parameters are large
enough to accommodate up to 4096 file descriptors. The fd_set data
type is large enough for 64 file descriptors in ULTRIX. For more
information, see select
(2).
8–8 Postmigration Programming Features