syscall_emul.cc (11684:b3c3893811af) syscall_emul.cc (11760:f9aa72424274)
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;

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

930 return 1;
931 } else {
932 fatal("Called sys_clone, but no unallocated thread contexts found!\n");
933 return 0;
934 }
935}
936
937SyscallReturn
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;

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

930 return 1;
931 } else {
932 fatal("Called sys_clone, but no unallocated thread contexts found!\n");
933 return 0;
934 }
935}
936
937SyscallReturn
938fallocateFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
939 ThreadContext *tc)
940{
941 int index = 0;
942 int tgt_fd = process->getSyscallArg(tc, index);
943 int mode = process->getSyscallArg(tc, index);
944 off_t offset = process->getSyscallArg(tc, index);
945 off_t len = process->getSyscallArg(tc, index);
946
947 int sim_fd = process->getSimFD(tgt_fd);
948 if (sim_fd < 0)
949 return -EBADF;
950
951 int result = fallocate(sim_fd, mode, offset, len);
952 if (result < 0)
953 return -errno;
954
955 return 0;
956}
957
958SyscallReturn
938accessFunc(SyscallDesc *desc, int callnum, LiveProcess *p, ThreadContext *tc,
939 int index)
940{
941 string path;
942 if (!tc->getMemProxy().tryReadString(path, p->getSyscallArg(tc, index)))
943 return -EFAULT;
944
945 // Adjust path for current working directory

--- 14 unchanged lines hidden ---
959accessFunc(SyscallDesc *desc, int callnum, LiveProcess *p, ThreadContext *tc,
960 int index)
961{
962 string path;
963 if (!tc->getMemProxy().tryReadString(path, p->getSyscallArg(tc, index)))
964 return -EFAULT;
965
966 // Adjust path for current working directory

--- 14 unchanged lines hidden ---