libogc
libogc copied to clipboard
net_getsockopt, net_getsockname, and struct pollfd not implemented
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.
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.
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_setsockopt
is 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?
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.
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