libc: Add POSIX headers & stubs - #773
Conversation
|
This stubs out a bunch of functions like opendir/readdir/closedir/read/write/lseek. Even if a program using these functions compiles, it probably won't work. Probably not a good idea to pretend functions are available when they're not? |
|
Yet it's working here -> https://github.com/LizardByte/Moonlight-XboxOG |
|
I guess it's working for you because your program doesn't call these functions (for sure, never? then why are they there?). The main issue is that programs that detect availability of these functions and use them when available would break in a bad way. |
|
Correct, because moonlight-common-c needs just a tiny part of OpenSSL, not every possible thing it can do. Typically OpenSSL is just available from the distro or package managers so for Moonlight no one ever had to worry about compiling it manually... and of course you can't expect a project like that to care about supporting NXDK. |
|
nxdk implements many Windows APIs, it's basically a Windows platform with API level similar to Windows 9x. Consider the With Similarly for You'd have better luck starting from the Windows route and adding the missing APIs there. This might still require patches, though it's sometimes possible to upstream them. E.g. I was able to upstream this option to libfmt because Windows 9x also lacks the corresponding API: fmtlib/fmt#3636 I'm not opposed to a POSIX compatibility layer to make porting easier but only if it's actually working and not stubbed out. I'm not a maintainer of nxdk, just a user, but it'd be very frustrating to use an SDK that declares POSIX functions without actually implementing them. |
Unfortunately, a very incomplete Windows API. First missing thing I found when going down that route was #453 This was the easier path to get my project working. I can look into trying to complete some of the stubs in the next few weeks, but I don't want to waste time on it if a maintainer isn't going to review or consider this. |
|
There is nxio from astarivi who is helping me with XBMC development. He wrote that because we were unable to compile curl in NXDK. I don't know how much it's completed, but it was enough to compile and get curl woking NXDK. |
Neat! Thanks for sharing. |
These changes were required to compile https://github.com/moonlight-stream/moonlight-common-c along with the following dependencies using nxdk.
I am using this in https://github.com/LizardByte/Moonlight-XboxOG