Tool/software: Starterware
Hello,
I am trying to compile a simple BSD socket based program. As the NDK documentation states in section 3.3 (3.3.1.1), I have placed all the separate BSD calls in a different source module and I am attempting to compile it.
I am using CCS 7.2, with pdk_am335x_1_0_7 and ndk_2_25_01_11
My call to "socket()" always returns -1. It appears I need a call to "fdOpenSession" prior to creating the socket.
That function is not a BSD call, but I found it in bsd/socketndk.h. Next up, it has an argument of the current task handle. Specifically the call in the examples code segment is
fdOpenSession(TaskSelf());
Well, "TaskSelf" comes from osif.h, which is littered with HANDLE, UNIT32, and other things like that.
In order to define them, it becomes necessary to include usertype.h. Well, then that has it's own definition of IP6N which gives me a bunch of errors re-defining it.
Section 3.1.2.1 clearly says that the call to fdSessionOpen should be inside the task. And the small code listing shows that "SOCKET s;" is coexisting with "dfOpenSession". However, there is no mention of how to #include the header files to get things to compile (and factor I find lacking all over the documentation)
So then... How are you supposed to get this to compile when there are conflicting types of the same name, spread across multiple header files, where there were not protected with #ifdefs ?
There is no BSD based socket examples I can find. And advice is appreciated.
-CSW