Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 2 Mar 2016 22:01:39 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH 0/2] add sched_getcpu, take n+1

On Wed, Mar 02, 2016 at 05:26:25PM +0100, Nathan Zadoks wrote:
> > Wrong macro in the #ifdef.
> Whoops, thanks, fixed!
> 
> > Not a big deal, but usually in musl we use 0 rather than the NULL
> > macro.
> Learnt a new thing there - fixed!
> 
> > Actually I wondered if the function actually needs to take the useless
> > extra 2 arguments, but I think for the sake of correctness it's best
> > to do it this way -- the callee in the vdso has 3 args, so it should
> > be called with the correct type.
> The second argument actually needs to be null: it's an out pointer for
> an identifier for the NUMA node. sched_getcpu doesn't have a spot for
> returning it, so we pass a null pointer there, which ignores it.
> The *third* argument is a pointer to a now-unused cache structure,
> and could probably be omitted safely. It's required to be non-NULL on kernels
> older than 2.6.23, but we'd just end up corrupting random memory there
> instead of getting an EFAULT. Not worth saving a register zeroing instruction.

Agreed.

> > One other thing I thought might be nice is initially committing the
> > trivial syscall-only version that adds the public prototype, then
> > doing vdso support as a separate commit, but if that's a pain to do
> > don't worry about it.
> No problem! Some git trickery later, I've got this sorted.

Great. Applying now. Thanks!

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.