30 lines
509 B
C
30 lines
509 B
C
#ifndef CGE_THREAD_CODEMAP_H
|
|
#define CGE_THREAD_CODEMAP_H
|
|
|
|
#include "Internal.h"
|
|
#include <errno.h>
|
|
|
|
static int errorToErrorCode(int value) {
|
|
switch (value) {
|
|
case 0:
|
|
return CGE_THREAD_EOK;
|
|
|
|
case ENOMEM:
|
|
return CGE_THREAD_EOOM;
|
|
|
|
case EINVAL:
|
|
return CGE_THREAD_EINVAL;
|
|
|
|
case ETIMEDOUT:
|
|
return CGE_THREAD_ETIMEDOUT;
|
|
|
|
case EBUSY:
|
|
return CGE_THREAD_EBUSY;
|
|
|
|
default:
|
|
return CGE_THREAD_EUNKNOWN;
|
|
}
|
|
}
|
|
|
|
#endif /* CGE_THREAD_CODEMAP_H */
|