-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix bug of sys_rt_sigaction, sys_poll, add sys_clock_nanosleep, sys_g… #139
Conversation
api/ruxos_posix_api/src/imp/net.rs
Outdated
@@ -21,6 +21,26 @@ use ruxnet::{TcpSocket, UdpSocket}; | |||
use crate::ctypes; | |||
use crate::utils::char_ptr_to_str; | |||
|
|||
const SOL_SOCKET: i32 = 1; |
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.
Remove these definations and use ctyes::SO_BROADCAST
instead to make sure they are consistent, if there is no special reason.
api/ruxos_posix_api/src/imp/net.rs
Outdated
Socket::Tcp(_) => ctypes::SOCK_STREAM, | ||
}, | ||
SO_RCVLOWAT | SO_SNDLOWAT => 1, | ||
SO_BROADCAST => 1, |
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.
Is there any reason not to merge SO_RCVLOWAT | SO_SNDLOWAT => 1,
with SO_BROADCAST => 1,
?
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.
I thinked it may not impl in same time in the future, but merge them is also ok.
api/ruxos_posix_api/src/imp/time.rs
Outdated
) -> c_int { | ||
syscall_body!(sys_clock_nanosleep, { | ||
unsafe { | ||
if req.is_null() || (*req).tv_nsec < 0 || (*req).tv_nsec > 999999999 { |
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.
It would be better to replace 999999999
with const NANO_PER_SECOND = 1000000000
.
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.
and leave a comment here: )
Merge pull request syswonder#139 from lhw2002426/dev
…etsockopt