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

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

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

Visibility: public

Requested revision: e4225ca5f76760568c632d1f1c455e9d8759dce1

Requested commit: e4225ca5f76760568c632d1f1c455e9d8759dce1

Commit: e4225ca5f76760568c632d1f1c455e9d8759dce1

Tree: b40a3d748704ab3b2cbdec34abd6a8ef38fd3f45

Author: LemonBoy

Committer: Veikka Tuominen

## 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

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

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