tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Basesystem programs redefine routine symbols from libc



On 09.12.2017 23:35, Kamil Rytarowski wrote:

> I think that reusing symbol names of well-known standard functions from
> libc is at least misleading and shouldn't happen - so the process of
> renaming such functions is improving the situation.
> 

I've checked POSIX standard and it looks like ps(1) was violating POSIX
rules.

"
The following identifiers are reserved regardless of the inclusion of
headers:

[..]

4. All functions and external identifiers defined in XBD Headers are
reserved for use as identifiers with external linkage.

5. All the identifiers defined in this volume of POSIX.1-2008 that have
external linkage are always reserved for use as identifiers with
external linkage."

This means that 'uname' was reserved and must not be used in POSIX code,
regardless of the inclusion of headers.

ISO C standard is less strict about this and this is why it happened to
work.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index