[Top][All Lists]

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

Re: Is deallocating MACH_PORT_NULL an error ?

From: Justus Winter
Subject: Re: Is deallocating MACH_PORT_NULL an error ?
Date: Thu, 22 Jan 2015 23:47:24 +0100
User-agent: alot/0.3.5

Quoting Samuel Thibault (2015-01-22 22:37:49)
> Justus Winter, le Thu 22 Jan 2015 22:22:04 +0100, a écrit :
> > So do we consider {deallocating,destroying,mod_refing} MACH_PORT_NULL
> > or MACH_PORT_DEAD an error, or an expensive nop ?
> AIUI frobbing PORT_DEAD is quite common indeed, like something died
> while doing something, and we ended up with a dead name.

But surely that can only happen to rights in transit, right?  If so,
it should be checked for validity before first use.

> Frobbing PORT_NULL would be like free(NULL), it doesn't seem
> necessarily a bad practice to be, it can simplify some code.

Then the kernel shouldn't return an error condition.

> At least those do not do horrible things.  I added the warnings
> about frobbing bogus ports because that was actually doing horrible
> things when the bogus port happened to be reused for something else.

Indeed.  And while this is good to notify us of important issues, it'd
be nice to gradually improve the error handling of these calls.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]