-
Notifications
You must be signed in to change notification settings - Fork 7.8k
main/streams/plain_wrapper: skip lseek(SEEK_CUR) for newly opened files #8540
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
Conversation
What about open mode "a"? |
Good point - I'll amend the patch to exclude append mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This looks reasonable to me, although I'm not too happy with the (minor) BC break.
Which BC break do you mean? |
The additional parameter to |
A file that has just been opened is known to be at offset zero, and the lseek(SEEK_CUR) system call to determine the current offset can be skipped.
250d181
to
5aad60b
Compare
If that's important, I can rename the function and add the old one as compatibility wrapper, but that adds to the legacy baggage the code base has to carry around. You decide which is better, and I can amend the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I think the potential BC break is acceptable; it just needs an entry in UPGRADING.INTERNALS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Another nice change ;-)
A file that has just been opened is known to be at offset zero, and
the lseek(SEEK_CUR) system call to determine the current offset can be
skipped.