mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
include process id in expect buffer name
This commit is contained in:
parent
19ea3489cb
commit
2b60cb1dcd
2 changed files with 10 additions and 5 deletions
|
@ -30,8 +30,13 @@ extern fn roc_getppid() c_int;
|
|||
|
||||
pub fn readSharedBufferEnv() callconv(.C) void {
|
||||
if (builtin.os.tag == .macos or builtin.os.tag == .linux) {
|
||||
const name = "/roc_expect_buffer"; // IMPORTANT: shared memory object names must begin with / and contain no other slashes!
|
||||
const shared_fd = roc_shm_open(@ptrCast(*const i8, name), O_RDWR | O_CREAT, 0o666);
|
||||
// const name = "/roc_expect_buffer";
|
||||
|
||||
// IMPORTANT: shared memory object names must begin with / and contain no other slashes!
|
||||
var name: [100]u8 = undefined;
|
||||
_ = std.fmt.bufPrint(name[0..100], "/roc_expect_buffer_{}\x00", .{roc_getppid()}) catch unreachable;
|
||||
|
||||
const shared_fd = roc_shm_open(@ptrCast(*const i8, &name), O_RDWR | O_CREAT, 0o666);
|
||||
const length = 4096;
|
||||
|
||||
const shared_ptr = roc_mmap(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue