vfs: check userland buffers before reading them.
[haiku.git] / src / kits / debugger / model / SyscallInfo.cpp
blobe6b6ea47dcfaa6c3a9a6b2bf5ac94011d9cf136b
1 /*
2 * Copyright 2013, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
4 */
6 #include "SyscallInfo.h"
8 #include <string.h>
11 SyscallInfo::SyscallInfo()
13 fStartTime(0),
14 fEndTime(0),
15 fReturnValue(0),
16 fSyscall(0)
18 memset(fArguments, 0, sizeof(fArguments));
22 SyscallInfo::SyscallInfo(const SyscallInfo& other)
24 fStartTime(other.fStartTime),
25 fEndTime(other.fEndTime),
26 fReturnValue(other.fReturnValue),
27 fSyscall(other.fSyscall)
29 memcpy(fArguments, other.fArguments, sizeof(fArguments));
33 SyscallInfo::SyscallInfo(bigtime_t startTime, bigtime_t endTime,
34 uint64 returnValue, uint32 syscall, const uint8* args)
36 fStartTime(startTime),
37 fEndTime(endTime),
38 fReturnValue(returnValue),
39 fSyscall(syscall)
41 memcpy(fArguments, args, sizeof(fArguments));
45 void
46 SyscallInfo::SetTo(bigtime_t startTime, bigtime_t endTime, uint64 returnValue,
47 uint32 syscall, const uint8* args)
49 fStartTime = startTime;
50 fEndTime = endTime;
51 fReturnValue = returnValue;
52 fSyscall = syscall;
53 memcpy(fArguments, args, sizeof(fArguments));