-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do you consider Darwin version ? #1
Comments
Hello! Yes, I'd be happy to merge a PR to add Darwin support. I don't have a mac, so I can't test it, but I care about portability :) Regarding LOGIN_NAME_MAX I was recently bit by it because neither FreeBSD has it. I'll commit something for it soon. Thanks! |
Both Linux and OpenBSD have LOGIN_NAME_MAX available when including limits.h, FreeBSD, Darwin and possibly others don't. FreeBSD (and maybe Darwin) have MAXLOGNAME, so try to use that if available. Otherwise use _POSIX_LOGIN_NAME_MAX, but only has a fallback since it has a lower value (9 at the time of writing). If everything fails, use 32 which is what OpenBSD use by default; OpenSMTPd also defaults to it. See also github issue #1
Does 20f7a94 help with LOGIN_NAME_MAX on darwin too? |
Thanks. I don't see the error again. Now the compiler can go further it show more error.
I checked Mac header doesn't contain those definition so I will need to fallback to the lass safer accept and fcntl.
linux, freebsd, netbsd, openbsd, Darwin have a posix_spawn so we can get everybody happy.
fixable using realloc |
Right, darwin still lacks accept4 and the fancy SOCK_* flags; it's not an issue to just use The reallocarray warnings is because i forgot to include a check for it in the configure, i only have recallocarray. I'll fix that too. Regarding daemon... I know that the posix_spawn APIs are widely available but i personally dislike them (they feel over-enginereed, confusing and plain ugly) so i'll keep using daemon(3). if daemon(3) will be ever removed on darwin, we'll find a way :) |
Darwin instead of |
I think i've fixed the accept4 and reallocarray issue, let me know if those warnings/errors now are gone on darwin, thanks! Regarding endian.h, freebsd has a compatible set of functions in Just a matter of style however, i don't like how got-portable does some compats: it looks for the operating system instead of checking for the actual presence of the feature, so I'd prefer if we add some checks for the headers ( This can be done by using Let me know if i can help you with that, I'll be glad to merge a PR for it! Thanks! |
FreeBSD has sys/endian.h and for MacOS we need to use the functions from libkern/OSByteOrder.h see github issue #1
FreeBSD and NetBSD have sys/endian.h, on MacOS we need to use the functions from libkern/OSByteOrder.h see github issue #1
I've pushed the |
since it fixes the build on FreeBSD (and possibly on NetBSD too) I just merged this in the main branch, let me know if it works on darwin too! Thanks! |
I have checked and currently it doesn't build because of |
@hauleth oh, I see. I'll add it to the compat layer and then ask you to retry since I still don't have a mac :) Thank you! |
@omar-polo you could setup macOS build on GitHub Actions and mark it as "allowed to fail". That way you would have some feedback even when you do not own macOS on your own. Also, thanks for this project as it is probably the only project that I have found that provide 9p2000 CLI client. I want something like that as I am working on my own implementation and I want to be able to test against some 3rd party implementation. |
@hauleth you're right! actually I'm already using cirrus ci to build on freebsd and macos in another project, so no excuses not to do it here too. I've fixed some things, but it still fails on macos at the moment for other reasons. It may take me a bit still to fix it. by the way
I'm curious, and I'd like to test again other implementations as well :-) When/if you feel like, could you link your project here too? Thank you! |
@omar-polo it is partially public, but it is non-functional at the time of writing https://github.com/hauleth/e9p (implementation in Erlang). |
When I compiled I get:
I ask because the description say UNIX-like. I tried to look at
LOGIN_NAME_MAX
and it seem to exist on Darwin:for endian.h I consider https://github.com/kristapsdz/oconfigure#endianh
Would you merge a PR that add Darwin support ?
The text was updated successfully, but these errors were encountered: