Changeset 132ab5d1 in mainline for uspace/lib/c/include/io/klog.h
- Timestamp:
- 2018-01-30T03:20:45Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5a6cc679
- Parents:
- 8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
uspace/lib/c/include/io/klog.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/io/klog.h
r8bfb163 r132ab5d1 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 int klog_write(log_level_t, const void *, size_t); 47 extern int 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 int _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.
