]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Handle the sethostname system call. BZ#311922.
authorTom Hughes <tom@compton.nu>
Wed, 17 Jul 2013 12:43:30 +0000 (12:43 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 17 Jul 2013 12:43:30 +0000 (12:43 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13458

coregrind/m_syswrap/priv_syswrap-generic.h
coregrind/m_syswrap/syswrap-amd64-linux.c
coregrind/m_syswrap/syswrap-generic.c
coregrind/m_syswrap/syswrap-x86-linux.c

index 5dc72edd458b81ede81c3e90d0d1f174947adca6..0aa02611e2accf69b8eab26f2c84dcd60b170c9d 100644 (file)
@@ -149,6 +149,7 @@ DECL_TEMPLATE(generic, sys_chown);
 DECL_TEMPLATE(generic, sys_setuid);
 DECL_TEMPLATE(generic, sys_gettimeofday);
 DECL_TEMPLATE(generic, sys_madvise);
+DECL_TEMPLATE(generic, sys_sethostname);
 
 // These ones aren't POSIX, but are in some standard and look reasonably
 // generic,  and are the same for all architectures under Linux.
index 82e67bdf454cefa08ee3f915d149edd8733de351..13451135c9a6aabd4e6c95a6c5c5c524815c0976 100644 (file)
@@ -912,7 +912,7 @@ static SyscallTableEntry syscall_table[] = {
    //   (__NR_swapoff,           sys_swapoff),        // 168 
    //   (__NR_reboot,            sys_reboot),         // 169 
 
-   //   (__NR_sethostname,       sys_sethostname),    // 170 
+   GENX_(__NR_sethostname,       sys_sethostname),    // 170 
    //   (__NR_setdomainname,     sys_setdomainname),  // 171 
    GENX_(__NR_iopl,              sys_iopl),           // 172 
    LINX_(__NR_ioperm,            sys_ioperm),         // 173 
index b85fd9ca21d639976a534a7b3812c716d01a2835..cd19efbcfa1fa1667509a01a31c1d53e8ff232d2 100644 (file)
@@ -4230,6 +4230,13 @@ POST(sys_sigaltstack)
       POST_MEM_WRITE( ARG2, sizeof(vki_stack_t));
 }
 
+PRE(sys_sethostname)
+{
+   PRINT("sys_sethostname ( %#lx, %ld )", ARG1,ARG2);
+   PRE_REG_READ2(long, "sethostname", char *, name, int, len);
+   PRE_MEM_READ( "sethostname(name)", ARG1, ARG2 );
+}
+
 #undef PRE
 #undef POST
 
index ed60a151debcc3721176d96c3b7ef3c293ecc51e..3f0eae490581d26727f8bda2483c41cc5024eb76 100644 (file)
@@ -1501,7 +1501,7 @@ static SyscallTableEntry syscall_table[] = {
    LINX_(__NR_setregid,          sys_setregid16),     // 71
    PLAX_(__NR_sigsuspend,        sys_sigsuspend),     // 72
    LINXY(__NR_sigpending,        sys_sigpending),     // 73
-//zz    //   (__NR_sethostname,       sys_sethostname),    // 74 */*
+   GENX_(__NR_sethostname,       sys_sethostname),    // 74
 //zz 
    GENX_(__NR_setrlimit,         sys_setrlimit),      // 75
    GENXY(__NR_getrlimit,         sys_old_getrlimit),  // 76