Add redox_fpath function

This commit is contained in:
Jeremy Soller
2018-12-13 14:46:27 -07:00
parent f7b3abc1b6
commit 4e741f5583
3 changed files with 31 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#ifndef _SYS_REDOX_H
#define _SYS_REDOX_H
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __redox__
ssize_t redox_fpath(int fd, void * buf, size_t count);
#endif
#ifdef __cplusplus
} // extern "C"
#endif
#endif
+10
View File
@@ -0,0 +1,10 @@
use core::slice;
use platform::types::*;
use super::e;
#[no_mangle]
pub unsafe extern "C" fn redox_fpath(fd: c_int, buf: *mut c_void, count: size_t) -> ssize_t {
e(syscall::fpath(fd as usize, slice::from_raw_parts_mut(buf as *mut u8, count))) as ssize_t
}
+1
View File
@@ -28,6 +28,7 @@ use io::{self, BufReader, SeekFrom};
use super::types::*;
use super::{errno, Pal, Read};
mod extra;
mod pte;
mod signal;
mod socket;