Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

strmod::unievent::UNIXError Class Reference

Holds a UNIX errno value. More...

#include <UniEvent/UNIXError.h>

Inheritance diagram for strmod::unievent::UNIXError:

Inheritance graph
[legend]
List of all members.

Public Methods

 UNIXError (const char *syscallname, const lcore::LCoreError &lcerr) throw ()
 UNIXError (const char *syscallname, int errnum, const lcore::LCoreError &lcerr) throw ()
const char * getSyscallName () const throw ()
 Return name of system call that caused error.

int getErrorNum () const throw ()
 The numeric value of the error, which corresponds to values from errno.h.

void getErrorString (char *buf, size_t buflen) const throw ()
 The result of doing strerror_r(getErrorNum(), buf, buflen).

bool isEOF () const throw ()
 Is this an End-Of-File error?


Static Public Methods

int getErrno ()

Static Public Attributes

const UNIXError S_noerror
 A value for no error at all.


Detailed Description

Holds a UNIX errno value.

There are no member functions to modify its value, so this is essentially a const value. This makes the class multithread safe.

There is a special kind of error called an EOF error. An EOF error signals that an EOF condition exists on the file descriptor in questoin. The 'errno' value is ESUCCESS (0) in this case.

Definition at line 47 of file UNIXError.h.


Constructor & Destructor Documentation

strmod::unievent::UNIXError::UNIXError const char *    syscallname,
const lcore::LCoreError   lcerr
throw () [inline]
 

Parameters:
syscallname Name of system call that generated the error.
lcerr An LCoreError, it's values will be copied into the UNIXError. The actual Unix error number is grabbed from the global 'errno' value.

Definition at line 104 of file UNIXError.h.

strmod::unievent::UNIXError::UNIXError const char *    syscallname,
int    errnum,
const lcore::LCoreError   lcerr
throw () [inline]
 

Parameters:
syscallname Name of system call that generated the error.
errnum The Unix 'errno' value for this error.
lcerr An LCoreError, it's values will be copied into the UNIXError.

Definition at line 117 of file UNIXError.h.


Member Function Documentation

void strmod::unievent::UNIXError::getErrorString char *    buf,
size_t    buflen
const throw ()
 

The result of doing strerror_r(getErrorNum(), buf, buflen).

Parameters:
buf A buffer to stuff the string into.
buflen The maximum number of bytes the buffer can hold.
buf[buflen - 1] will always be set to '\0'.

One some platforms (like Linux), strerror is not thread safe, and a different function, strerror_r is called. strerror_r requires you to supply a buffer. The sterror_r interface is supported since the strerror_r interface can be implemented in terms of the strerror interface, but not the other way around.

Definition at line 37 of file UNIXError.cxx.


The documentation for this class was generated from the following files:
Generated on Wed Jan 29 00:32:57 2003 for libNet by doxygen1.3-rc1