Skip to content
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

Add Poll and Fcntl #22

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add Poll and Fcntl #22

wants to merge 4 commits into from

Conversation

Makonede
Copy link

@Makonede Makonede commented Jun 2, 2023

This change is Reviewable

Copy link
Collaborator

@ThePixelGamer ThePixelGamer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review!

@@ -25,6 +26,8 @@ using InAddr = ::in_addr;
Result Initialize(void* pool, ulong poolSize, ulong allocPoolSize, int concurLimit);
Result Finalize();
s32 SetSockOpt(s32 socket, s32 socketLevel, s32 option, const void*, u32 len);
s32 Poll(pollfd *fds, unsigned long nfds, s32 timeout);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the unsigned long just be nfds_t as to match how poll is done in UNIX
https://man7.org/linux/man-pages/man2/poll.2.html

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ThePixelGamer no, the mangled name won't link if you use nfds_t, i tried

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mangled name? the type should exist seeing how you're including poll.h, am I missing something?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, nfds_t is a typedef so it won't even show up in the mangled symbol.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leoetlino it's typedefed as an unsigned int and not an unsigned long, so the mangled name changes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

musl (which is the libc NintendoSDK uses) typedefs it to an unsigned long.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leoetlino i tried, and it seemed to mangle it as j and not m. not sure why

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

		 ::= j	# unsigned int
		 ::= l	# long
		 ::= m	# unsigned long

Sounds like your header include path is set up incorrectly and you might be using your host system's poll.h (which typedefs it to unsigned int?) rather than the one from musl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants