syscall_emul.cc (12795:6e69f6a3c0c0) | syscall_emul.cc (12796:16dffc0e6c7f) |
---|---|
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; --- 526 unchanged lines hidden (view full) --- 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 542SyscallReturn | 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; --- 526 unchanged lines hidden (view full) --- 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 542SyscallReturn |
543symlinkFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc) 544{ 545 string path; 546 string new_path; 547 548 int index = 0; 549 auto &virt_mem = tc->getMemProxy(); 550 if (!virt_mem.tryReadString(path, p->getSyscallArg(tc, index))) 551 return -EFAULT; 552 if (!virt_mem.tryReadString(new_path, p->getSyscallArg(tc, index))) 553 return -EFAULT; 554 555 path = p->fullPath(path); 556 new_path = p->fullPath(new_path); 557 558 int result = symlink(path.c_str(), new_path.c_str()); 559 return (result == -1) ? -errno : result; 560} 561 562SyscallReturn |
|
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; 550 --- 537 unchanged lines hidden --- | 563mkdirFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc) 564{ 565 string path; 566 567 int index = 0; 568 if (!tc->getMemProxy().tryReadString(path, p->getSyscallArg(tc, index))) 569 return -EFAULT; 570 --- 537 unchanged lines hidden --- |