Thread (3 messages) flat view 3 messages, 3 authors, 2013-11-21

Is `IS_ERR_VALUE` indicates that the return value is invalid?

From: 乃宏周 <hidden>
Date: 2013-11-07 05:41:07

In kernel source, `IS_ERR_VALUE` is defined:

#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)

It's usage can be realized literally, but definition is not.
Can I use this macro to determines the kernel API's result is valid?

Example:
if (IS_ERR_VALUE(filp_open(device)))
{
    filp_close(device);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20131107/31836967/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help