View topic - about write() function!!

about write() function!!

anything that doesn't fit to other groups.

about write() function!!

Postby ganson » Mon Jan 12, 2004 3:46 am


I use the open() function to open the ethernet device en0.

cpc = open("/dev/io-net/en0", O_WRONLY);

The return value cpc is 3 . I think the device is opened correctly.

Then I use the write() function.

len_written=write(cpc,...,...) ;

The return value len_written is -1.While I get the error info,It shows

that "Function is not implemented".

Then I use the ifconfig command , I can see the en0 device .

Could someone tell me how to solve it ? Thanks a lot.
Active Member
Posts: 10
Joined: Sun Dec 14, 2003 10:52 am

Postby cdm » Mon Jan 12, 2004 5:23 am

You don't write to /dev/io-net/en0 directly. Take a look at the source to BSD's ifconfig. It is all done by using the socket API in libsocket(). The only thing you can do to /dev/io-net/en0 is the NICINFO devctl.
QNX Master
Posts: 789
Joined: Fri Jul 05, 2002 9:38 am

Return to General Programming

Who is online

Users browsing this forum: Google [Bot] and 2 guests