lua-users home
lua-l archive

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


On Wed, 3 Feb 2010, Patrick Donnelly wrote:
> On Tue, Feb 2, 2010 at 12:30 PM, Mike Pall <mikelu-1002@mike.de> wrote:
> >
> > What really counts is commonly accepted usage. So, while I can buy
> > the need for MAP_FAILED et al, any reasonable Lua/C binding ought
> > to convert this to nil or throw an error.
>
> What about "sentinel" defined values like those in the socket
> libraries. On my GNU system:
>
> #define SIG_ERR ((__sighandler_t)-1)    /* error return from signal */
>
> I'm not sure why someone would want to push a SIG_ERR lightuserdata
> but I imagine it could come up.

SIG_ERR ought to be converted to nil just like MAP_FAILED, and
PTHREAD_CANCELLED too, I think. I don't know of any odd pointer values in
the sockets API. There are some funny RTLD_* and fenv.h FE_* pointer
values on some systems. And I think that's about it for core Unix APIs.

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS.
MODERATE OR GOOD.