Changes in uspace/lib/posix/source/internal/common.h [0d0b319:23c8acd9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/source/internal/common.h
r0d0b319 r23c8acd9 50 50 } while (0) 51 51 52 /* Checks if the value is a failing error code. 53 * If so, writes the error code to errno and returns true. 54 */ 55 static inline bool failed(int rc) { 56 if (rc != EOK) { 57 errno = rc; 58 return true; 59 } 60 return false; 61 } 52 /* Convert negative errno to positive errno */ 53 #define negerrno(func, ...) ({ \ 54 int rc = func(__VA_ARGS__); \ 55 if (rc < 0) { \ 56 errno = -errno; \ 57 } \ 58 rc; \ 59 }) 60 61 /* Convert error code to positive errno and -1 return value */ 62 #define rcerrno(func, ...) ({ \ 63 int rc = func(__VA_ARGS__); \ 64 if (rc < 0) \ 65 errno = -rc; \ 66 rc; \ 67 }) 62 68 63 69 extern aoff64_t posix_pos[MAX_OPEN_FILES];
Note:
See TracChangeset
for help on using the changeset viewer.