-
-
Notifications
You must be signed in to change notification settings - Fork 30
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 fixes and new features - see individual commit messages #109
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since the NULL fsec case doesn't have the 10.4 Rosetta bug, it should be tested separately. Also fixes misplaced fclose() in previous fstatx_np() tests. TESTED: Passes on all platforms, including with Rosetta.
This provides the missing byte swap for fstatx_np() on 10.4 Rosetta. See the comment for details. TESTED: Passes tests on all platforms, including 10.4 Rosetta cases.
Almost a revert of commit ba45d6c, but with conflicts fixed. TESTED: Without fix, fails on 10.4 Rosetta and passes on all others. With fix, passes on all platforms, including 10.4 Rosetta.
This almost reverts commit 4e3779a, but retains the better test_flags setup. TESTED: Without fix, fails on 10.4 Rosetta and passes on all others. With fix, passes on all platforms, including 10.4 Rosetta.
Commit 55fd6e3 rearranged the scandir/alphasort hacks such that they could apply in the non-POSIX case, where the underlying functions are undefined, causing bad references in the header. This fixes that. TESTED: Passes all tests, including darwin_c_full, which previously got warnings.
The declaration of renameat() is in sys/stdio.h, to match Apple's arrangement (when it exists) in 10.10+, but Apple also includes (directly or indirectly) sys/stdio.h from stdio.h, so we need to duplicate that behavior to ensure that stdio.h provides renameat() as expected. Closes: https://trac.macports.org/ticket/71842 TESTED: Passes all tests, including updated renameat test.
Closes: https://trac.macports.org/ticket/61691 Since a proper implementation of clock_gettime_nsec_np() would be significant work, and should be accompanied by some needed rework of time.c and test_time.c in general, for now we just provide a wrapper around clock_gettime(). This is functionally correct but suboptimal in performance. It also cleans up the scale factors, converting the fairly pointless THOUSAND to a number, removing the unused MILLIONS, and replacing BILLIONS with separate 32- and 64-bit versions, both now explictly unsigned. It also cleans up some include issues. TESTED: Passes all tests on all platforms, including added test.
Since this is currently just a wrapper around clock_gettime(), testing a single clock_id is sufficient. This whole test needs to be rewritten at some point, anyway. TESTED: Fails where expected without newly added function. Passes on all platforms otherwise.
Most manual tests don't need to build with the library, and prior to this change, *no* manual tests (except the old C++ tests) built with the library. This adds a naming convention to allow some manual tests to use the library, currently just the clock_settime() test. TESTED: Manual tests with and without the library build as expected.
Closes: https://trac.macports.org/ticket/71399 TESTED: Passes the new (manual) test on all platforms.
This test naturally requires running as root. It goes to considerable lengths to avoid leaving the time screwed up if something goes wrong, and to hide its temporary adjustment from other programs. TESTED: Fails where expected without the new support. Passes on all platforms with it.
This makes the 10.6 net/if_utun.h available in <10.6, though the relevant features may or may not actually work in <10.6. This may simply replace build-time errors with runtime errors, though that's sometimes a useful change. Closes: https://trac.macports.org/ticket/70231 TESTED: New test passes on all platforms with this change.
This header is normally missing from <10.6. This test verifies that we successfully added it. TESTED: Fails where expected without related fix. Passes on all platforms with the fix.
This provides both missing prototypes and missing function wrappers for the pthread_[f]chdir_np() functions, which were introduced as syscalls in 10.5, but not provided as functions until 10.12, and not provided as prototypes at all in any SDK. At present, no SDK for any OS version provides prototypes for these functions, even when the functions themselves are included in libSystem. For that reason, we condition the addition of the prototypes on the flag _MACPORTS_LEGACY_PTHREAD_CHDIR. This is ignored in the 10.4 SDK, since the functions themselves are not available in 10.4. The missing function wrappers are provided for 10.5-10.11. For 10.4, dummy functions that always fail are provided, though no SDK declarations are present in the 10.4 SDK, even with the enabling flag. Closes: https://trac.macports.org/ticket/71265 TESTED: Passes all tests on all platforms, including the new test.
This verifies both that the functions set the subthread's cwd as intended, and that the main thread's cwd is unchanged. TESTED: Passes on all platforms. Spot-checked test sensitivity with manually introduced bug.
Since best_fchdir is used in multiple sources, it needs to be global, but it shouldn't pollute the global namespace without a suitable prefix. TESTED: Passes all tests on all platforms.
@mascguy |
mascguy
approved these changes
Jan 20, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notable changes:
fstatx_np()
(and removes test carveouts for it)renameat()
available viastdio.h
(https://trac.macports.org/ticket/71842)clock_gettime_nsec_np()
(https://trac.macports.org/ticket/61691)clock_settime()
(https://trac.macports.org/ticket/71399)net/if_tun.h
for <10.6 (https://trac.macports.org/ticket/70231)pthread_[f]chdir_np()
for 10.5+ (https://trac.macports.org/ticket/71265)Tested, both from repo and via temp Portfile, on: