mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
provide more libc functions for the expect implementation
This commit is contained in:
parent
d27eff1b36
commit
19ea3489cb
17 changed files with 426 additions and 31 deletions
|
@ -54,6 +54,41 @@ pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut
|
|||
libc::memset(dst, c, n)
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_getppid() -> libc::pid_t {
|
||||
libc::getppid()
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_mmap(
|
||||
addr: *mut libc::c_void,
|
||||
len: libc::size_t,
|
||||
prot: libc::c_int,
|
||||
flags: libc::c_int,
|
||||
fd: libc::c_int,
|
||||
offset: libc::off_t,
|
||||
) -> *mut libc::c_void {
|
||||
libc::mmap(addr, len, prot, flags, fd, offset)
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_shm_open(
|
||||
name: *const libc::c_char,
|
||||
oflag: libc::c_int,
|
||||
mode: libc::mode_t,
|
||||
) -> libc::c_int {
|
||||
libc::shm_open(name, oflag, mode)
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_send_signal(pid: libc::pid_t, sig: libc::c_int) -> libc::c_int {
|
||||
libc::kill(pid, sig)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn rust_main() -> i32 {
|
||||
unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue