I can't find much in the way of documentation for this.
Added to scalar, but no specific tests.
// unimpl ffclock_setestimate 242
// unimpl ffclock_getestimate 243
DECL_TEMPLATE(freebsd, sys_clock_nanosleep) // 244
-// unimpl clock_getcpuclockid2 247
+DECL_TEMPLATE(freebsd, sys_clock_getcpuclockid2) // 247
// unimpl ntp_gettime 248
DECL_TEMPLATE(freebsd, sys_minherit) // 250
DECL_TEMPLATE(freebsd, sys_rfork) // 251
}
#endif
+// SYS_clock_getcpuclockid2 247
+// no manpage for this, from syscalls.master
+// int clock_getcpuclockid2(id_t id, int which, _Out_ clockid_t *clock_id);
+PRE(sys_clock_getcpuclockid2)
+{
+ PRINT("sys_clock_getcpuclockid2( %" FMT_REGWORD "d, %" FMT_REGWORD "d, %#" FMT_REGWORD "x )",
+ SARG1,SARG2,ARG3);
+ PRE_REG_READ3(int, "clock_getcpuclockid2",
+ id_t, id, int, len, clockid_t *, clock_id);
+ PRE_MEM_WRITE("clock_getcpuclockid2(clock_id)", ARG3, sizeof(vki_clockid_t));
+}
+
// SYS_rfork 251
// pid_t rfork(int flags);
PRE(sys_rfork)
POST(sys_clock_nanosleep)
{
if (ARG2 != 0)
- PRE_MEM_WRITE( "clock_nanosleep(rmtp)", ARG2, sizeof(struct vki_timespec) );
+ POST_MEM_WRITE( ARG2, sizeof(struct vki_timespec) );
}
// SYS_clock_getcpuclockid2 247
-// no manpage for this
-// @todo
+// x86/amd64
+
+POST(sys_clock_getcpuclockid2)
+{
+ POST_MEM_WRITE(ARG3, sizeof(vki_clockid_t));
+}
+
// SYS_ntp_gettime 248
// int ntp_gettime(struct ntptimeval *);
// unimpl SYS_ffclock_getestimate 243
BSDXY(__NR_clock_nanosleep, sys_clock_nanosleep), // 244
- // unimpl SYS_clock_getcpuclockid2 247
+ BSDXY(__NR_clock_getcpuclockid2, sys_clock_getcpuclockid2), // 247
// unimpl SYS_ntp_gettime 248
BSDXY(__NR_minherit, sys_minherit), // 250
/*--------------------------------------------------------------------*/
-/*--- Platform-specific syscalls stuff. syswrap-x86-freebsd.c ---*/
+/*--- Platform-specific syscalls stuff. syswrap-x86-freebsd.c ---*/
/*--------------------------------------------------------------------*/
/*
}
#endif
+// SYS_clock_getcpuclockid2 247
+// no manpage for this, from syscalls.master
+// int clock_getcpuclockid2(id_t id, int which, _Out_ clockid_t *clock_id);
+PRE(sys_clock_getcpuclockid2)
+{
+ PRINT("sys_clock_getcpuclockid2( %lld, %" FMT_REGWORD "d, %#" FMT_REGWORD "x )",
+ MERGE64(ARG1,ARG2),SARG3,ARG4);
+ PRE_REG_READ4(int, "clock_getcpuclockid2",
+ vki_uint32_t, MERGE64_FIRST(offset),
+ vki_uint32_t, MERGE64_SECOND(offset),
+ int, len, clockid_t *, clock_id);
+ PRE_MEM_WRITE("clock_getcpuclockid2(clock_id)", ARG3, sizeof(vki_clockid_t));
+}
+
// SYS_rfork 251
// pid_t rfork(int flags);
PRE(sys_rfork)
SY(SYS_clock_nanosleep, x0+5000, x0+3000, x0, x0+1); SUCC;
#endif
- // unimpl SYS_clock_getcpuclockid2 247
+ // SYS_clock_getcpuclockid2 247
+ GO(SYS_clock_getcpuclockid2, "3s 1m");
+ SY(SYS_clock_getcpuclockid2, x0+1, x0+1, x0+1); FAIL;
// BSDXY(__NR_ntp_gettime, sys_ntp_gettime), // 248
...
Address 0x........ is not stack'd, malloc'd or (recently) free'd
+---------------------------------------------------------
+247:SYS_clock_getcpuclockid2 3s 1m
+---------------------------------------------------------
+Syscall param clock_getcpuclockid2(id) contains uninitialised byte(s)
+ ...
+
+Syscall param clock_getcpuclockid2(len) contains uninitialised byte(s)
+ ...
+
+Syscall param clock_getcpuclockid2(clock_id) contains uninitialised byte(s)
+ ...
+
+Syscall param clock_getcpuclockid2(clock_id) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
---------------------------------------------------------
250: SYS_minherit @todo
---------------------------------------------------------
...
Address 0x........ is not stack'd, malloc'd or (recently) free'd
+---------------------------------------------------------
+247:SYS_clock_getcpuclockid2 3s 1m
+---------------------------------------------------------
+Syscall param clock_getcpuclockid2(offset_low) contains uninitialised byte(s)
+ ...
+
+Syscall param clock_getcpuclockid2(offset_high) contains uninitialised byte(s)
+ ...
+
+Syscall param clock_getcpuclockid2(len) contains uninitialised byte(s)
+ ...
+
+Syscall param clock_getcpuclockid2(clock_id) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
---------------------------------------------------------
250: SYS_minherit @todo
---------------------------------------------------------