# lib/std: PermissionDenied/AccessDenied cleanup and fallout · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/14c046fc0728070c575c0e849b7be649cbb2b9a0)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 14c046fc0728070c575c0e849b7be649cbb2b9a0

Requested commit: 14c046fc0728070c575c0e849b7be649cbb2b9a0

Commit: 14c046fc0728070c575c0e849b7be649cbb2b9a0

Tree: 0cd70f8ed2bd9d549609c289c3e62b93dff25dd2

Author: Pat Tullmann

Committer: Alex Rønne Petersen

## Message

```
lib/std: PermissionDenied/AccessDenied cleanup and fallout

This PR consistently maps .ACCES into AccessDenied and .PERM into
PermissionDenied.  AccessDenied is returned if the file mode bit
(user/group/other rwx bits) disallow access (errno was `EACCES`).
PermissionDenied is returned if something else denies access (errno was
`EPERM`) (immutable bit, SELinux, capabilities, etc).  This somewhat
subtle distinction is a POSIX thing.

Most of the change is updating std.posix Error Sets to contain both
errors, and then propagating the pair up through caller Error Sets.

Fixes #16782

```

## Parents

- [02373eb2a59f4a16a06460c244958e236b1c5291](https://git.cafe/gitcafe/zig/commit/02373eb2a59f4a16a06460c244958e236b1c5291?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/14c046fc0728070c575c0e849b7be649cbb2b9a0?format=markdown)
