-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add more redox sys/socket.h and sys/uio.h definitions #4388
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,6 +131,22 @@ s! { | |
pub thousands_sep: *const c_char, | ||
} | ||
|
||
pub struct msghdr { | ||
pub msg_name: *mut c_void, | ||
pub msg_namelen: crate::socklen_t, | ||
pub msg_iov: *mut crate::iovec, | ||
pub msg_iovlen: size_t, | ||
pub msg_control: *mut c_void, | ||
pub msg_controllen: size_t, | ||
pub msg_flags: c_int, | ||
} | ||
|
||
pub struct cmsghdr { | ||
pub cmsg_len: size_t, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has been corrected in relibc with https://gitlab.redox-os.org/redox-os/relibc/-/commit/27f3924126f931f63659f5464f3b1d76a4123e09 |
||
pub cmsg_level: c_int, | ||
pub cmsg_type: c_int, | ||
} | ||
|
||
pub struct passwd { | ||
pub pw_name: *mut c_char, | ||
pub pw_passwd: *mut c_char, | ||
|
@@ -1212,6 +1228,12 @@ extern "C" { | |
pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int; | ||
|
||
// sys/socket.h | ||
pub fn CMSG_ALIGN(len: size_t) -> size_t; | ||
pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar; | ||
pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr; | ||
pub fn CMSG_LEN(len: c_uint) -> c_uint; | ||
pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr; | ||
pub fn CMSG_SPACE(len: c_uint) -> c_uint; | ||
pub fn bind( | ||
socket: c_int, | ||
address: *const crate::sockaddr, | ||
|
@@ -1225,11 +1247,33 @@ extern "C" { | |
addr: *mut crate::sockaddr, | ||
addrlen: *mut crate::socklen_t, | ||
) -> ssize_t; | ||
pub fn recvmsg(socket: c_int, msg: *mut msghdr, flags: c_int) -> ssize_t; | ||
pub fn sendmsg(socket: c_int, msg: *const msghdr, flags: c_int) -> ssize_t; | ||
pub fn sendto( | ||
socket: c_int, | ||
buf: *const c_void, | ||
len: size_t, | ||
flags: c_int, | ||
addr: *const crate::sockaddr, | ||
addrlen: crate::socklen_t, | ||
) -> ssize_t; | ||
|
||
// sys/stat.h | ||
pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; | ||
|
||
// sys/uio.h | ||
pub fn preadv( | ||
fd: c_int, | ||
iov: *const crate::iovec, | ||
iovcnt: c_int, | ||
offset: off_t, | ||
) -> ssize_t; | ||
pub fn pwritev( | ||
fd: c_int, | ||
iov: *const crate::iovec, | ||
iovcnt: c_int, | ||
offset: off_t, | ||
) -> ssize_t; | ||
pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; | ||
pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
From the linked source, should this also be
socklen_t
?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.
This has been corrected in relibc with https://gitlab.redox-os.org/redox-os/relibc/-/commit/27f3924126f931f63659f5464f3b1d76a4123e09