I have written a simple C program to retrieve the ipNetToMediaTable on the QNX RTOS.
I’m making use of sysctl( ) for this purpose.
The first sysctl( ) call is being made as follows,
mib = CTL_NET;
mib = PF_ROUTE;
mib = 0;
mib = AF_INET;
mib = NET_RT_FLAGS;
mib = RTF_LLINFO;
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
Now the problem is that ,When this first call to sysctl gets executed the value of needed comes out to be 0,which actually should be the size of available data.Because of this value of needed ,I’m not able to use these calls further to get the ipNetToMediaTable.
Can anyone help me in sorting out this problem?
Thanking in advance for any kind help.