rust-lang / rust-lang/libc

Look at doing the equivalent of `#define _FILE_OFFSET_BITS 64` on windows-gnu

Open
#5,181 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.6k
Forks
1.3k
Avg merge
1d 22h
Merged PRs (30d)
69

Description

windows-gnu does not seem to set _FILE_OFFSET_BITS 64 by default, but allows it to be set. We may want to make this change in libc for 1.0 (i.e. off_t = i64 and change what the functions link) if there's any chance MinGW changes their default.

I took a look at https://sourceforge.net/p/mingw-w64/bugs/ but didn't see anything.

It's actually kind of a weird setup because time_t is 64 bits on all platforms, but the glibc docs (https://sourceware.org/glibc/manual/latest/html_node/Feature-Test-Macros.html) say:

_TIME_BITS=64 can be defined only when _FILE_OFFSET_BITS=64 is also defined.

Size demo: https://c.godbolt.org/z/47W65PdT1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by confirming how windows-gnu currently handles _FILE_OFFSET_BITS and review the libc bindings for that target. Compare the size demo and relevant MinGW behavior, then determine whether libc should make off_t i64 and change the linked functions for 1.0; the desired compatibility outcome is not yet settled.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.