syscall_emul.hh (5074:14404677893a) syscall_emul.hh (5208:8ec8ba9ee9fd)
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;

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

613 std::string path;
614
615 if (!tc->getMemPort()->tryReadString(path, tc->getSyscallArg(0)))
616 return -EFAULT;
617
618 // Adjust path for current working directory
619 path = process->fullPath(path);
620
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;

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

613 std::string path;
614
615 if (!tc->getMemPort()->tryReadString(path, tc->getSyscallArg(0)))
616 return -EFAULT;
617
618 // Adjust path for current working directory
619 path = process->fullPath(path);
620
621#if NO_STAT64
622 struct stat hostBuf;
623 int result = stat(path.c_str(), &hostBuf);
624#else
621 struct stat64 hostBuf;
622 int result = stat64(path.c_str(), &hostBuf);
625 struct stat64 hostBuf;
626 int result = stat64(path.c_str(), &hostBuf);
627#endif
623
624 if (result < 0)
625 return -errno;
626
627 copyOutStat64Buf<OS>(tc->getMemPort(), tc->getSyscallArg(1), &hostBuf);
628
629 return 0;
630}

--- 388 unchanged lines hidden ---
628
629 if (result < 0)
630 return -errno;
631
632 copyOutStat64Buf<OS>(tc->getMemPort(), tc->getSyscallArg(1), &hostBuf);
633
634 return 0;
635}

--- 388 unchanged lines hidden ---