Decode paths associated with file descriptors returned by syscalls

* defs.h (RVAL_FD): New macro.
(RVAL_MASK, RVAL_STR, RVAL_NONE): Update.
* desc.c (sys_dup, sys_delete_module): New functions.
(do_dup2, decode_open, sys_creat): Change return value to RVAL_FD.
* linux/dummy.h (sys_delete_module, sys_dup): Remove.
* linux/syscall.h (sys_delete_module, sys_dup): New prototypes.
* syscall.c (trace_syscall_exiting): Handle RVAL_FD.

Signed-off-by: Zubin Mithra <zubin.mithra@gmail.com>
diff --git a/syscall.c b/syscall.c
index c95eb6c..b0ad47e 100644
--- a/syscall.c
+++ b/syscall.c
@@ -2688,6 +2688,14 @@
 			case RVAL_DECIMAL:
 				tprintf("= %ld", tcp->u_rval);
 				break;
+			case RVAL_FD:
+				if (show_fd_path) {
+					tprints("= ");
+					printfd(tcp, tcp->u_rval);
+				}
+				else
+					tprintf("= %ld", tcp->u_rval);
+				break;
 #if defined(LINUX_MIPSN32) || defined(X32)
 			/*
 			case RVAL_LHEX: