This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] manual: Document getcontext uc_stack value on Linux [BZ #759]
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 8 Aug 2017 15:27:42 -0300
- Subject: Re: [PATCH] manual: Document getcontext uc_stack value on Linux [BZ #759]
- Authentication-results: sourceware.org; auth=none
- References: <1494961861-30734-1-git-send-email-adhemerval.zanella@linaro.org> <6d9cf350-c221-3fac-0088-384b42c45adb@linaro.org> <77500c0f-e6f6-43b8-b7b3-b3af65a5b968@linaro.org> <CAKCAbMiS7Ep7MhanttLCZ5VLTGBR3w92gPqckxBmeJh-PHkzHw@mail.gmail.com> <c4cc7c82-9d91-d678-f300-8a663867766f@linaro.org> <CAKCAbMiwk76D5fWeEci5=BTBnwX5u=v56EQT80JzBkWau6Tg3A@mail.gmail.com> <c237e67a-2b5b-672c-cc5d-444ba30e7923@linaro.org>
On 11/07/2017 18:43, Adhemerval Zanella wrote:
>
>
> On 11/07/2017 17:25, Zack Weinberg wrote:
>> On Tue, Jul 11, 2017 at 2:28 PM, Adhemerval Zanella
>> <adhemerval.zanella@linaro.org> wrote:
>>>
>>> Right, I do not have a preference here about the wording but I do think
>>> we should at least document Linux behaviour (which originated the bug
>>> report). What about:
>>>
>>> @strong{Compatibility Note:} Depending on the operating system,
>>> information about the current context's stack may be in the
>>> @code{uc_stack} field of @var{ucp}, or it may instead instead be in
>>> architecture-specific subfields of the @code{uc_mcontext} field.
>>> On Linux the current context's stack returned on @code{uc_stack}
>>> is empty by default.
>>
>> I actually think we _shouldn't_ document Linux's behavior in this
>> case. Without a great deal more verbiage about how to write code that
>> portably examines the result of getcontext, it's better to just say
>> "this information could be in two different places" than "this
>> information could be in two different places, and on system X it's in
>> this one." Good code has to be prepared to look in both places. That
>> is the best _short_ advice.
>
> Taking in consideration getcontext is deprecated and this is specific
> implementation detail I think it is still worth to mention Linux behaviour
> without the need of extending how to proper use this API (which should
> not be used in newer programs anyway and in my experience the program
> that still rely on such *context, libgo for instance, already have a
> lot of hacks for different systems). The manual imho should mainly
> document the current system supported and its idiosyncrasies.
>
Zack do you still think we should not document Linux behaviour? I
understand your point that for document getcontext in a portable
way it would require more explanation, but I think the goal here
is just document this specific Linux difference for this deprecated
symbol.