Shm_open help

hello

linux
var fd = shm_open(&name, std.os.O_RDWR | std.os.O_CREAT | std.os.O_EXCL, 666);

? O_RDWR
? O_CREAT
? O_EXCL

I can’t find a solution

The flags are defined in the packed struct std.posix.linux.O.
ACCMODE is an enum.

Example usage:

const flag: std.posix.linux.O = .{
    .ACCMODE = .RDWR,
    .CREAT = true,
    .EXCL = true,
};

var fd = shm_open(&name, @bitCast(flag), 0o666);

Also note the 0o prefix of 666 to denote octal instead of decimal.

3 Likes

Thank you the two posts of my last posts, opened a big door for me to set up IBM GDA (it is the equivalent of a dataarea common to the user session) this allows communication between several jobs

1 Like