syscall_emul.cc (12716:430023c6881b) | syscall_emul.cc (12795:6e69f6a3c0c0) |
---|---|
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; --- 505 unchanged lines hidden (view full) --- 514 515 // Adjust path for current working directory 516 path = p->fullPath(path); 517 518 int result = unlink(path.c_str()); 519 return (result == -1) ? -errno : result; 520} 521 | 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; --- 505 unchanged lines hidden (view full) --- 514 515 // Adjust path for current working directory 516 path = p->fullPath(path); 517 518 int result = unlink(path.c_str()); 519 return (result == -1) ? -errno : result; 520} 521 |
522SyscallReturn 523linkFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc) 524{ 525 string path; 526 string new_path; |
|
522 | 527 |
528 int index = 0; 529 auto &virt_mem = tc->getMemProxy(); 530 if (!virt_mem.tryReadString(path, p->getSyscallArg(tc, index))) 531 return -EFAULT; 532 if (!virt_mem.tryReadString(new_path, p->getSyscallArg(tc, index))) 533 return -EFAULT; 534 535 path = p->fullPath(path); 536 new_path = p->fullPath(new_path); 537 538 int result = link(path.c_str(), new_path.c_str()); 539 return (result == -1) ? -errno : result; 540} 541 |
|
523SyscallReturn 524mkdirFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc) 525{ 526 string path; 527 528 int index = 0; 529 if (!tc->getMemProxy().tryReadString(path, p->getSyscallArg(tc, index))) 530 return -EFAULT; --- 538 unchanged lines hidden --- | 542SyscallReturn 543mkdirFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc) 544{ 545 string path; 546 547 int index = 0; 548 if (!tc->getMemProxy().tryReadString(path, p->getSyscallArg(tc, index))) 549 return -EFAULT; --- 538 unchanged lines hidden --- |