Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple updates, mostly for *stat*() #105

Merged
merged 13 commits into from
Dec 1, 2024
Merged

Conversation

fhgwright
Copy link
Contributor

See individual commits.

Notably:

  • Fixes stat inconsistency in some 32-bit 10.4 builds.
  • Adds stat64 header support for 10.4 SDK.
  • Adds INODE64 support for *stat*() on 10.4.
  • Reworks fstatat*() support, similar to previous item, fixing buffer overrun in some cases.
  • Adds new *stat*() tests.

Tested (both from repo and via temp Portfile) on:

Mac OS X 10.4.11 8S165, PPC, Xcode 2.5 8M2558
Mac OS X 10.4.11 8S2167, i386, Xcode 2.5 8M2558
Mac OS X 10.4.11 8S2167, x86_64, Xcode 2.5 8M2558
Mac OS X 10.5.8 9L31a, PPC, Xcode 3.1.4 9M2809
Mac OS X 10.5.8 9L31a, i386, Xcode 3.1.4 9M2809
Mac OS X 10.5.8 9L31a, x86_64, Xcode 3.1.4 9M2809
Mac OS X 10.5.8 9L31a, PPC (i386 Rosetta), Xcode 3.1.4 9M2809
Mac OS X 10.6.8 10K549, i386, Xcode 3.2.6 10M2518
Mac OS X 10.6.8 10K549, x86_64, Xcode 3.2.6 10M2518
Mac OS X 10.6.8 10K549, PPC (i386 Rosetta), Xcode 3.2.6 10M2518
Mac OS X 10.7.5 11G63, x86_64, Xcode 4.6.3 4H1503
OS X 10.8.5 12F2560, x86_64, Xcode 5.1.1 5B1008
OS X 10.9.5 13F1911, x86_64, Xcode 6.2 6C131e
OS X 10.10.5 14F2511, x86_64, Xcode 7.2 7C68
OS X 10.11.6 15G22010, x86_64, Xcode 8.1 8B62
macOS 10.12.6 16G2136, x86_64, Xcode 9.2 9C40b
macOS 10.13.6 17G14042, x86_64, Xcode 10.1 10B61
macOS 10.14.6 18G9323, x86_64, Xcode 11.3.1 11C505
macOS 10.15.7 19H15, x86_64, Xcode 12.4 12D4e
macOS 11.7.10 20G1427, x86_64, Xcode 13.2.1 13C100
macOS 11.7.10 20G1427, arm64, Xcode 13.2.1 13C100
macOS 12.7.6 21H1320, x86_64, Xcode 14.2 14C18
macOS 12.7.6 21H1320, arm64, Xcode 14.2 14C18
macOS 13.7.1 22H221, arm64, Xcode 15.2 15C500b
macOS 14.7.1 23H222, arm64, Xcode 16.1 16B40
macOS 15.1 24B83, arm64, Xcode 16.1 16B40

The FORCE_ARCH removal was overlooked in cf1a237.

TESTED:
Builds still work.
See the comment for details.

TESTED:
Builds and passes tests on all platforms.
This provides support in the headers for the stat64 struct with the
10.4 SDK, as follows:

MacportsLegacySupport.h adds feature flags for stat64 support on 10.4.

The internal __DARWIN_STRUCT_STAT64 macro is defined.

Symbol versioning macros related to INODE64 are added.

The "struct stat64" definition is provided when appropriate, along
with prototypes for the *stat64() functions.

Accommodations are made for the switch from _APPLE_C_SOURCE to
_DARWIN_C_SOURCE between the 10.4 and 10.5 SDKs.

It does not include library support for *stat64() on 10.4, which
is left for a separate commit.

TESTED:
Builds and passes tests	on all platforms.
This makes the function argument types consistent.

TESTED:
Builds and passes tests	on all platforms.
This adds support for some 64-bit-inode function variants on 10.4.

TESTED:
Builds and passes tests	on all platforms.
This changes the inconsistency fix to make it easier to make use of
the partial 64-bit-inode suport on 10.4.  It has the effect of making
the 32-bit behavior consistent with the 64-bit behavior.

TESTED:
Builds and passes tests	on all platforms.
This currently excludes the fstatat*() tests, until the known issue is
fixed.

TESTED:
Fails on 10.4 prior to statxx addition.
Passes on all platforms with statxx.
Adds the missing versioning to the fstatat() prototype.

Moves fstatat*() to statxx.c (from atcalls.c), where it has the proper
"stat build" environment.

Provides all variants of fstatat(), for inode bitness compatibility.

Removes fstatat$INODE64 from symbol_aliases.c, since it now has an
explicit definition.  Also removes it from test_symbol_aliases.

Fixes the parameter names in the "at" function prototypes to match the
manpages.

TESTED:
Builds and passes tests	on all platforms.
This adds tests for fstatat() and fstatat64() to test_stat, both with
AT_FDCWD and with a real directory.

TESTED:
Fails prior to fstatat() update to statxx.
Builds and passes tests	 on all platforms after update.
This was never appropriate - see the comment.

TESTED:
Builds and passes tests	on all platforms.
The condition for disabling the ino32 wrappers is now more correct.

The comments and message are improved for the ino64 wrappers.

TESTED:
Builds and passes tests	on all platforms.
The new stat test covers everything that the old test did and more,
along with fewer restrictions and better messages.
@fhgwright
Copy link
Contributor Author

@mascguy
Here's another round. I'll update the -devel port once this is merged.

Copy link
Member

@mascguy mascguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mascguy mascguy merged commit 0f1292b into macports:master Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants