This commit is contained in:
29
posix/Codemap.h
Normal file
29
posix/Codemap.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#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 */
|
||||
Reference in New Issue
Block a user