From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 2/2] libio: Fix seek-past-end returned size for open_{w}memstream (BZ#15298)
Date: Mon, 29 Aug 2016 14:43:00 -0000 [thread overview]
Message-ID: <7c2ee96b-a012-29d8-b60d-781d0cfc1bc3@linaro.org> (raw)
In-Reply-To: <a10cf640-9dfe-4347-5725-e87fccd219e9@redhat.com>
On 26/08/2016 07:14, Florian Weimer wrote:
> On 08/05/2016 07:40 PM, Adhemerval Zanella wrote:
>> +static _IO_off64_t
>> +_IO_wmem_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
>> +{
>> + struct _IO_FILE_wmemstream *mp = (struct _IO_FILE_wmemstream *) fp;
>> + if (fp->_wide_data->_IO_write_ptr != mp->seekwriteptr)
>> + mp->prevwriteptr = fp->_wide_data->_IO_write_ptr;
>> + _IO_off64_t ret = _IO_wstr_seekoff (fp, offset, dir, mode);
>> + mp->seekwriteptr = fp->_wide_data->_IO_write_ptr;
>> + return ret;
>> +}
>
> As far as I can see, glibc will not call seekoff from the vfprintf code, ever, and _IO_wstr_jumps is only used for that. This means the only actual use of _IO_wstr_seekoff is in the wmemstream code. So you could rename/move _IO_wstr_seekoff and change it directly. It should be fine to use a NULL pointer in _IO_wstr_jumops, just like _IO_obstack_jumps does.
>
I though about moving both (while providing a compat symbol), but for consistency
I preferred to keep current code organization (so wmemstream and memstream would
be similar).
I see that a future cleanup on {w}memstream is possible, with a more simple
implementation.
> In contrast, _IO_str_seekoff is used from libstdc++ in GCC 2.95, so we cannot change it.
>
> Florian
>
next prev parent reply other threads:[~2016-08-29 14:43 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 17:41 [PATCH 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181) Adhemerval Zanella
2016-08-05 17:41 ` [PATCH 2/2] libio: Fix seek-past-end returned size for open_{w}memstream (BZ#15298) Adhemerval Zanella
2016-08-26 10:15 ` Florian Weimer
2016-08-29 14:43 ` Adhemerval Zanella [this message]
2016-08-05 20:11 ` [PATCH 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181) Andreas Schwab
2016-08-05 21:00 ` Adhemerval Zanella
2016-08-08 20:43 ` [PATCH v2 " Adhemerval Zanella
2016-08-08 20:43 ` [PATCH v2 2/2] libio: Fix seek-past-end returned size for open_{w}memstream (BZ#15298) Adhemerval Zanella
2016-08-25 19:53 ` Adhemerval Zanella
2016-08-25 19:53 ` [PATCH v2 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181) Adhemerval Zanella
2016-09-30 0:06 ` Adhemerval Zanella
2016-09-30 10:12 ` Andreas Schwab
2016-10-01 9:17 ` Andreas Schwab
2016-10-02 13:29 ` Adhemerval Zanella
2017-04-19 9:17 ` Maintaining libio (was: Re: [PATCH v2 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181)) Florian Weimer
2017-04-19 12:35 ` Dmitry V. Levin
2017-04-19 12:52 ` Zack Weinberg
2017-04-19 13:03 ` Dmitry V. Levin
2017-04-19 13:01 ` Maintaining libio Florian Weimer
2017-04-19 13:17 ` Dmitry V. Levin
2017-04-19 13:23 ` Florian Weimer
2017-04-19 12:52 ` Maintaining libio (was: Re: [PATCH v2 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181)) Zack Weinberg
2017-04-19 14:48 ` Maintaining libio Adhemerval Zanella
2017-04-19 15:02 ` Florian Weimer
2017-04-19 15:17 ` Adhemerval Zanella
2017-04-20 15:44 ` Maintaining libio (was: Re: [PATCH v2 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181)) Zack Weinberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7c2ee96b-a012-29d8-b60d-781d0cfc1bc3@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).