This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] manual: Document getcontext uc_stack value on Linux [BZ #759]


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.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]