---
name: "gearman_client_create"
section: "3"
platform: "linux"
package: "gearmand"
version: "2.2.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gearman_client_create"
---

# gearman\_client\_create(3)

Gearmand Documentation, https://gearman.org/gearmand/

## NAME

gearman\_client\_create - Gearmand Documentation, https://gearman.org/gearmand/

## SYNOPSIS

\#include \<libgearman/gearman.h\>

- ***gearman\_client\_st* \*gearman\_client\_create(*gearman\_client\_st* \*client)**

  - ***gearman\_client\_st* \*gearman\_client\_clone(*gearman\_client\_st* \*client, const *gearman\_client\_st* \*from)**

  - **void gearman\_client\_free(*gearman\_client\_st* \*client)**

  Link with -lgearman

## DESCRIPTION

*gearman\_client\_create()* is used to create a c:type:*gearman\_client\_st*  structure that will then be used by other libgearman client functions to communicate with the server. You should either pass a statically declared *gearman\_client\_st*  to *gearman\_client\_create()* or a NULL. If a NULL passed in then a structure is allocated for you.

*gearman\_client\_clone()* is similar to *gearman\_client\_create()* but it copies the defaults and list of servers from the source *gearman\_client\_st* . If you pass a null as the argument for the source to clone, it is the same as a call to gearman\_client\_create. If the destination argument is NULL a *gearman\_client\_st*  will be allocated for you.

To clean up memory associated with a *gearman\_client\_st*  structure you should pass it to gearman\_client\_free when you are finished using it. *gearman\_client\_free()* is the only way to make sure all memory is deallocated when you finish using the structure.

**WARNING:**

You may wish to avoid using *gearman\_client\_create()* or *gearman\_client\_clone()* with a stack based allocation, ie the first parameter. The most common issues related to ABI safety involve stack allocated structures.

## RETURN VALUE

*gearman\_client\_create* returns a pointer to the gearman\_client\_st that was created (or initialized). On an allocation failure, it returns NULL.

*gearman\_client\_clone* returns a pointer to the gearman\_client\_st that was created (or initialized). On an allocation failure, it returns NULL.

## HOME

To find out more information please check: *https://gearman.org/gearmand/*

**SEE ALSO:**

**[gearmand(8)](/gearmand/8.md)** **[libgearman(3)](/libgearman/3.md)** **[gearman\_strerror(3)](/gearman_strerror/3.md)** **[gearman\_client\_st(3)](/gearman_client_st/3.md)**

## AUTHOR

Data Differential http://www.datadifferential.com/

## COPYRIGHT

2011-2014, Data Differential, http://www.datadifferential.com/
