diff options
author | Mattias Andrée <maandree@kth.se> | 2020-05-30 17:34:29 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2020-05-30 17:34:29 +0200 |
commit | 712f56fe3369c59d32b9000830b4ed7b25ed24b5 (patch) | |
tree | 27ddf931fd2d980d0c4dcdfb025f26f5380fb5d6 /consts.c | |
parent | Print errno names and strings (diff) | |
download | sctrace-712f56fe3369c59d32b9000830b4ed7b25ed24b5.tar.gz sctrace-712f56fe3369c59d32b9000830b4ed7b25ed24b5.tar.bz2 sctrace-712f56fe3369c59d32b9000830b4ed7b25ed24b5.tar.xz |
Add support for tracing fork children
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | consts.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/consts.c b/consts.c new file mode 100644 index 0000000..9a7e3fb --- /dev/null +++ b/consts.c @@ -0,0 +1,16 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + + +const char * +get_errno_name(int err) +{ + static char buf[3 * sizeof(err) + 2]; + +#define X(N) if (err == N) return #N; + LIST_ERRNOS(X) +#undef X + + sprintf(buf, "%i", err); + return buf; +} |