]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Patch from Robert O'Callahan:
authorNicholas Nethercote <njn@valgrind.org>
Sun, 12 Oct 2008 19:53:28 +0000 (19:53 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 12 Oct 2008 19:53:28 +0000 (19:53 +0000)
  create and expose 'dup2'

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8667

coregrind/m_libcfile.c
include/pub_tool_libcfile.h

index 16d1d634d3ba0868f008228f1db8d361479e4885..1236d7eb5c30b4e933bae5c3f0e9e4ce16dfc7ff 100644 (file)
@@ -260,6 +260,11 @@ SysRes VG_(dup) ( Int oldfd )
    return VG_(do_syscall1)(__NR_dup, oldfd);
 }
 
+SysRes VG_(dup2) ( Int oldfd, Int newfd )
+{
+   return VG_(do_syscall2)(__NR_dup2, oldfd, newfd);
+}
+
 /* Returns -1 on error. */
 Int VG_(fcntl) ( Int fd, Int cmd, Int arg )
 {
index 81710d4d94da03733c13d64a91dd56e7f04aeda9..5c5930195a2374322b42690956d7b0db2327d888 100644 (file)
@@ -73,6 +73,7 @@ extern OffT   VG_(lseek)  ( Int fd, OffT offset, Int whence );
 extern SysRes VG_(stat)   ( Char* file_name, struct vg_stat* buf );
 extern Int    VG_(fstat)  ( Int   fd,        struct vg_stat* buf );
 extern SysRes VG_(dup)    ( Int oldfd );
+extern SysRes VG_(dup2)   ( Int oldfd, Int newfd );
 extern Int    VG_(rename) ( Char* old_name, Char* new_name );
 extern Int    VG_(unlink) ( Char* file_name );