tech-userlevel archive

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

Re: Addition of ppoll(2), a wrapper around pollts(2)



On Mon, 25 May, 2020, 09:36 Martin Husemann, <martin%duskware.de@localhost> wrote:

> On Mon, May 25, 2020 at 04:32:14AM +0530, Apurva Nandan wrote:
> > Hi all,
> > I have added ppoll(2) implementation to libc/sys, which is a wrapper
> around
> > pollts(2) function (basically, pollts(2) and ppoll(2) are aliases, and
> > NetBSD has pollts(2)).
>
> Why not just add a weak alias for the function? It seems the only
> difference
> is the name. Did I overlook something?
>

The problem with __weak_alias is that they only work inside the same C file
where the original symbol is defined, and don't work outside that file for
that symbol.

> This is done to increase the compatibility
> > with Linux, FreeBSD, OpenBSD, DragonFly and Illumos.
>
> The man page diff does not suggest any standards that define this function.
> If everyone else just picked a different name, shouldn't we just adjust
> the name and add a weak alias for the old name to keep compatibility
> (and add a note to remove it on the mythical libc bump)?
>

The function definition and description that it wraps around pollts(2) is
added, what else can be added?

> Please have a look on the patch attached hereby and commit it to base
> after
> > a review.
>
> The generated configure changes should probably not be done manually here.
> You did not add any uses of the function internally in libc, so I wonder
> if the namespace.h change is correct.
>
> If we end up with an alias in the end, no new atf test is needed.
>
> Martin
>

The configure.h changes is for enabling ppoll in external/bsd/nsd
I have created _ppoll internal function in libc, so it is added to
namespace.h . I have just created a macro that replace pollts(2) with
ppoll(2) in already written test t_pollts of ATF (I have also split t_poll
into t_poll and t_pollts).

Best Regards,
Apurva Nandan

>


Home | Main Index | Thread Index | Old Index