-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 non-blocking io mode setter for POSIX #19120
Conversation
Don't merge yet. I'm writing a more comprehensive test that includes setting/unsetting the mode and exception handling. |
@elcritch |
If I'm looking at the correct code here: https://github.com/FreeRTOS/FreeRTOS/blob/40c9e37d109fbfaa1e1940a97a600309bc6bd72a/FreeRTOS/Demo/Common/ethernet/lwip-1.4.0/src/api/sockets.c But if that is the case, why isn't the call returning a -1 value and then raising an exception? Maybe each platform for FreeRTOS defines |
I want to disable the test for FreeRTOS, but Testament isn't working when I spec: I made #19137 to change that in Testament. Waiting on that. |
It's not clear to me that it does. Or if it does that it'll work via POSIX. Also the tests for FreeRTOS were just meant for compile time checks as to properly test it'd need a QEMU setup. |
That seems fair. The Is |
Ok, maybe some other platform was hanging. It wasn't very clear to me.
I'm not sure, but I think it is for any fd type that can block, like pipes and sockets. |
I don't see what's failing. Something about 'tests/vm/tslow_tables.nim c' timing out, but I don't see that in the logs. I'm not familiar with Azure Pipelines. I ran the code on a Linux machine. It is hanging because the child proc isn't exiting or the io selector isn't signalling that it exited. I'll debug that when I get a chance over the next few days. |
@quantimnot FYI there's a "View more details on Azure Pipelines" on the Azure pipelines logs that'll let you dive into the full error details. |
setNonBlocking(stdin) | ||
doAssert(endOfFile(stdin)) | ||
setNonBlocking(getOsFileHandle(f), nonBlocking) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define for Windows too, but with a {.error: ....}
(less confusing than getting a "Undeclared identifier" error
@quantimnot did you ever get this figured out? I'm up for helping figure out any of the RTOS conflicts. |
@elcritch Thank you for the offer to help. I've been away a few weeks while I've focused on some important matters. I don't see any reasonable way to handle different RTOS ports having varying levels of POSIX compatibility, other than a build configuration phase that tests for compatibility and then sets a define flag. I could wrap the interface in a The current hangup with this PR is the test I made. A bug is making it hang on Linux. I haven't fixed it yet, because I got distracted on a POSIX FFI library that I've been experimenting with. I will get back to this as soon as I can. I also want to change the interface after I have chatted with alaviss: alaviss/nim-sys#29 |
Reading through the PR, I think you could pretty readily keep the network and file logic separate at the cost of duplicating a few lines of code. It seems like you could add these bits to setNonBlocking in native sockets:
Then when |
Looking up |
This pull request has been automatically marked as stale because it has not had recent activity. If you think it is still a valid PR, please rebase it on the latest devel; otherwise it will be closed. Thank you for your contributions. |
This pull request is stale because it has been open for 1 year with no activity. Contribute more commits on the pull request and rebase it on the latest devel, or it will be closed in 30 days. Thank you for your contributions. |
This pull request has been marked as stale and closed due to inactivity after 395 days. |
No description provided.