fix signature of _lseek() stub#775
Open
A-Dunstan wants to merge 1 commit intoPaulStoffregen:masterfrom
Open
Conversation
ssilverman
reviewed
Dec 15, 2025
|
|
||
| __attribute__((weak)) | ||
| int _lseek(int fd __attribute__((unused)), long long offset __attribute__((unused)), int whence __attribute__((unused))) | ||
| off_t _lseek(int fd __attribute__((unused)), off_t offset __attribute__((unused)), int whence __attribute__((unused))) |
Contributor
There was a problem hiding this comment.
I think the file should also include <sys/types.h>.
Ref: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_types.h.html
Contributor
Author
There was a problem hiding this comment.
Ideally all the weak functions should be in a separate file (syscalls.c?) since startup.c isn't really a suitable place for them, but I was going for brevity in the hopes of a quick merge...
Contributor
There was a problem hiding this comment.
I was referring to the definition of off_t.
This file contains hidden or 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
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.
The function signature for the default _lseek stub is incorrect, the second parameter should be a signed 32-bit value rather than 64-bits. The incorrect signature triggers a warning when the stub is replaced with a proper _lseek function (with correct signature, since the arguments aren't interpreted correctly with the bad one) and LTO is used.