Problem
An example SNMP SMUX daemon is provided in OpenServer 5.0.4 in the directory "/usr/src/cmd/net/smux-samp". If the example, "foosmuxd" is compiled and run on the system and the "getmany(ADMN)" command is used to interrogate the example MIB, after several iterations, the "ps(C)" utility shows the size of the process increasing, in 4KB amounts.
For example, start the daemon as the system "root" user:
# ./foosmuxdCheck that it is running: # ps -ef |grep foosmuxd
root 25266 24890 7 09:30:47 ttyp0 00:00:00 grep foosmuxd
root 25264 1 0 09:30:31 ? 00:00:00 ./foosmuxdMonitor the "ps" "SZ" variable by running:
# while true
> do
> ps -ef |grep foo
> doneor similar:# while [ 1 ] ; do sleep 1 ; ps -ef -ovsz -osize -ocomm |
grep foosmuxd ; doneRun the getmany command:# getmany localhost public 1.3.6.1.4.1.9999.1.4.1.2The ps command should show the "SZ" field increase:
...
20 S 0 4963 19369 32 73 24 fb122ed0 152 fb122ed0 ttyp0
00:00:00 foosmuxd
^
+--- Here Solution
This has been fixed in the example code in SCO OpenServer 5.0.5.
The following code may be added to the Release 5.0.4 example "foosmuxd.c" program code at the end of the "doit_smux()" function so it appears as follows:
...
...
default:
LIB_ERROR1("badOperation: %d", event->offset);
(void) smux_close(protocolError);
goto losing;
}
free_SNMP_SMUX_PDU(event); <------ New call
} See also
smux_util(SLIB), getmany(ADMN), oid(SLIB)