# std: Make copy_file_range checks run at compile-time · gitcafe/zig

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

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

Visibility: public

Requested revision: b72d55ea5fa1de0c55e2cfb9aa65f4ec80986bc9

Requested commit: b72d55ea5fa1de0c55e2cfb9aa65f4ec80986bc9

Commit: b72d55ea5fa1de0c55e2cfb9aa65f4ec80986bc9

Tree: 2e4c355f3e4f9e0c6a2ea6b9b0cd5cb1de02049c

Author: LemonBoy

Committer: Andrew Kelley

## Message

```
std: Make copy_file_range checks run at compile-time

* Avoid emitting the copy_file_range symbol at all to prevent link-time
  errors.
* Fix a bug in the check logic, the has_copy_file_range_syscall was
  set to the wrong value in case of ENOSYS
* If link_libc is true don't fall-back to the raw syscall approach,
  there's no policy about what to do in this case but let's follow what
  the other impls do.

Fixes #9146

```

## Parents

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

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