Skip to content

Add Poll and Fcntl#22

Open
Makonede wants to merge 4 commits intoopen-ead:masterfrom
Makonede:patch-1
Open

Add Poll and Fcntl#22
Makonede wants to merge 4 commits intoopen-ead:masterfrom
Makonede:patch-1

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!

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