[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

8952.0. "how to read ipc releated info from a program?" by GRIFUN::BENVI () Tue Feb 25 1997 08:44

Hi all,
	is there a way (beyond ipcs) to get information on ipc objects in the system?
I've been contacted by a customer who'd like to have a  program that, before using such an object,
(i.e a semaphore), get the number of currently used objects, compares it with the maximum 
allowed (where can I get it?) and avoid using it if the maximum is reached.
The above for sockets, shared memories, semaphores and message queues.
Wouldn't be better to try to used it, handling the error if any?

thanks in advance 
Angelo
T.RTitleUserPersonal
Name
DateLines
8952.1NETRIX::"[email protected]"Shashi MangalatWed Feb 26 1997 19:0914
The table(2) system call provides options to retrieve SystemV IPC limits.  For
eg:
	if (table(TBL_SHMINFO, SHMINFO_MAX, &shmmax, 1,
                  sizeof(((struct shminfo *)0)->shmmax)) < 0) {
                perror("table");
                exit(1);
        }

See the man page and <sys/table.h> for other options.

Don't know about sockets.

--shashi
[Posted by WWW Notes gateway]
8952.2VAXCPU::michaudJeff Michaud - ObjectBrokerWed Feb 26 1997 19:188
> Don't know about sockets.

	And .0 didn't say which address families/protocols since they
	differ from family to family.

	For a start however, if table() can fetch you the size of
	the system open file table, that would be the absolute upper limit on
	the max sockets.