c++error-handlingoperating-system

What does *__errno()= some value mean?


So i am trying to understand simple OS system calls and stumbled upon this line of code witch i don't know what it means : *__errno()= msg.error.number;. Can somebody help me please?


Solution

  • It is very likely a multithreaded version of errno defined in errno.h.

    __errno() call will return a pointer to the thread local int,
    and *__errno()= msg.error.number; will write into that int.

    That should normally be wrapped in a macro, so you don't see the call or dereference.