# cap getdents length argument to INT_MAX · gitcafe/zig

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

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

Visibility: public

Requested revision: 1d2fc446bd1cf90fb93a1164538dcc4530a06d33

Requested commit: 1d2fc446bd1cf90fb93a1164538dcc4530a06d33

Commit: 1d2fc446bd1cf90fb93a1164538dcc4530a06d33

Tree: ce0358206c00d93bf1524eefab28a6045c679ec6

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
cap getdents length argument to INT_MAX

the linux syscall treats this argument as having type int, so passing
extremely long buffer sizes would be misinterpreted by the kernel.
since "short reads" are always acceptable, just cap it down.

patch based on musl commit 3d178a7e2b75066593fbd5705742c5808395d90d

```

## Parents

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

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