Browse Prior Art Database

Support For Application-defined Errno Values

IP.com Disclosure Number: IPCOM000030960D
Original Publication Date: 2004-Sep-02
Included in the Prior Art Database: 2004-Sep-02
Document File: 2 page(s) / 41K

Publishing Venue

IBM

Abstract

According to C language standards, the C language support for a given system must supply an errno variable and a predefined set of numeric errno values. This method describes a way for applications to dynamically add their own errno values and associated error strings.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 1 of 2

Support For Application-defined Errno Values

Disclosed is a method for supporting application-defined errno values. According to C language standards, the C language support for a given system must supply an errno variable and a predefined set of numeric errno values. These values are often associated with printable strings that describes the error, which are accessed through standard functions, most notably strerror() and perror().

     Most implementations of C language support define a relatively small set of errno values and associated strings. These errno values are typically set by standard C library functions and then queried by the callers to those standard functions. Because errno is a simple and standard way of reporting errors back to the caller of a function, using errno would be a convenient way for middleware and other applications to report back errors to their callers.

     However, there is no easy way for middleware or applications to statically or dynamically add new errno values and strings to an existing set of errno values and strings. In addition, using the limited set of predefined errno values is impractical because applications and middleware would lack the number and type of errno values to adequately describe the errors they may encounter. Also, the error strings may not adequately describe the error encountered for that particular application or middleware.

     As a result, most applications and middleware use their own methods for returning errors to the caller. There is no standard on how to return errors, and each application or middleware does it differently. In addition, most applications or middleware do not offer any functions to retrieve error strings for their errors, so there is usually no programmatic way to retrieve a text string describing the error.

     To facilitate the use of errno as a standard interface for returning errors, a method is required to allow applications and middleware to dynamically add errno values and their corresponding errno strings. By allowing applications and middleware to dynami...