---
name: "gearman_strerror"
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_strerror"
---

# gearman\_strerror(3)

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

## NAME

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

## SYNOPSIS

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

- **type gearman\_return\_t**

  - **const char \*gearman\_strerror(*gearman\_return\_t* rc)**

  - ***bool* gearman\_success(*gearman\_return\_t* rc)**

  - ***bool* gearman\_failed(*gearman\_return\_t* rc)**

  - ***bool* gearman\_continue(*gearman\_return\_t* rc)**

  Compile and link with -lgearman

## DESCRIPTION

*gearman\_return\_t* is used as a return/error type for all calls using *gearman\_client\_st* and *gearman\_worker\_st*. **GEARMAN\_SUCCESS** is returned upon success, otherwise an error is returned. *gearman\_failed()* can be used to see if the return value is a failing value. You can print a text version of the error message with *gearman\_strerror()*.

*gearman\_success()* return true if **GEARMAN\_SUCCESS** or if *GEARMAN\_NO\_PENDING\_TASKS* tests true.

*gearman\_failed()* return true if any value other then **GEARMAN\_SUCCESS** was provided.

*gearman\_continue()* returns true if any error related to non-blocking IO occurred. This should be used for testing loops.

### Possible values of *gearman\_return\_t*:

- **type GEARMAN\_NO\_PENDING\_TASKS**

  *gearman\_client\_run\_tasks()* was called and it has completed all tasks assigned to the client.

- **type GEARMAN\_IO\_WAIT**

  Blocking IO was found. gearman\_continue() can be used to test for this.

- **type GEARMAN\_ERRNO**

  System error occurred. Use either *gearman\_client\_errno()* or *gearman\_worker\_errno()*

- **type GEARMAN\_NO\_ACTIVE\_FDS**

  No active connections were available.  gearman\_continue() can be used to test for this.

- **type GEARMAN\_GETADDRINFO**

  Name resolution failed for a host.

- **type GEARMAN\_NO\_SERVERS**

  No servers have been provided for the client/worker.

- **type GEARMAN\_LOST\_CONNECTION**

  Connection was lost to the given server.

- **type GEARMAN\_MEMORY\_ALLOCATION\_FAILURE**

  Memory allocation failed.

- **type GEARMAN\_SERVER\_ERROR**

  An error occurred on the server.

- **type GEARMAN\_NOT\_CONNECTED**

  Client/Worker is not currently connected to the server.

- **type GEARMAN\_COULD\_NOT\_CONNECT**

  Server name was valid, but a connection could not be made.

- **type GEARMAN\_ECHO\_DATA\_CORRUPTION**

  Either *gearman\_client\_echo()* or *gearman\_worker\_echo()* echo was unsuccessful because the data was returned from **gearmand** corrupted.

- **type GEARMAN\_UNKNOWN\_STATE**

  The gearman\_return\_t was never set.

- **type GEARMAN\_FLUSH\_DATA**

  Internal state, should never be seen by either client or worker.

- **type GEARMAN\_SEND\_BUFFER\_TOO\_SMALL**

  Send buffer was too small.

- **type GEARMAN\_TIMEOUT**

  A timeout occurred when making a request to the server.

- **type GEARMAN\_ARGUMENT\_TOO\_LARGE**

  Argument was too large for the current buffer.

- **type GEARMAN\_INVALID\_ARGUMENT**

  One of the arguments to the given API call was invalid. EINVAL will be set if *gearman\_client\_error()* or *gearman\_worker\_error()* were not settable. This can also be returned if *GEARMAN\_CLIENT\_UNBUFFERED\_RESULT* was set, but the client is not handling the data correctly.

### CLIENT ONLY

- **type GEARMAN\_NEED\_WORKLOAD\_FN**

  A client was asked for work, but no *gearman\_workload\_fn* callback was specified. See *gearman\_client\_set\_workload\_fn()*

- **type GEARMAN\_WORK\_FAIL**

  A task has failed, and the worker has exited with an error or it called *gearman\_job\_send\_fail()*

- **type GEARMAN\_IN\_PROGRESS**

  *gearman\_client\_job\_status()* has been called for a *gearman\_job\_handle\_t* and the Job is currently being run by a worker.

- **type GEARMAN\_JOB\_EXISTS**

  *gearman\_client\_job\_status()* has been called for a *gearman\_job\_handle\_t* and the Job is currently known by a server, but is not being run by a worker.

### WORKER ONLY

- **type GEARMAN\_INVALID\_FUNCTION\_NAME**

  A worker was sent a request for a job that it did not have a valid function for.

- **type GEARMAN\_INVALID\_WORKER\_FUNCTION**

  No callback was provided by the worker for a given function.

- **type GEARMAN\_NO\_REGISTERED\_FUNCTION**

  A request for removing a given function from a worker was invalid since that function did not exist.

- **type GEARMAN\_NO\_REGISTERED\_FUNCTIONS**

  The worker has not registered any functions.

- **type GEARMAN\_NO\_JOBS**

  No jobs were found for the worker. This error code is only returned if the worker has just made a request for jobs.

### WORKER TO CLIENT

Client which have registed a custom *gearman\_actions\_t* may use these value as return values to the calling client.

- **type GEARMAN\_WORK\_DATA**

  Worker has sent a chunked piece of data to the client via *gearman\_job\_send\_data()*

- **type GEARMAN\_WORK\_WARNING**

  Worker has issued a warning to the client via *gearman\_job\_send\_warning()*

- **type GEARMAN\_WORK\_STATUS**

  Status has been updated by the worker via *gearman\_job\_send\_status()*

- **type GEARMAN\_WORK\_EXCEPTION**

  Worker has sent an exception the client via *gearman\_job\_send\_exception()*

- **type GEARMAN\_WORK\_ERROR**

  A task has had an error and will be retried.

- **type GEARMAN\_PAUSE**

  Used only in custom application for client return based on *GEARMAN\_WORK\_DATA*, *GEARMAN\_WORK\_WARNING*, *GEARMAN\_WORK\_EXCEPTION*, *GEARMAN\_WORK\_FAIL*, or *GEARMAN\_WORK\_STATUS*. *gearman\_continue()* can be used to check for this value.

### WORKER TO CLIENT

Any function defined by *gearman\_worker\_define\_function()* may, and can only, return the following *gearman\_return\_t* values.

- **type GEARMAN\_FATAL**

  - **type GEARMAN\_FAIL**

  The function failed to complete the job. *GEARMAN\_FATAL* is the deprecated name for *GEARMAN\_FAIL*

- **type GEARMAN\_ERROR**

  A task has had an error and will be retried.

- **type GEARMAN\_SHUTDOWN**

  *GEARMAN\_SHUTDOWN* is a special case. If it is returned the client will be sent **GEARMAN\_SUCCESS**, but *gearman\_worker\_work()* will exit with *GEARMAN\_SHUTDOWN*.

### TASK ONLY

- **type GEARMAN\_NOT\_FLUSHING**

  *gearman\_task\_send\_workload()* failed, it was not in the correct state.

- **type GEARMAN\_DATA\_TOO\_LARGE**

  *gearman\_task\_send\_workload()* failed, the data was too large to be sent.

- **type GEARMAN\_UNKNOWN\_OPTION**

  Default state of task return value.

### PROTOCOL

If any of these errors occurred the connection will be dropped/reset.

- **type GEARMAN\_INVALID\_MAGIC**

  - **type GEARMAN\_INVALID\_COMMAND**

  - **type GEARMAN\_INVALID\_PACKET**

  - **type GEARMAN\_UNEXPECTED\_PACKET**

  - **type GEARMAN\_TOO\_MANY\_ARGS**

  ### DEPRECATED

- **type GEARMAN\_IGNORE\_PACKET**

  - **type GEARMAN\_MAX\_RETURN**

  ## SEE ALSO

**[gearmand(8)](/gearmand/8.md)** **[libgearman(3)](/libgearman/3.md)** **gearman\_client\_error()** or **gearman\_worker\_error()**

## AUTHOR

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

## COPYRIGHT

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