Files
beaglefw/exceptions.hh
Matthias Blankertz 76cc09a168 - WIP: OMAP35x SD/MMC controller driver
- WIP: Pagecache
- Added sleep() and usleep() functions
2013-07-19 19:51:40 +02:00

37 lines
563 B
C++

#ifndef _EXCEPTIONS_HH_
#define _EXCEPTIONS_HH_
#include <errno.h>
namespace ex {
// An unexcpected fatal error occured
class error {
public:
error(int eno = 0) : eno_(eno) {
}
int getErrno() const {
return eno_;
}
private:
int eno_;
};
// A memory allocation, or virtual address space allocation, failed
class bad_alloc : public error {
public:
bad_alloc() : error(ENOMEM) {
}
};
// An operation timed out
class timeout : public error {
public:
timeout() : error(EAGAIN) {
}
};
}
#endif