Page MenuHomeFreeBSD

lfs: Only define off64_t when _LARGEFILE64_SOURCE is defined
Needs ReviewPublic

Authored by imp on Sep 21 2023, 10:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 10, 10:42 AM
Unknown Object (File)
Fri, Sep 4, 8:31 PM
Unknown Object (File)
Sun, Aug 30, 11:30 PM
Unknown Object (File)
Aug 12 2026, 10:09 PM
Unknown Object (File)
Aug 11 2026, 11:26 PM
Unknown Object (File)
Aug 11 2026, 11:21 PM
Unknown Object (File)
Aug 8 2026, 12:49 AM
Unknown Object (File)
Jul 28 2026, 3:53 AM
Subscribers
None

Details

Reviewers
kib
cem
Summary

__LFS_VISIBLE controls visibility for the "large file sources" that was
defined by Sun. So put the off64_t behind this.

In addition, use __off64_t for cookie_seek_function_t typedef to not
require namespace polution for this to be present.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 53666
Build 50557: arc lint + arc unit

Event Timeline

imp requested review of this revision.Sep 21 2023, 10:17 PM
imp created this revision.
imp added a reviewer: cem.
lib/libc/stdio/fopencookie.c
118

I do not think we need changes to the .c files, off64_t should be visible with libc compilation setting.

lib/libc/stdio/fopencookie.c
118

I did this to match the prototype type, but you're right: we always have off64_t defined here.

One problem with this, is that off64_t isn't available in BSD_VISIBLE contexts, and the tree fails to build.
Which is why I actually changed the off64_t to __off64_t above and which is why today it fails in more places as we've adopted it in more CDDL code.
Need to rethink this a little still, despite my thinking it was ready to go.