Is there a reason execveat is missing?

I went looking for the execveat syscall in the standard library (on 0.15.2). There are other exec-family syscalls in there, but not this one. Given the preference for file/directory handles in the standard library, this surprised me. My assumption is that there’s a reason for this other than “didn’t get to it”, so I’m curious what that reason is. It’s also entirely possible that there’s an equivalent function that I failed to find, but I did look elsewhere.

1 Like

Probably because the compiler and build system have no need for it. There is a WIP project for ziglibc, so it could be that it just hasn’t been done yet.

3 Likes

Seems to be in master at least
https://codeberg.org/ziglang/zig/src/branch/master/lib/std/os/linux.zig#L652-L654

If you want to just spawn child process with custom cwd, then std.process.Child supports all that just fine.

1 Like

Looks like my assumption that there was a reason other than “haven’t gotten to it yet” was probably incorrect :slight_smile:

1 Like