Skip to content
Snippets Groups Projects
Commit dd4e1faf authored by koenigl's avatar koenigl
Browse files

read/write: Fix signature after moving into separate function

parent 354829d8
Branches
No related tags found
No related merge requests found
......@@ -173,8 +173,8 @@ pub fn get_errno() -> c_int {
///
/// [open], [write]
///
pub fn read(fildes: c_int, mut buf: &mut [c_char], nbyte: size_t) -> ssize_t {
let buf: *mut c_void = &mut buf as *mut _ as *mut c_void;
pub fn read(fildes: c_int, buf: &mut [c_char], nbyte: size_t) -> ssize_t {
let buf: *mut c_void = buf as *mut _ as *mut c_void;
return unsafe { libc::read(fildes, buf, nbyte) };
}
......@@ -221,8 +221,8 @@ pub fn read(fildes: c_int, mut buf: &mut [c_char], nbyte: size_t) -> ssize_t {
///
/// [open], [read]
///
pub fn write(fildes: c_int, mut buf: &[c_char], nbyte: size_t) -> ssize_t {
let buf: *mut c_void = &mut buf as *mut _ as *mut c_void;
pub fn write(fildes: c_int, buf: &[c_char], nbyte: size_t) -> ssize_t {
let buf: *const c_void = buf as *const _ as *const c_void;
return unsafe { libc::write(fildes, buf, nbyte) };
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment