Changes in uspace/lib/c/include/io/klog.h [b7fd2a0:8d2dd7f2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/io/klog.h
rb7fd2a0 r8d2dd7f2 44 44 #include <abi/log.h> 45 45 46 extern errno_t klog_write(log_level_t, const void *, size_t);47 extern errno_t klog_read(void *, size_t, size_t *);46 extern size_t klog_write(log_level_t, const void *, size_t); 47 extern int klog_read(void *, size_t); 48 48 49 49 #define KLOG_PRINTF(lvl, fmt, ...) ({ \ 50 char *_fmt = str_dup(fmt); \ 51 size_t _fmtsize = str_size(_fmt); \ 52 if (_fmtsize > 0 && _fmt[_fmtsize - 1] == '\n') \ 53 _fmt[_fmtsize - 1] = 0; \ 50 54 char *_s; \ 51 errno_t _rc = ENOMEM; \ 52 if (asprintf(&_s, fmt, ##__VA_ARGS__) >= 0) { \ 53 _rc = klog_write((lvl), _s, str_size(_s)); \ 55 int _c = asprintf(&_s, _fmt, ##__VA_ARGS__); \ 56 free(_fmt); \ 57 if (_c >= 0) { \ 58 _c = klog_write((lvl), _s, str_size(_s)); \ 54 59 free(_s); \ 55 60 }; \ 56 (_ rc != EOK); \61 (_c >= 0); \ 57 62 }) 58 63
Note:
See TracChangeset
for help on using the changeset viewer.