Have a Question?

01118: Flexlm -1 on Sun Solaris


Flexlm -1 on Sun Solaris


The 32-bit Solaris OS has a hard limit of 256 for the file descriptor used by a STREAM. STREAMs come from the fopen() family of system calls. 

The following is from the fopen() man pages: 

        “For 32-bit applications, however, the underlying ABIs require that no file descriptor used to access the file underlying an stdio         STREAM have a value greater than 255.” 

        When a STREAM is opened (fopen() is used to open the file), a file descriptor is retrieved from the OS. The OS uses the lowest         available file descriptor. If the new file descriptor obtained from the system is greater than 255, the STREAM open (fopen()) fails. 

        Opening a file with the lower level, byte oriented, open() system call does not have this problem. It is only limited by the maximum         files descriptors for the process and the system maximum. Opens of sockets, pipes, etc., behave the same as open(), not the         STREAMs fopen(). 

All of these opens use the same set of file descriptors. With each open, the OS issues the lowest available file descriptor. Normally a process has file descriptors 0, 1, and 2 predefined when it starts for standard input, standard output and standard error. If a process opens 252 sockets (using files descriptors 3 thru 255), then it can no longer open a STREAM, since the next available file descriptor is 256. If one of the socket connections is closed, then the process can open a STREAM. The OS reuses the file handle from the closed socket for the STREAM, which is less than 256. 

The FLEXlm licensing code opens the pointer license file (BASIS.lic) as a STREAM (using fopen()). If 252 sockets/files/pipes have already been opened, the STREAM open fails and a FLEXlm -1 licensing error is returned.


Set the BASIS_LICENSE_FILE environment variable <port>@<host>. Using this method the FLEXlm licensing code connects to <port>@<host> without opening the BASIS.lic pointer license file. Since fopen() is not used, no error occurs. 

a) BBj uses Java methods to access files/sockets. Java uses the lower level open() call to access files/sockets and not the STREAM fopen() call. The number of files/sockets opened in BBj is limited by the file descriptor limit on the process and the system limit, not the 256 limit on STREAMs. 

b) The 64-bit Solaris OS does not limit the file descriptor used by a STREAM to be less than 256. The problem described above is not a problem on the 64-bit Solaris OS. 

Last Modified: 10/18/2006 Product: PRO/5 Operating System: Solaris

BASIS structures five components of their technology into the BBx Generations.

Table of Contents
Scroll to Top