---
name: "getdns_context_set_context_update_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_context_set_context_update_callback"
---

# getdns\_context\_set\_context\_update\_callback(3)

## NAME

**getdns\_context\_set\_context\_update\_callback** -- get informed on getdns context updates

## LIBRARY

DNS Resolver library (libgetdns, -lgetdns)

## SYNOPSIS

\#include \<getdns.h\>

getdns\_return\_t\
 **getdns\_context\_set\_context\_update\_callback** (getdns\_context \*\* context,

void (\*cbfun)(getdns\_context \*context, getdns\_context\_code\_t changed\_item)

## DESCRIPTION

Changes to the context such as in response to system files that affect the contet (/etc/resolv.conf etc.) trigger a call to the callback function specified as **cbfun**

*context* a previously initialized context

*cbfun* callback function to invoked when the specified context changes.  If this  argument is NULL then updates to the context will not invoke a callback.

## RETURN VALUES

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

**GETDNS\_RETURN\_GENERIC\_ERROR** memory allocation failed or some other untoward thing happened

**GETDNS\_RETURN\_BAD\_CONTEXT** if the context pointer is invalid

## EXAMPLES

TBD

## SEE ALSO

[**libgetdns**(3)](/libgetdns/3.md), [**getdns\_context\_create**(3)](/getdns_context_create/3.md), [**getdns\_context\_set**(3)](/getdns_context_set/3.md), [**getdns\_context\_set\_context\_update\_callback**(3)](/getdns_context_set_context_update_callback/3.md),
