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

fix bug of sys_rt_sigaction, sys_poll, add sys_clock_nanosleep, sys_g… #139

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

lhw2002426
Copy link
Contributor

…etsockopt

@@ -21,6 +21,26 @@ use ruxnet::{TcpSocket, UdpSocket};
use crate::ctypes;
use crate::utils::char_ptr_to_str;

const SOL_SOCKET: i32 = 1;
Copy link
Contributor

@ken4647 ken4647 Sep 14, 2024

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.

Socket::Tcp(_) => ctypes::SOCK_STREAM,
},
SO_RCVLOWAT | SO_SNDLOWAT => 1,
SO_BROADCAST => 1,
Copy link
Contributor

@ken4647 ken4647 Sep 14, 2024

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,?

Copy link
Contributor Author

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.

) -> c_int {
syscall_body!(sys_clock_nanosleep, {
unsafe {
if req.is_null() || (*req).tv_nsec < 0 || (*req).tv_nsec > 999999999 {
Copy link
Contributor

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 .

Copy link
Contributor

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: )

@ken4647 ken4647 merged commit 76c0278 into syswonder:dev Sep 19, 2024
10 checks passed
lhw2002426 added a commit to lhw2002426/rukos that referenced this pull request Sep 23, 2024
Merge pull request syswonder#139 from lhw2002426/dev
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.

2 participants