Skip to content

having trouble compiling on Alpine 3.17 #111

Closed
@dmolik

Description

@dmolik

I'm getting the following with rust 1.66.1, and musl 1.2.3-r4:

error[E0425]: cannot find function `copy_file_range` in crate `libc`
    --> src/devices/src/virtio/fs/linux/passthrough.rs:1721:19
     |
1721 |             libc::copy_file_range(
     |                   ^^^^^^^^^^^^^^^
     |
    ::: /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.126/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs:576:1
     |
576  | pub const SYS_copy_file_range: ::c_long = 326;
     | --------------------------------------- similarly named constant `SYS_copy_file_range` defined here
     |
help: a constant with a similar name exists
     |
1721 |             libc::SYS_copy_file_range(
     |                   ~~~~~~~~~~~~~~~~~~~
help: consider importing this function
     |
5    | use nix::fcntl::copy_file_range;
     |
help: if you import `copy_file_range`, refer to it directly
     |
1721 -             libc::copy_file_range(
1721 +             copy_file_range(
     |

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions