Get MAC address, errno 48 "Not supported"

Using this with qnx 6.2 (gcc 2.95.3) works fine

Nic_t nic;
devctl(iF, DCMD_IO_NET_NICINFO, &nic, sizeof(Nic_t), NULL);

Using this with qnx 6.3 (gcc 2.95.3) errno was set (code 48: Not supported). Problem solved with

nic_config_t nic;
devctl(iF, DCMD_IO_NET_GET_CONFIG, &nic, sizeof(nic_config_t), NULL);

At this moment I’m compiling qnx 6.3 with gcc 3.3.1 and errno is set again with code 48: Not supported. :frowning:

Somebody an idea?

6.2 and earlier code:
#include <sys/nic.h>
#include <sys/dcmd_io-net.h>
Nic_t nicinfo;
devctl(fd, DCMD_IO_NET_NICINFO, &nicinfo, sizeof(nicinfo), NULL);

6.3 and later code:
#include <hw/nicinfo.h>
#include <sys/dcmd_io-net.h>
nic_config_t nicconfig;
devctl(fd, DCMD_IO_NET_GET_CONFIG, &nicconfig, sizeof(nicconfig), NULL);

Yes, I have included the right header files.

The only change is the compiler. From gcc 2.95.3 to 3.3.1.
I’m able to build the executable but I get this error at runtime.

Something with libraries (npm_qnet.so)??

If your code works fine in QNX 6.3 with gcc 2.95 but not with gcc 3.3.1, it sounds like a compiler a bug.

Let’s see if Colin has any comments.

If you look at the code snippets I posted, the arguments to the devctl() call have changed from 6.2.1 to 6.3