syscall_emul.cc (6702:21f032e2ee9b) | syscall_emul.cc (6703:2707e7b63f53) |
---|---|
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; --- 437 unchanged lines hidden (view full) --- 446 447 off_t length = process->getSyscallArg(tc, index); 448 449 int result = ftruncate(fd, length); 450 return (result == -1) ? -errno : result; 451} 452 453SyscallReturn | 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; --- 437 unchanged lines hidden (view full) --- 446 447 off_t length = process->getSyscallArg(tc, index); 448 449 int result = ftruncate(fd, length); 450 return (result == -1) ? -errno : result; 451} 452 453SyscallReturn |
454truncate64Func(SyscallDesc *desc, int num, 455 LiveProcess *process, ThreadContext *tc) 456{ 457 int index = 0; 458 string path; 459 460 if (!tc->getMemPort()->tryReadString(path, process->getSyscallArg(tc, index))) 461 return -EFAULT; 462 463 loff_t length = process->getSyscallArg(tc, index, 64); 464 465 // Adjust path for current working directory 466 path = process->fullPath(path); 467 468 int result = truncate64(path.c_str(), length); 469 return (result == -1) ? -errno : result; 470} 471 472SyscallReturn |
|
454ftruncate64Func(SyscallDesc *desc, int num, 455 LiveProcess *process, ThreadContext *tc) 456{ 457 int index = 0; 458 int fd = process->sim_fd(process->getSyscallArg(tc, index)); 459 460 if (fd < 0) 461 return -EBADF; --- 348 unchanged lines hidden --- | 473ftruncate64Func(SyscallDesc *desc, int num, 474 LiveProcess *process, ThreadContext *tc) 475{ 476 int index = 0; 477 int fd = process->sim_fd(process->getSyscallArg(tc, index)); 478 479 if (fd < 0) 480 return -EBADF; --- 348 unchanged lines hidden --- |