roc/crates/compiler/builtins/bitcode/src/expect.zig
2022-08-12 23:03:01 +02:00

23 lines
570 B
Zig

const std = @import("std");
const SIGUSR1: c_int = 10;
const O_RDWR: c_int = 2;
const O_CREAT: c_int = 64;
pub const PROT_WRITE: c_int = 2;
pub const MAP_SHARED: c_int = 0x0001;
// IMPORTANT: shared memory object names must begin with / and contain no other slashes!
var SHARED_BUFFER: []u8 = undefined;
pub fn setSharedBuffer(ptr: [*]u8, length: usize) callconv(.C) usize {
SHARED_BUFFER = ptr[0..length];
// the rust side expects that a pointer is returned
return 0;
}
pub fn expectFailedStart() callconv(.C) [*]u8 {
return SHARED_BUFFER.ptr;
}