# link: avoid passing bad ptrs to pwritev · gitcafe/zig

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

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

Visibility: public

Requested revision: ea3db3274d890b7d00c907c037ffe203f41adbd3

Requested commit: ea3db3274d890b7d00c907c037ffe203f41adbd3

Commit: ea3db3274d890b7d00c907c037ffe203f41adbd3

Tree: eb21fc1c8c8edbdedc37c4913f8d88f97f090310

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
link: avoid passing bad ptrs to pwritev

At least on Linux, the pwritev syscall checks the pointer and returns
EFAULT before it checks if the length is nonzero.

Perhaps this should be fixed in the standard library, however, these are
still improvements since they make the kernel do less work within the
syscall.

```

## Parents

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

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