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