mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Format struct itimerspec
PiperOrigin-RevId: 212874745 Change-Id: I0c3e8e6a9e8976631cee03bf0b8891b336ddb8c8
This commit is contained in:
@@ -240,8 +240,8 @@ var linuxAMD64 = SyscallMap{
|
||||
220: makeSyscallInfo("semtimedop", Hex, Hex, Hex, Hex),
|
||||
221: makeSyscallInfo("fadvise64", Hex, Hex, Hex, Hex),
|
||||
222: makeSyscallInfo("timer_create", Hex, Hex, Hex),
|
||||
223: makeSyscallInfo("timer_settime", Hex, Hex, Hex, Hex),
|
||||
224: makeSyscallInfo("timer_gettime", Hex, Hex),
|
||||
223: makeSyscallInfo("timer_settime", Hex, Hex, ItimerSpec, PostItimerSpec),
|
||||
224: makeSyscallInfo("timer_gettime", Hex, PostItimerSpec),
|
||||
225: makeSyscallInfo("timer_getoverrun", Hex),
|
||||
226: makeSyscallInfo("timer_delete", Hex),
|
||||
227: makeSyscallInfo("clock_settime", Hex, Timespec),
|
||||
@@ -303,8 +303,8 @@ var linuxAMD64 = SyscallMap{
|
||||
283: makeSyscallInfo("timerfd_create", Hex, Hex),
|
||||
284: makeSyscallInfo("eventfd", Hex),
|
||||
285: makeSyscallInfo("fallocate", Hex, Hex, Hex, Hex),
|
||||
286: makeSyscallInfo("timerfd_settime", Hex, Hex, Hex, Hex),
|
||||
287: makeSyscallInfo("timerfd_gettime", Hex, Hex),
|
||||
286: makeSyscallInfo("timerfd_settime", Hex, Hex, ItimerSpec, PostItimerSpec),
|
||||
287: makeSyscallInfo("timerfd_gettime", Hex, PostItimerSpec),
|
||||
288: makeSyscallInfo("accept4", Hex, PostSockAddr, SockLen, SockFlags),
|
||||
289: makeSyscallInfo("signalfd4", Hex, Hex, Hex, Hex),
|
||||
290: makeSyscallInfo("eventfd2", Hex, Hex),
|
||||
|
||||
@@ -224,6 +224,16 @@ func itimerval(t *kernel.Task, addr usermem.Addr) string {
|
||||
return fmt.Sprintf("%#x {interval=%s, value=%s}", addr, interval, value)
|
||||
}
|
||||
|
||||
func itimerspec(t *kernel.Task, addr usermem.Addr) string {
|
||||
if addr == 0 {
|
||||
return "null"
|
||||
}
|
||||
|
||||
interval := timespec(t, addr)
|
||||
value := timespec(t, addr+usermem.Addr(binary.Size(linux.Timespec{})))
|
||||
return fmt.Sprintf("%#x {interval=%s, value=%s}", addr, interval, value)
|
||||
}
|
||||
|
||||
func stringVector(t *kernel.Task, addr usermem.Addr) string {
|
||||
vec, err := t.CopyInVector(addr, slinux.ExecMaxElemSize, slinux.ExecMaxTotalSize)
|
||||
if err != nil {
|
||||
@@ -296,6 +306,8 @@ func (i *SyscallInfo) pre(t *kernel.Task, args arch.SyscallArguments, maximumBlo
|
||||
output = append(output, utimensTimespec(t, args[arg].Pointer()))
|
||||
case ItimerVal:
|
||||
output = append(output, itimerval(t, args[arg].Pointer()))
|
||||
case ItimerSpec:
|
||||
output = append(output, itimerspec(t, args[arg].Pointer()))
|
||||
case Timeval:
|
||||
output = append(output, timeval(t, args[arg].Pointer()))
|
||||
case Utimbuf:
|
||||
@@ -362,6 +374,8 @@ func (i *SyscallInfo) post(t *kernel.Task, args arch.SyscallArguments, rval uint
|
||||
output[arg] = timespec(t, args[arg].Pointer())
|
||||
case PostItimerVal:
|
||||
output[arg] = itimerval(t, args[arg].Pointer())
|
||||
case PostItimerSpec:
|
||||
output[arg] = itimerspec(t, args[arg].Pointer())
|
||||
case Timeval:
|
||||
output[arg] = timeval(t, args[arg].Pointer())
|
||||
case Rusage:
|
||||
|
||||
@@ -132,10 +132,17 @@ const (
|
||||
// ItimerVal is a pointer to a struct itimerval.
|
||||
ItimerVal
|
||||
|
||||
// ItimerVal is a pointer to a struct itimerval, formatted after
|
||||
// PostItimerVal is a pointer to a struct itimerval, formatted after
|
||||
// syscall execution.
|
||||
PostItimerVal
|
||||
|
||||
// ItimerSpec is a pointer to a struct itimerspec.
|
||||
ItimerSpec
|
||||
|
||||
// PostItimerSpec is a pointer to a struct itimerspec, formatted after
|
||||
// syscall execution.
|
||||
PostItimerSpec
|
||||
|
||||
// Timeval is a pointer to a struct timeval, formatted before and after
|
||||
// syscall execution.
|
||||
Timeval
|
||||
|
||||
Reference in New Issue
Block a user