syscalls.cc (13570:b6484720c6a9) syscalls.cc (13583:f7482392b097)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 46 unchanged lines hidden (view full) ---

55
56 return 0;
57}
58
59
60SyscallReturn
61getresuidFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
62{
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 46 unchanged lines hidden (view full) ---

55
56 return 0;
57}
58
59
60SyscallReturn
61getresuidFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
62{
63 const IntReg id = htog(100);
63 const uint64_t id = htog(100);
64 int index = 0;
65 Addr ruid = p->getSyscallArg(tc, index);
66 Addr euid = p->getSyscallArg(tc, index);
67 Addr suid = p->getSyscallArg(tc, index);
68 // Handle the EFAULT case
69 // Set the ruid
70 if (ruid) {
64 int index = 0;
65 Addr ruid = p->getSyscallArg(tc, index);
66 Addr euid = p->getSyscallArg(tc, index);
67 Addr suid = p->getSyscallArg(tc, index);
68 // Handle the EFAULT case
69 // Set the ruid
70 if (ruid) {
71 BufferArg ruidBuff(ruid, sizeof(IntReg));
72 memcpy(ruidBuff.bufferPtr(), &id, sizeof(IntReg));
71 BufferArg ruidBuff(ruid, sizeof(uint64_t));
72 memcpy(ruidBuff.bufferPtr(), &id, sizeof(uint64_t));
73 ruidBuff.copyOut(tc->getMemProxy());
74 }
75 // Set the euid
76 if (euid) {
73 ruidBuff.copyOut(tc->getMemProxy());
74 }
75 // Set the euid
76 if (euid) {
77 BufferArg euidBuff(euid, sizeof(IntReg));
78 memcpy(euidBuff.bufferPtr(), &id, sizeof(IntReg));
77 BufferArg euidBuff(euid, sizeof(uint64_t));
78 memcpy(euidBuff.bufferPtr(), &id, sizeof(uint64_t));
79 euidBuff.copyOut(tc->getMemProxy());
80 }
81 // Set the suid
82 if (suid) {
79 euidBuff.copyOut(tc->getMemProxy());
80 }
81 // Set the suid
82 if (suid) {
83 BufferArg suidBuff(suid, sizeof(IntReg));
84 memcpy(suidBuff.bufferPtr(), &id, sizeof(IntReg));
83 BufferArg suidBuff(suid, sizeof(uint64_t));
84 memcpy(suidBuff.bufferPtr(), &id, sizeof(uint64_t));
85 suidBuff.copyOut(tc->getMemProxy());
86 }
87 return 0;
88}
89
90SyscallDesc SparcLinuxProcess::syscall32Descs[] = {
91 /* 0 */ SyscallDesc("restart_syscall", unimplementedFunc),
92 /* 1 */ SyscallDesc("exit", exitFunc), // 32 bit

--- 594 unchanged lines hidden ---
85 suidBuff.copyOut(tc->getMemProxy());
86 }
87 return 0;
88}
89
90SyscallDesc SparcLinuxProcess::syscall32Descs[] = {
91 /* 0 */ SyscallDesc("restart_syscall", unimplementedFunc),
92 /* 1 */ SyscallDesc("exit", exitFunc), // 32 bit

--- 594 unchanged lines hidden ---