---
name: "ares_queue"
section: "3"
platform: "linux"
package: "c-ares"
version: "1.34.9-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ares_queue"
---

# ares\_queue(3)

Functions for checking the c-ares queue status

## NAME

ares\_queue\_wait\_empty, ares\_queue\_active\_queries - Functions for checking the c-ares queue status

## SYNOPSIS

```
#include <ares.h>
size_t ares_queue_active_queries(const ares_channel_t *channel);
ares_status_t ares_queue_wait_empty(ares_channel_t *channel,
                                    int timeout_ms);
```

## DESCRIPTION

The **[ares\_queue\_active\_queries(3)](/ares_queue_active_queries/3.md)** function retrieves the total number of active queries pending answers from servers. Some c-ares requests may spawn multiple queries, such as *[ares\_getaddrinfo(3)](/ares_getaddrinfo/3.md)* when using *AF\_UNSPEC*, which will be reflected in this number. The **channel** parameter must be set to an initialized channel.

The **[ares\_queue\_wait\_empty(3)](/ares_queue_wait_empty/3.md)** function blocks until notified that there are no longer any queries in queue, or the specified timeout has expired. The **channel** parameter must be set to an initialized channel. The **timeout\_ms** parameter is the number of milliseconds to wait for the queue to be empty or -1 for Infinite.

## RETURN VALUES

*[ares\_queue\_active\_queries(3)](/ares_queue_active_queries/3.md)* returns the active query count.

*[ares\_queue\_wait\_empty(3)](/ares_queue_wait_empty/3.md)* can return any of the following values:

- **ARES\_ENOTIMP**

  if not built with threading support

- **ARES\_ETIMEOUT**

  if requested timeout expired

- **ARES\_SUCCESS**

  when queue is empty.

- This function was first introduced in c-ares version 1.27.0, and requires the

  ## AVAILABILITY

c-ares library to be built with threading support.

## SEE ALSO

[**ares\_init\_options**(3)](/ares_init_options/3.md), [**ares\_threadsafety**(3)](/ares_threadsafety/3.md)
