Re: Per-thread umask Marc Feeley 23 Apr 2020 11:59 UTC

> On Apr 23, 2020, at 7:47 AM, Lassi Kortela <xxxxxx@lassi.io> wrote:
>
>> In other words current-directory and (in a future release) current-umask are abstractions of the POSIX chdir() and umask() syscalls but they don’t actually call those syscalls (because the semantics of those syscalls in a threaded world is broken).
>
> So you would do it like:
>
> open(path, flags, mask & ~current_thread_umask)
>

Yes exactly, where “path” is an absolute path derived using the binding of current-directory (when the original path is relative), and “mask & ~current_thread_mask” is done in the Scheme RTS with (fxand mask (fxnot (current-umask))).

Marc