ok, well with 3.4.27 on Solaris 2.6, the following program works for me:

#include <sys/stropts.h>
#include <sys/ioctl.h>
#include <sys/sockio.h>
#include <fcntl.h>

main(argc, argv)
int argc;
char *argv[];
{
        struct strioctl stl;
        int fd, ret, numifs;

        if ( (fd = open("/dev/ip",O_RDWR)) == -1 ) {
                perror("open(/dev/ip)");
                exit(1);
        }

        stl.ic_cmd = SIOCGIFNUM;
        stl.ic_timout = 0;
        stl.ic_dp = (char *)&numifs;
        stl.ic_len = sizeof(int);

        if ( (ret = ioctl(fd, I_STR, &stl)) == -1 ) {
                perror("ioctl(I_STR)");
                exit(1);
        }
        printf("numifs = %d\n", numifs);
        return 0;
}

./a.out
numifs = 9

Darren

Reply via email to