Deleted Added
sdiff udiff text old ( 13883:f44e21d3aaa7 ) new ( 13933:b4382461066d )
full compact
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;

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

52#include "sim/sim_exit.hh"
53#include "sim/syscall_debug_macros.hh"
54#include "sim/syscall_desc.hh"
55#include "sim/system.hh"
56
57using namespace std;
58using namespace TheISA;
59
60SyscallReturn
61unimplementedFunc(SyscallDesc *desc, int callnum, Process *process,
62 ThreadContext *tc)
63{
64 fatal("syscall %s (#%d) unimplemented.", desc->name(), callnum);
65
66 return 1;
67}

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

1031 ThreadContext *tc)
1032{
1033 return process->egid();
1034}
1035
1036SyscallReturn
1037fallocateFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc)
1038{
1039#if NO_FALLOCATE
1040 warn("Host OS cannot support calls to fallocate. Ignoring syscall");
1041#else
1042 int index = 0;
1043 int tgt_fd = p->getSyscallArg(tc, index);
1044 int mode = p->getSyscallArg(tc, index);
1045 off_t offset = p->getSyscallArg(tc, index);
1046 off_t len = p->getSyscallArg(tc, index);
1047
1048 auto ffdp = std::dynamic_pointer_cast<FileFDEntry>((*p->fds)[tgt_fd]);
1049 if (!ffdp)
1050 return -EBADF;
1051 int sim_fd = ffdp->getSimFD();
1052
1053 int result = fallocate(sim_fd, mode, offset, len);
1054 if (result < 0)
1055 return -errno;
1056#endif
1057 return 0;
1058}
1059
1060SyscallReturn
1061accessFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc,
1062 int index)
1063{
1064 string path;
1065 if (!tc->getMemProxy().tryReadString(path, p->getSyscallArg(tc, index)))

--- 671 unchanged lines hidden ---