---
name: "globus_errno_error_utility"
section: "3"
platform: "linux"
package: "libglobus-common-doc"
version: "18.14-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_errno_error_utility"
---

# globus\_errno\_error\_utility(3)

Error Handling Helpers - Error Handling Helpers.

## NAME

globus\_errno\_error\_utility - Error Handling Helpers

 \- Error Handling Helpers.

## SYNOPSIS

### Error Match

**globus\_bool\_t** **globus\_error\_errno\_match** (globus\_object\_t \*error, **globus\_module\_descriptor\_t** \*module, int system\_errno)\
 int **globus\_error\_errno\_search** (globus\_object\_t \*error)\
 Search for an errno value in an error chain \<\>

### Wrap Errno Error

globus\_object\_t \* **globus\_error\_wrap\_errno\_error** (**globus\_module\_descriptor\_t** \*base\_source, int system\_errno, int type, const char \*source\_file, const char \*source\_func, int source\_line, const char \*short\_desc\_format,...)\

## Detailed Description

Error Handling Helpers.

Helper functions for dealing with Globus Errno Error objects.

This section defines utility functions for dealing with Globus Errno Error objects.

## Function Documentation

### globus\_bool\_t globus\_error\_errno\_match (globus\_object\_t \* error, globus\_module\_descriptor\_t \* module, int system\_errno)

Check whether the error originated from a specific module and matches a specific errno. \<\>

This function checks whether the error or any of it's causative errors originated from a specific module and contains a specific errno. If the module descriptor is left unspecified this function will check for any error of the specified errno and vice versa.

**Parameters**

*error* The error object for which to perform the check \
 *module* The module descriptor to check for \
 *system\_errno* The errno to check for

**Returns**

GLOBUS\_TRUE - the error matched the module and errno GLOBUS\_FALSE - the error failed to match the module and errno

### int globus\_error\_errno\_search (globus\_object\_t \* error)

Search for an errno value in an error chain \<\> This function searches the error object and its causal errors for an error of type GLOBUS\_ERROR\_TYPE\_ERRNO and returns the errno of that error. If the error and none of its causes are derived from that type, it returns 0.

**Parameters**

*error* The error object for which to perform the check

**Returns**

This function returns 0 if no errorno is found, otherwise the error.

### globus\_object\_t \* globus\_error\_wrap\_errno\_error (globus\_module\_descriptor\_t \* base\_source, int system\_errno, int type, const char \* source\_file, const char \* source\_func, int source\_line, const char \* short\_desc\_format, ...)

Allocate and initialize an error of type GLOBUS\_ERROR\_TYPE\_GLOBUS which contains a causal error of type GLOBUS\_ERROR\_TYPE\_ERRNO. \<\>

**Parameters**

*base\_source* Pointer to the originating module. \
 *system\_errno* The errno to use when generating the causal error. \
 *type* The error type. We may reserve part of this namespace for common errors. Errors not in this space are assumed to be local to the originating module. \
 *source\_file* Name of file. Use **FILE** \
 *source\_func* Name of function. Use \_globus\_func\_name and declare your func with GlobusFuncName(\<name\>) \
 *source\_line* Line number. Use **LINE** \
 *short\_desc\_format* Short format string giving a succinct description of the error. To be passed on to the user. \
 *...* Arguments for the format string.

**Returns**

The resulting error object. It is the user's responsibility to eventually free this object using globus\_object\_free(). A globus\_result\_t may be obtained by calling globus\_error\_put() on this object. \

## Author

Generated automatically by Doxygen for globus\_common from the source code.
