Deleted Added
sdiff udiff text old ( 3114:7a4771b9b720 ) new ( 3669:3607aaed36b6 )
full compact
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;

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

209SyscallReturn
210unlinkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
211{
212 string path;
213
214 if (!tc->getMemPort()->tryReadString(path, tc->getSyscallArg(0)))
215 return (TheISA::IntReg)-EFAULT;
216
217 int result = unlink(path.c_str());
218 return (result == -1) ? -errno : result;
219}
220
221SyscallReturn
222renameFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
223{
224 string old_name;
225
226 if (!tc->getMemPort()->tryReadString(old_name, tc->getSyscallArg(0)))
227 return -EFAULT;
228
229 string new_name;
230
231 if (!tc->getMemPort()->tryReadString(new_name, tc->getSyscallArg(1)))
232 return -EFAULT;
233
234 int64_t result = rename(old_name.c_str(), new_name.c_str());
235 return (result == -1) ? -errno : result;
236}
237
238SyscallReturn
239truncateFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
240{
241 string path;
242
243 if (!tc->getMemPort()->tryReadString(path, tc->getSyscallArg(0)))
244 return -EFAULT;
245
246 off_t length = tc->getSyscallArg(1);
247
248 int result = truncate(path.c_str(), length);
249 return (result == -1) ? -errno : result;
250}
251
252SyscallReturn
253ftruncateFunc(SyscallDesc *desc, int num, LiveProcess *process, ThreadContext *tc)
254{
255 int fd = process->sim_fd(tc->getSyscallArg(0));

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

272 return -EFAULT;
273
274 /* XXX endianess */
275 uint32_t owner = tc->getSyscallArg(1);
276 uid_t hostOwner = owner;
277 uint32_t group = tc->getSyscallArg(2);
278 gid_t hostGroup = group;
279
280 int result = chown(path.c_str(), hostOwner, hostGroup);
281 return (result == -1) ? -errno : result;
282}
283
284SyscallReturn
285fchownFunc(SyscallDesc *desc, int num, LiveProcess *process, ThreadContext *tc)
286{
287 int fd = process->sim_fd(tc->getSyscallArg(0));

--- 214 unchanged lines hidden ---