ZMQ\_STRERROR(3) 0MQ Manual ZMQ\_STRERROR(3)

# [NAME](#NAME)

zmq\_strerror - get 0MQ error message string

# [SYNOPSIS](#SYNOPSIS)

**const char \*zmq\_strerror (int errnum);**

# [DESCRIPTION](#DESCRIPTION)

The *zmq\_strerror()* function shall return a pointer to an error message string corresponding to the error number specified by the *errnum* argument. As 0MQ defines additional error numbers over and above those defined by the operating system, applications should use *zmq\_strerror()* in preference to the standard *strerror()* function.

# [RETURN VALUE](#RETURN_VALUE)

The *zmq\_strerror()* function shall return a pointer to an error message string.

# [ERRORS](#ERRORS)

No errors are defined.

# [EXAMPLE](#EXAMPLE)

**Displaying an error message when a 0MQ context cannot be initialised**.

```
void *ctx = zmq_init (1, 1, 0);
if (!ctx) {


    printf ("Error occurred during zmq_init(): %s\n", zmq_strerror (errno));


    abort ();
}
```

# [SEE ALSO](#SEE_ALSO)

[**zmq**(7)](/man/os/zeromq/zmq.7)

# [AUTHORS](#AUTHORS)

This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at **http://www.zeromq.org/docs:contributing**.

10/26/2026 0MQ 4.3.5

---

Document: zmq_strerror(3) from zeromq 4.3.5-r15 (Chainguard OS)
Source: https://github.com/zeromq/libzmq
