libogc icon indicating copy to clipboard operation
libogc copied to clipboard

net_getsockopt, net_getsockname, and struct pollfd not implemented

Open GriffintheFolf opened this issue 3 years ago • 4 comments

While attempting to build libcurl for the Wii, I ran into problems where some of the necessary functions, namely net_getsockopt, net_getsockname, and the data type struct pollfd were not present in the library. I was aware that all the network functions are prefixed with net_, but even after adding that prefix, it made no difference.

I checked the network.h header just to make sure I wasn't going crazy. Lastly, I ran nm on libogc just on the off-chance the symbols were in the library but not in the header. But this got me no further.

Interestingly enough, I found this note in network.h:

/*
 * Level number for (get/set)sockopt() to apply to socket itself.
 */
#define  SOL_SOCKET                     0xffff    /* options for socket level */

It almost seems as though there were plans to implement net_getsockopt, but this wasn't done. This has seemingly also persisted for a long time, as I found in this forum post from 2011 and in issue #56 from 2018.

GriffintheFolf avatar Feb 11 '21 05:02 GriffintheFolf

Similar to the networking functions, GX_GetAttrFmtv is mentioned on the Doxygen pages in notes of GX_SetVtxAttrFmtv (see here), but does not have a declaration in gx.h. Running nm on libogc.a like Thomas did shows that it doesn't define the function, either.

I didn't want to open my own issue; this seems like a similar enough problem. Some functions are missing from the libs, but they're referenced in comments and documentation as if they were supposed to exist.

muff1n1634 avatar Feb 19 '21 04:02 muff1n1634

hey @GriffintheFolf,

first of all, thanks for making the issue. i just took a look at this. net_getsockopt is implemented in the master branch at the moment (but not in release just yet), and because of this i took it upon myself to check the other 2 you mentioned. the net_setsockoptis also implemented, but i indeed didn't find the pollfd struct. there is a pollsd which looks similar to what i found pollfd should look like except it has events and revents defined as shorts, not unsigned ints. i don't know if this is the same struct and if it could cause issues that the variables are a different length?

DacoTaco avatar Feb 12 '23 14:02 DacoTaco

I ran into this when attempting to get Retroachievements working with the Wii in Retroarch. getsockname still needs to be implemented.

Could this be used as a model? Apologies if this is a silly question, as I'm pretty unfamiliar with this type of development.

Nargash avatar Jul 08 '23 18:07 Nargash

I ran into this when attempting to get Retroachievements working with the Wii in Retroarch. getsockname still needs to be implemented.

Could this be used as a model? Apologies if this is a silly question, as I'm pretty unfamiliar with this type of development.

for gamecube this would semi be true, since gamecube uses lwip. but on the wii this is a different story and we need to find the functions/methods in ios to make it work

DacoTaco avatar Jul 09 '23 10:07 DacoTaco