syscall_emul.cc (11794:97eebddaae84) syscall_emul.cc (11799:e47703369039)
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;

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

890 return 0;
891 }
892}
893
894SyscallReturn
895fallocateFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
896 ThreadContext *tc)
897{
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;

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

890 return 0;
891 }
892}
893
894SyscallReturn
895fallocateFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
896 ThreadContext *tc)
897{
898#if NO_FALLOCATE
899 warn("Host OS cannot support calls to fallocate. Ignoring syscall");
900#else
898 int index = 0;
899 int tgt_fd = process->getSyscallArg(tc, index);
900 int mode = process->getSyscallArg(tc, index);
901 off_t offset = process->getSyscallArg(tc, index);
902 off_t len = process->getSyscallArg(tc, index);
903
904 int sim_fd = process->getSimFD(tgt_fd);
905 if (sim_fd < 0)
906 return -EBADF;
907
908 int result = fallocate(sim_fd, mode, offset, len);
909 if (result < 0)
910 return -errno;
901 int index = 0;
902 int tgt_fd = process->getSyscallArg(tc, index);
903 int mode = process->getSyscallArg(tc, index);
904 off_t offset = process->getSyscallArg(tc, index);
905 off_t len = process->getSyscallArg(tc, index);
906
907 int sim_fd = process->getSimFD(tgt_fd);
908 if (sim_fd < 0)
909 return -EBADF;
910
911 int result = fallocate(sim_fd, mode, offset, len);
912 if (result < 0)
913 return -errno;
911
914#endif
912 return 0;
913}
914
915SyscallReturn
916accessFunc(SyscallDesc *desc, int callnum, LiveProcess *p, ThreadContext *tc,
917 int index)
918{
919 string path;

--- 18 unchanged lines hidden ---
915 return 0;
916}
917
918SyscallReturn
919accessFunc(SyscallDesc *desc, int callnum, LiveProcess *p, ThreadContext *tc,
920 int index)
921{
922 string path;

--- 18 unchanged lines hidden ---