syscall_emul.hh (8852:c744483edfcf) syscall_emul.hh (9008:59d2bcf37782)
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;

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

999 int index = 0;
1000 Addr start = p->getSyscallArg(tc, index);
1001 uint64_t length = p->getSyscallArg(tc, index);
1002 index++; // int prot = p->getSyscallArg(tc, index);
1003 int flags = p->getSyscallArg(tc, index);
1004 int tgt_fd = p->getSyscallArg(tc, index);
1005 // int offset = p->getSyscallArg(tc, index);
1006
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;

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

999 int index = 0;
1000 Addr start = p->getSyscallArg(tc, index);
1001 uint64_t length = p->getSyscallArg(tc, index);
1002 index++; // int prot = p->getSyscallArg(tc, index);
1003 int flags = p->getSyscallArg(tc, index);
1004 int tgt_fd = p->getSyscallArg(tc, index);
1005 // int offset = p->getSyscallArg(tc, index);
1006
1007 if (length > 0x100000000ULL)
1008 warn("mmap length argument %#x is unreasonably large.\n", length);
1009
1007 if (!(flags & OS::TGT_MAP_ANONYMOUS)) {
1008 Process::FdMap *fd_map = p->sim_fd_obj(tgt_fd);
1009 if (!fd_map || fd_map->fd < 0) {
1010 warn("mmap failing: target fd %d is not valid\n", tgt_fd);
1011 return -EBADF;
1012 }
1013
1014 if (fd_map->filename != "/dev/zero") {

--- 251 unchanged lines hidden ---
1010 if (!(flags & OS::TGT_MAP_ANONYMOUS)) {
1011 Process::FdMap *fd_map = p->sim_fd_obj(tgt_fd);
1012 if (!fd_map || fd_map->fd < 0) {
1013 warn("mmap failing: target fd %d is not valid\n", tgt_fd);
1014 return -EBADF;
1015 }
1016
1017 if (fd_map->filename != "/dev/zero") {

--- 251 unchanged lines hidden ---