Skip to content

How to use libc in Windows #3545

@akitaSummer

Description

@akitaSummer

Hello, I've been working on a user-space file system project, and I've been using libc on Linux and macOS, which has been quite useful. However, I'm not sure if libc is still applicable on Windows. For instance, I have the following code:

write(
    file.as_raw_fd(),
    slice.as_ptr() as *const c_void,
    slice.len(),
)

This code works fine on Linux, but it's not compatible with Windows because Windows doesn't have file descriptors (fd), only handles. I'd like to ask whether it's possible to use libc on Windows, and if so, how should I modify my code?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions