sdm: Use Sys wrapper for dup() call

Add function pointer for dup() in Sys wrapper and call it instead of
calling system calls.

Change-Id: Ia18edfd84ac1b64cc32f01a868ee9d71406a427b
diff --git a/sdm/libs/utils/sys.cpp b/sdm/libs/utils/sys.cpp
index 03310ff..ff66fcf 100644
--- a/sdm/libs/utils/sys.cpp
+++ b/sdm/libs/utils/sys.cpp
@@ -53,6 +53,7 @@
 Sys::fclose Sys::fclose_ = ::fclose;
 Sys::getline Sys::getline_ = ::getline;
 Sys::pthread_cancel Sys::pthread_cancel_ = PthreadCancel;
+Sys::dup Sys::dup_ = ::dup;
 
 #else
 
@@ -66,6 +67,7 @@
 extern FILE* virtual_fopen(const char *fname, const char *mode);
 extern int virtual_fclose(FILE* fileptr);
 extern ssize_t virtual_getline(char **lineptr, size_t *linelen, FILE *stream);
+extern int virtual_dup(int fd);
 
 Sys::ioctl Sys::ioctl_ = virtual_ioctl;
 Sys::open Sys::open_ = virtual_open;
@@ -77,6 +79,7 @@
 Sys::fclose Sys::fclose_ = virtual_fclose;
 Sys::getline Sys::getline_ = virtual_getline;
 Sys::pthread_cancel Sys::pthread_cancel_ = ::pthread_cancel;
+Sys::dup Sys::dup_ = virtual_dup;
 
 #endif  // SDM_VIRTUAL_DRIVER