ping\_construct(3) liboping ping\_construct(3)

# [NAME](#NAME)

ping\_construct - Constructor for the liboping class

# [SYNOPSIS](#SYNOPSIS)

```
  #include <oping.h>
  pingobj_t *ping_construct (void);
  void       ping_destroy   (pingobj_t *obj);
```

# [DESCRIPTION](#DESCRIPTION)

The **ping\_construct** constructor allocates the memory necessary for a liboping object, initializes that memory and returns a pointer to it.

The **ping\_destroy** iterates over all hosts associated with the liboping object *obj*, closes the sockets, removes the hosts and frees *obj*'s memory.

# [RETURN VALUE](#RETURN_VALUE)

The **ping\_construct** constructor returns a pointer to the allocated memory or NULL if no memory could be allocated.

# [SEE ALSO](#SEE_ALSO)

[**ping\_setopt**(3)](/man/os/liboping/ping_setopt.3), [**ping\_send**(3)](/man/os/liboping/ping_send.3), [**ping\_host\_add**(3)](/man/os/liboping/ping_host_add.3), [**ping\_get\_error**(3)](/man/os/liboping/ping_get_error.3), [**ping\_iterator\_get**(3)](/man/os/liboping/ping_iterator_get.3), [**liboping**(3)](/man/os/liboping/liboping.3)

# [AUTHOR](#AUTHOR)

liboping is written by Florian "octo" Forster &lt;ff at octo.it&gt;. Its homepage can be found at &lt;http://noping.cc/&gt;.

Copyright (c) 2006-2017 by Florian "octo" Forster.

2026-10-10 1.10.0

---

Document: ping_construct(3) from liboping 1.10.0-r7 (Chainguard OS)
Source: https://github.com/octo/liboping.git
