NN_ERRNO(3compat)

πŸ“¦ version 1.11, in alpine 3.24

✨ NAME ✨

nn_errno β€” return most recent error (compatible API). πŸ’… This one lives in the NNG Reference Manual as nn_errno(3compat), and she is literally the legacy-compatible bestie for checking what just went wrong. Periodt.

🫢 SYNOPSIS 🫢

#include <nanomsg/nn.h>

int nn_errno(void);

πŸ’– DESCRIPTION πŸ’–

Okay so nn_errno() returns the error number corresponding to the most recent failed operation by the calling thread. That’s the whole plot, and it ate. ✨

Note: this function is provided for API compatibility with legacy libnanomsg. Consider using the relevant modern API instead. No cap, the modern API is giving main character energy here. πŸ‘‘
Important: the error numbers returned from this function may include errors caused by system functions, which overlap the usual errno variable, and this function simply returns the value of errno. However, the values returned may include numeric values that are not defined by the system, but are unique to libnanomsg, such as EFSM. So yeah β€” sometimes it’s system errno, sometimes it’s libnanomsg exclusive lore. πŸ’€

This library implements the following error numbers, in addition to any others that might be set for errno by the underlying system:

πŸŽ€ RETURN VALUES πŸŽ€

This function returns the value of errno. If no operation has failed, then this will be zero. Periodt. 🫢

🌈 ERRORS 🌈

  • EINTR β€” Operation interrupted.
  • ENOMEM β€” Insufficient memory.
  • EINVAL β€” Invalid argument.
  • EBUSY β€” Resource is busy.
  • ETIMEDOUT β€” Operation timed out.
  • ECONNREFUSED β€” Connection refused by peer.
  • EBADF β€” Invalid or closed socket.
  • EAGAIN β€” Operation would block.
  • ENOTSUP β€” Protocol or option not supported.
  • EADDRINUSE β€” Requested address is already in use.
  • EFSM β€” Protocol state incorrect.
  • EPROTO β€” Protocol error.
  • EHOSTUNREACH β€” Remote peer is unreachable.
  • EADDRNOTAVAIL β€” Requested address is not available.
  • EACCES β€” Permission denied.
  • EMSGSIZE β€” Message is too large.
  • ECONNABORTED β€” Connection attempt aborted.
  • ECONNRESET β€” Connection reset by peer.
  • EEXIST β€” Resource already exists.
  • EMFILE β€” Too many open files.
  • ENOSPC β€” Insufficient persistent storage.

πŸ‘‘ SEE ALSO πŸ‘‘


mwah πŸ’‹ β€” source/version: NNG Reference Manual; date: 2026-01-13; manual name: NN_ERRNO(3compat). That’s the page, bestie β€” go forth and check your errno. πŸ¦‹πŸ’–

πŸ“¦ where this page comes from