@jlahd has posted a good answer. I would like to offer an alternative though.
if (id == (typeof(id)) -ETIMEDOUT)
I think that this will do similar but there is a problem with it. It isn't in the C standard and is a GCC extension.
You can read a little more about it here
Verbatim quote of @rici's comment:
Since you probably know some typedef which works as the type of id, you can presumably do this without typeof, although that is cleaner. However, it should be
(typeof(id))(-ETIMEDOUT)
(the parentheses around -ETIMEDOUT are just cosmetic but the unary minus is required.) Alternatively, the following should be pretty well foolproof:
if (-id == ETIMEDOUT)
since if id is signed, that obviously works; if id is unsigned, then unary minus has well-defined behaviour.