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
No related branches found
No related tags found
No related merge requests found
...@@ -173,8 +173,8 @@ pub fn get_errno() -> c_int { ...@@ -173,8 +173,8 @@ pub fn get_errno() -> c_int {
/// ///
/// [open], [write] /// [open], [write]
/// ///
pub fn read(fildes: c_int, mut buf: &mut [c_char], nbyte: size_t) -> ssize_t { pub fn read(fildes: c_int, buf: &mut [c_char], nbyte: size_t) -> ssize_t {
let buf: *mut c_void = &mut buf as *mut _ as *mut c_void; let buf: *mut c_void = buf as *mut _ as *mut c_void;
return unsafe { libc::read(fildes, buf, nbyte) }; 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 { ...@@ -221,8 +221,8 @@ pub fn read(fildes: c_int, mut buf: &mut [c_char], nbyte: size_t) -> ssize_t {
/// ///
/// [open], [read] /// [open], [read]
/// ///
pub fn write(fildes: c_int, mut buf: &[c_char], nbyte: size_t) -> ssize_t { pub fn write(fildes: c_int, buf: &[c_char], nbyte: size_t) -> ssize_t {
let buf: *mut c_void = &mut buf as *mut _ as *mut c_void; let buf: *const c_void = buf as *const _ as *const c_void;
return unsafe { libc::write(fildes, buf, nbyte) }; 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