tech-kern archive

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

Re: Proposal for new syscalls: getrusagex and waitx




On Oct 18, 2008, at 11:10 AM, David Holland wrote:

On Thu, Oct 16, 2008 at 10:09:39PM -0700, Matt Thomas wrote:
I'd to add return some additional data in getrusage or wait4. Extending struct rusage seems to be a losing proposition since I will need to version the syscalls and provide compatiblity shims. I might as well just add
variants that return proplib dictionaries with the information.

int getrusagex(int who, struct plistref *dict)
int waitx(pid_t wpid, int *status, int options, struct plistref *rusage);

That should be wait5, for consistency with the various other forms of
wait.

I use x because these are eXtensible. No reason to version then futher since
the proplib can adapt.

More importantly, however, do you expect the additional data to be of
interest to 3rd-party callers? Because if so we'll end up doing all
the same versioning to provide an extended struct rusage to them,
except that it'll have to be done in libc where such versioning is
much harder. That's not a win.

Huh? I intend to return more statistics. There's no reason to do anything in libc. If you want to access the new items, just grab them directly from
the proplib.

It is not reasonable to expect that 3rd-party callers are going to
wade through a proplist, especially since the existence and some of
the contents of struct rusage are defined by the pertinent standards.

If they don't know the new information, they can continue to use the existing
wait4/getrusage.

So unless what you're intending to add is of no value except to one or
two system utilities, this doesn't seem like a good idea. (And if it
is only of such value, it seems like there are simpler ways to
proceed.)

I guess that depends on your definition of simpler. Versioning struct rusage seems to be as much work and then it only works once. With a probib, once it's
been once it doesn't need to be done ever again.

As for the items I want to add, a description of those can wait for later.

Well, no, I think that's pretty important, for the above reasons.

Well, I think you're reasons are for the most bogus.


Home | Main Index | Thread Index | Old Index