ARES\_TIMEOUT(3) Library Functions Manual ARES\_TIMEOUT(3)

# [NAME](#NAME)

ares\_timeout - return maximum time to wait

# [SYNOPSIS](#SYNOPSIS)

```
#include <ares.h>
struct timeval *ares_timeout(const ares_channel_t *channel,


                             struct timeval *maxtv,


                             struct timeval *tv)
```

# [DESCRIPTION](#DESCRIPTION)

The [**ares\_timeout(3)**](/man/os/c-ares/ares_timeout.3) function determines the maximum time for which the caller should wait before invoking [*ares\_process(3)*](/man/os/c-ares/ares_process.3) to process timeouts. The parameter *maxtv* specifies a existing maximum timeout, or **NULL** if the caller does not wish to apply a maximum timeout. The parameter *tv* must point to a writable buffer of type **struct timeval** It is valid for *maxtv* and *tv* to have the same value.

If no queries have timeouts pending sooner than the given maximum timeout, [**ares\_timeout(3)**](/man/os/c-ares/ares_timeout.3) returns the value of *maxtv*; otherwise [**ares\_timeout(3)**](/man/os/c-ares/ares_timeout.3) stores the appropriate timeout value into the buffer pointed to by *tv* and returns the value of *tv*.

# [SEE ALSO](#SEE_ALSO)

[**ares\_fds**(3)](/man/os/c-ares/ares_fds.3), [**ares\_process**(3)](/man/os/c-ares/ares_process.3), [**ares\_process\_fd**(3)](/man/os/c-ares/ares_process_fd.3)

25 July 1998

---

Document: ares_timeout(3) from c-ares 1.34.8-r2 (Chainguard OS)
Source: https://github.com/c-ares/c-ares
