---
name: "getdns_cancel_callback"
section: "3"
platform: "linux"
package: "getdns"
version: "1.7.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/getdns_cancel_callback"
---

# getdns\_cancel\_callback(3)

## NAME

**getdns\_cancel\_callback** -- cancel an outstanding asyn getdns request

## LIBRARY

DNS Resolver library (libgetdns, -lgetdns)

## SYNOPSIS

\#include \<getdns.h\>

getdns\_return\_t \
 **getdns\_cancel\_callback** (getdns\_context\_t context,

getdns\_transaction\_t \*transaction\_id)

## DESCRIPTION

To cancel an outstanding callback, use getdns\_cancel\_callback. This causes the API to call the callback with a callback\_type of GETDNS\_CALLBACK\_CANCEL if the callback for this transaction\_id has not already been called. The callback code for cancellation should clean up any memory related to the identified call, such as to deallocate the memory for the userarg. getdns\_cancel\_callback() may return immediately, even before the callback finishes its work and returns.

*context* see getdns\_context (3)

*transaction\_id* populated by the API and used to identify the callback (for example to getdns\_cancel\_callback), can be NULL, set to 0 if the function fails

## RETURN VALUES

Upon successful completion the functions return **GETDNS\_RETURN\_GOOD** , otherwise the following error values are returned:

**GETDNS\_RETURN\_INVALID\_PARAMETER** if context == NULL

**GETDNS\_RETURN\_UNKNOWN\_TRANSACTION** if the transaction\_id that is unknown or belongs to a callback that has already been called

## EXAMPLES

TBD

## FILES

/etc/hosts\
 /etc/resolv.conf

## SEE ALSO

[**libgetdns**(3)](/libgetdns/3.md), [**getdns\_context**(3)](/getdns_context/3.md), [**getdns\_general**(3)](/getdns_general/3.md), [**getdns\_hostname**(3)](/getdns_hostname/3.md), [**getdns\_service**(3)](/getdns_service/3.md),
