On Fri, Dec 4, 2015 at 2:54 PM, Tobias Stoeckmann <[email protected]> wrote:
> On Fri, Dec 04, 2015 at 03:47:07PM -0700, Theo de Raadt wrote:
>> > Is it worth it, knowing that it's a deprecated BSD-specific function?
>>
>> Careful there :-) It isn't deprecated in the BSD's, and it isn't
>> deprecated in any other system which is still doing maintainance and
>> improvements to it...
>
> $ grep usershell /usr/src/lib/libc/hidden/unistd.h
> PROTO_DEPRECATED(endusershell);
> PROTO_DEPRECATED(getusershell);
> PROTO_DEPRECATED(setusershell);
>
> Formally, it is deprecated.

<sigh>  That's not what that macro means, sorry.


> Which is why I had to introduce the
> usershell_reset function.  We are not able to call endusershell from
> within setusershell due to these entries, which Mike's code does.

You should read /usr/srclib/libc/include/README and follow the logic
there for each symbol you add *and* possibly adjust existing symbols
per those steps.  For example, if the new code wants to call
endusershell(), then change PROTO_DEPRECATED(endusershell) to
PROTO_NORMAL(endusershell) and add a DEF_WEAK(endusershell) in the .c
file which defines it.

(Why "PROTO_DEPRECATED"?  Because it uses gcc's
__attribute__((deprecated)) to detect attempts to use external symbols
when an internal symbol should be used.  I should have stuck with my
intent to rename the macro, but I was encouraged to leave it as is.
Sigh)


Philip Guenther

Reply via email to