This is going to be used to implement decoding of CLONE_PIDFD flag
of clone syscall.
* defs.h (printnum_fd): New prototype.
* util.c (printnum_fd): New function.
DECL_PRINTNUM_ADDR(int64);
# undef DECL_PRINTNUM_ADDR
+extern bool
+printnum_fd(struct tcb *, kernel_ulong_t addr);
+
# ifndef current_wordsize
extern bool
printnum_long_int(struct tcb *, kernel_ulong_t addr,
DEF_PRINTNUM_ADDR(int64, uint64_t)
DEF_PRINTPAIR(int64, uint64_t)
+bool
+printnum_fd(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ int fd;
+ if (umove_or_printaddr(tcp, addr, &fd))
+ return false;
+ tprints("[");
+ printfd(tcp, fd);
+ tprints("]");
+ return true;
+}
+
#ifndef current_wordsize
bool
printnum_long_int(struct tcb *const tcp, const kernel_ulong_t addr,