process.cc revision 2048
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; 9 * redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution; 12 * neither the name of the copyright holders nor the names of its 13 * contributors may be used to endorse or promote products derived from 14 * this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <dirent.h> 30#include <errno.h> 31#include <fcntl.h> // for host open() flags 32#include <string.h> // for memset() 33#include <sys/stat.h> 34#include <sys/types.h> 35#include <unistd.h> 36 37#include "cpu/base.hh" 38#include "cpu/exec_context.hh" 39#include "mem/functional/functional.hh" 40#include "sim/fake_syscall.hh" 41#include "sim/host.hh" 42#include "sim/process.hh" 43#include "sim/sim_events.hh" 44 45#include "arch/alpha/isa_traits.hh" 46#include "arch/alpha/alpha_common_syscall_emul.hh" 47#include "sim/syscall_emul.hh" 48#include "sim/root.hh" // for curTick & ticksPerSecond 49 50#include "arch/alpha/alpha_linux_process.hh" 51 52#include "base/trace.hh" 53 54using namespace std; 55 56/// 57/// This class encapsulates the types, structures, constants, 58/// functions, and syscall-number mappings specific to the Alpha Linux 59/// syscall interface. 60/// 61class Linux { 62 63 public: 64 65 //@{ 66 /// Basic Linux types. 67 typedef uint64_t size_t; 68 typedef uint64_t off_t; 69 typedef int64_t time_t; 70 typedef uint32_t uid_t; 71 typedef uint32_t gid_t; 72 //@} 73 74 //@{ 75 /// open(2) flag values. 76 static const int TGT_O_RDONLY = 00000000; //!< O_RDONLY 77 static const int TGT_O_WRONLY = 00000001; //!< O_WRONLY 78 static const int TGT_O_RDWR = 00000002; //!< O_RDWR 79 static const int TGT_O_NONBLOCK = 00000004; //!< O_NONBLOCK 80 static const int TGT_O_APPEND = 00000010; //!< O_APPEND 81 static const int TGT_O_CREAT = 00001000; //!< O_CREAT 82 static const int TGT_O_TRUNC = 00002000; //!< O_TRUNC 83 static const int TGT_O_EXCL = 00004000; //!< O_EXCL 84 static const int TGT_O_NOCTTY = 00010000; //!< O_NOCTTY 85 static const int TGT_O_SYNC = 00040000; //!< O_SYNC 86 static const int TGT_O_DRD = 00100000; //!< O_DRD 87 static const int TGT_O_DIRECTIO = 00200000; //!< O_DIRECTIO 88 static const int TGT_O_CACHE = 00400000; //!< O_CACHE 89 static const int TGT_O_DSYNC = 02000000; //!< O_DSYNC 90 static const int TGT_O_RSYNC = 04000000; //!< O_RSYNC 91 //@} 92 93 /// This table maps the target open() flags to the corresponding 94 /// host open() flags. 95 static OpenFlagTransTable openFlagTable[]; 96 97 /// Number of entries in openFlagTable[]. 98 static const int NUM_OPEN_FLAGS; 99 100 /// Stat buffer. Note that we can't call it 'stat' since that 101 /// gets #defined to something else on some systems. 102 struct tgt_stat { 103 uint32_t st_dev; //!< device 104 uint32_t st_ino; //!< inode 105 uint32_t st_mode; //!< mode 106 uint32_t st_nlink; //!< link count 107 uint32_t st_uid; //!< owner's user ID 108 uint32_t st_gid; //!< owner's group ID 109 uint32_t st_rdev; //!< device number 110 int32_t _pad1; //!< for alignment 111 int64_t st_size; //!< file size in bytes 112 uint64_t st_atimeX; //!< time of last access 113 uint64_t st_mtimeX; //!< time of last modification 114 uint64_t st_ctimeX; //!< time of last status change 115 uint32_t st_blksize; //!< optimal I/O block size 116 int32_t st_blocks; //!< number of blocks allocated 117 uint32_t st_flags; //!< flags 118 uint32_t st_gen; //!< unknown 119 }; 120 121 // same for stat64 122 struct tgt_stat64 { 123 uint64_t st_dev; 124 uint64_t st_ino; 125 uint64_t st_rdev; 126 int64_t st_size; 127 uint64_t st_blocks; 128 129 uint32_t st_mode; 130 uint32_t st_uid; 131 uint32_t st_gid; 132 uint32_t st_blksize; 133 uint32_t st_nlink; 134 uint32_t __pad0; 135 136 uint64_t tgt_st_atime; 137 uint64_t st_atime_nsec; 138 uint64_t tgt_st_mtime; 139 uint64_t st_mtime_nsec; 140 uint64_t tgt_st_ctime; 141 uint64_t st_ctime_nsec; 142 int64_t __unused[3]; 143 }; 144 145 /// Length of strings in struct utsname (plus 1 for null char). 146 static const int _SYS_NMLN = 65; 147 148 /// Interface struct for uname(). 149 struct utsname { 150 char sysname[_SYS_NMLN]; //!< System name. 151 char nodename[_SYS_NMLN]; //!< Node name. 152 char release[_SYS_NMLN]; //!< OS release. 153 char version[_SYS_NMLN]; //!< OS version. 154 char machine[_SYS_NMLN]; //!< Machine type. 155 }; 156 157 158 //@{ 159 /// ioctl() command codes. 160 static const unsigned TIOCGETP = 0x40067408; 161 static const unsigned TIOCSETP = 0x80067409; 162 static const unsigned TIOCSETN = 0x8006740a; 163 static const unsigned TIOCSETC = 0x80067411; 164 static const unsigned TIOCGETC = 0x40067412; 165 static const unsigned FIONREAD = 0x4004667f; 166 static const unsigned TIOCISATTY = 0x2000745e; 167 static const unsigned TIOCGETS = 0x402c7413; 168 static const unsigned TIOCGETA = 0x40127417; 169 //@} 170 171 /// Resource enumeration for getrlimit(). 172 enum rlimit_resources { 173 RLIMIT_CPU = 0, 174 RLIMIT_FSIZE = 1, 175 RLIMIT_DATA = 2, 176 RLIMIT_STACK = 3, 177 RLIMIT_CORE = 4, 178 RLIMIT_RSS = 5, 179 RLIMIT_NOFILE = 6, 180 RLIMIT_AS = 7, 181 RLIMIT_VMEM = 7, 182 RLIMIT_NPROC = 8, 183 RLIMIT_MEMLOCK = 9, 184 RLIMIT_LOCKS = 10 185 }; 186 187 /// Limit struct for getrlimit/setrlimit. 188 struct rlimit { 189 uint64_t rlim_cur; //!< soft limit 190 uint64_t rlim_max; //!< hard limit 191 }; 192 193 194 /// For mmap(). 195 static const unsigned TGT_MAP_ANONYMOUS = 0x10; 196 197 /// For gettimeofday(). 198 struct timeval { 199 int64_t tv_sec; //!< seconds 200 int64_t tv_usec; //!< microseconds 201 }; 202 203 // For writev/readv 204 struct tgt_iovec { 205 uint64_t iov_base; // void * 206 uint64_t iov_len; 207 }; 208 209 //@{ 210 /// For getrusage(). 211 static const int RUSAGE_SELF = 0; 212 static const int RUSAGE_CHILDREN = -1; 213 static const int RUSAGE_BOTH = -2; 214 //@} 215 216 /// For getrusage(). 217 struct rusage { 218 struct timeval ru_utime; //!< user time used 219 struct timeval ru_stime; //!< system time used 220 int64_t ru_maxrss; //!< max rss 221 int64_t ru_ixrss; //!< integral shared memory size 222 int64_t ru_idrss; //!< integral unshared data " 223 int64_t ru_isrss; //!< integral unshared stack " 224 int64_t ru_minflt; //!< page reclaims - total vmfaults 225 int64_t ru_majflt; //!< page faults 226 int64_t ru_nswap; //!< swaps 227 int64_t ru_inblock; //!< block input operations 228 int64_t ru_oublock; //!< block output operations 229 int64_t ru_msgsnd; //!< messages sent 230 int64_t ru_msgrcv; //!< messages received 231 int64_t ru_nsignals; //!< signals received 232 int64_t ru_nvcsw; //!< voluntary context switches 233 int64_t ru_nivcsw; //!< involuntary " 234 }; 235 236 /// Helper function to convert a host stat buffer to a target stat 237 /// buffer. Also copies the target buffer out to the simulated 238 /// memory space. Used by stat(), fstat(), and lstat(). 239 static void 240 copyOutStatBuf(FunctionalMemory *mem, Addr addr, struct stat *host) 241 { 242 TypedBufferArg<Linux::tgt_stat> tgt(addr); 243 244 tgt->st_dev = host->st_dev; 245 tgt->st_ino = host->st_ino; 246 tgt->st_mode = host->st_mode; 247 tgt->st_nlink = host->st_nlink; 248 tgt->st_uid = host->st_uid; 249 tgt->st_gid = host->st_gid; 250 tgt->st_rdev = host->st_rdev; 251 tgt->st_size = host->st_size; 252 tgt->st_atimeX = host->st_atime; 253 tgt->st_mtimeX = host->st_mtime; 254 tgt->st_ctimeX = host->st_ctime; 255 tgt->st_blksize = host->st_blksize; 256 tgt->st_blocks = host->st_blocks; 257 258 tgt.copyOut(mem); 259 } 260 261 // Same for stat64 262 static void 263 copyOutStat64Buf(FunctionalMemory *mem, Addr addr, struct stat64 *host) 264 { 265 TypedBufferArg<Linux::tgt_stat64> tgt(addr); 266 267 // XXX byteswaps 268 tgt->st_dev = host->st_dev; 269 // XXX What about STAT64_HAS_BROKEN_ST_INO ??? 270 tgt->st_ino = host->st_ino; 271 tgt->st_rdev = host->st_rdev; 272 tgt->st_size = host->st_size; 273 tgt->st_blocks = host->st_blocks; 274 275 tgt->st_mode = host->st_mode; 276 tgt->st_uid = host->st_uid; 277 tgt->st_gid = host->st_gid; 278 tgt->st_blksize = host->st_blksize; 279 tgt->st_nlink = host->st_nlink; 280 tgt->tgt_st_atime = host->st_atime; 281 tgt->tgt_st_mtime = host->st_mtime; 282 tgt->tgt_st_ctime = host->st_ctime; 283#ifdef STAT_HAVE_NSEC 284 tgt->st_atime_nsec = host->st_atime_nsec; 285 tgt->st_mtime_nsec = host->st_mtime_nsec; 286 tgt->st_ctime_nsec = host->st_ctime_nsec; 287#else 288 tgt->st_atime_nsec = 0; 289 tgt->st_mtime_nsec = 0; 290 tgt->st_ctime_nsec = 0; 291#endif 292 tgt.copyOut(mem); 293 } 294 295 /// The target system's hostname. 296 static const char *hostname; 297 298 /// Target uname() handler. 299 static SyscallReturn 300 unameFunc(SyscallDesc *desc, int callnum, Process *process, 301 ExecContext *xc) 302 { 303 TypedBufferArg<Linux::utsname> name(xc->getSyscallArg(0)); 304 305 strcpy(name->sysname, "Linux"); 306 strcpy(name->nodename, hostname); 307 strcpy(name->release, "2.4.20"); 308 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003"); 309 strcpy(name->machine, "alpha"); 310 311 name.copyOut(xc->mem); 312 return 0; 313 } 314 315 /// Target osf_getsysyinfo() handler. Even though this call is 316 /// borrowed from Tru64, the subcases that get used appear to be 317 /// different in practice from those used by Tru64 processes. 318 static SyscallReturn 319 osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, 320 ExecContext *xc) 321 { 322 unsigned op = xc->getSyscallArg(0); 323 // unsigned nbytes = xc->getSyscallArg(2); 324 325 switch (op) { 326 327 case 45: { // GSI_IEEE_FP_CONTROL 328 TypedBufferArg<uint64_t> fpcr(xc->getSyscallArg(1)); 329 // I don't think this exactly matches the HW FPCR 330 *fpcr = 0; 331 fpcr.copyOut(xc->mem); 332 return 0; 333 } 334 335 default: 336 cerr << "osf_getsysinfo: unknown op " << op << endl; 337 abort(); 338 break; 339 } 340 341 return 1; 342 } 343 344 /// Target osf_setsysinfo() handler. 345 static SyscallReturn 346 osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, 347 ExecContext *xc) 348 { 349 unsigned op = xc->getSyscallArg(0); 350 // unsigned nbytes = xc->getSyscallArg(2); 351 352 switch (op) { 353 354 case 14: { // SSI_IEEE_FP_CONTROL 355 TypedBufferArg<uint64_t> fpcr(xc->getSyscallArg(1)); 356 // I don't think this exactly matches the HW FPCR 357 fpcr.copyIn(xc->mem); 358 DPRINTFR(SyscallVerbose, "osf_setsysinfo(SSI_IEEE_FP_CONTROL): " 359 " setting FPCR to 0x%x\n", *(uint64_t*)fpcr); 360 return 0; 361 } 362 363 default: 364 cerr << "osf_setsysinfo: unknown op " << op << endl; 365 abort(); 366 break; 367 } 368 369 return 1; 370 } 371 372 /// Target fnctl() handler. 373 static SyscallReturn 374 fcntlFunc(SyscallDesc *desc, int callnum, Process *process, 375 ExecContext *xc) 376 { 377 int fd = xc->getSyscallArg(0); 378 379 if (fd < 0 || process->sim_fd(fd) < 0) 380 return -EBADF; 381 382 int cmd = xc->getSyscallArg(1); 383 switch (cmd) { 384 case 0: // F_DUPFD 385 // if we really wanted to support this, we'd need to do it 386 // in the target fd space. 387 warn("fcntl(%d, F_DUPFD) not supported, error returned\n", fd); 388 return -EMFILE; 389 390 case 1: // F_GETFD (get close-on-exec flag) 391 case 2: // F_SETFD (set close-on-exec flag) 392 return 0; 393 394 case 3: // F_GETFL (get file flags) 395 case 4: // F_SETFL (set file flags) 396 // not sure if this is totally valid, but we'll pass it through 397 // to the underlying OS 398 warn("fcntl(%d, %d) passed through to host\n", fd, cmd); 399 return fcntl(process->sim_fd(fd), cmd); 400 // return 0; 401 402 case 7: // F_GETLK (get lock) 403 case 8: // F_SETLK (set lock) 404 case 9: // F_SETLKW (set lock and wait) 405 // don't mess with file locking... just act like it's OK 406 warn("File lock call (fcntl(%d, %d)) ignored.\n", fd, cmd); 407 return 0; 408 409 default: 410 warn("Unknown fcntl command %d\n", cmd); 411 return 0; 412 } 413 } 414 415 /// Array of syscall descriptors, indexed by call number. 416 static SyscallDesc syscallDescs[]; 417 418 /// Number of syscalls in syscallDescs[]. 419 static const int Num_Syscall_Descs; 420 421 /// Max supported syscall number. 422 static const int Max_Syscall_Desc; 423 424 /// Do the specified syscall. Just looks the call number up in 425 /// the table and invokes the appropriate handler. 426 static void 427 doSyscall(int callnum, Process *process, ExecContext *xc) 428 { 429 if (callnum < 0 || callnum > Max_Syscall_Desc) { 430 fatal("Syscall %d out of range", callnum); 431 } 432 433 SyscallDesc *desc = &syscallDescs[callnum]; 434 435 desc->doSyscall(callnum, process, xc); 436 } 437}; // class Linux 438 439 440// open(2) flags translation table 441OpenFlagTransTable Linux::openFlagTable[] = { 442#ifdef _MSC_VER 443 { Linux::TGT_O_RDONLY, _O_RDONLY }, 444 { Linux::TGT_O_WRONLY, _O_WRONLY }, 445 { Linux::TGT_O_RDWR, _O_RDWR }, 446 { Linux::TGT_O_APPEND, _O_APPEND }, 447 { Linux::TGT_O_CREAT, _O_CREAT }, 448 { Linux::TGT_O_TRUNC, _O_TRUNC }, 449 { Linux::TGT_O_EXCL, _O_EXCL }, 450#ifdef _O_NONBLOCK 451 { Linux::TGT_O_NONBLOCK, _O_NONBLOCK }, 452#endif 453#ifdef _O_NOCTTY 454 { Linux::TGT_O_NOCTTY, _O_NOCTTY }, 455#endif 456#ifdef _O_SYNC 457 { Linux::TGT_O_SYNC, _O_SYNC }, 458#endif 459#else /* !_MSC_VER */ 460 { Linux::TGT_O_RDONLY, O_RDONLY }, 461 { Linux::TGT_O_WRONLY, O_WRONLY }, 462 { Linux::TGT_O_RDWR, O_RDWR }, 463 { Linux::TGT_O_APPEND, O_APPEND }, 464 { Linux::TGT_O_CREAT, O_CREAT }, 465 { Linux::TGT_O_TRUNC, O_TRUNC }, 466 { Linux::TGT_O_EXCL, O_EXCL }, 467 { Linux::TGT_O_NONBLOCK, O_NONBLOCK }, 468 { Linux::TGT_O_NOCTTY, O_NOCTTY }, 469#ifdef O_SYNC 470 { Linux::TGT_O_SYNC, O_SYNC }, 471#endif 472#endif /* _MSC_VER */ 473}; 474 475const int Linux::NUM_OPEN_FLAGS = 476 (sizeof(Linux::openFlagTable)/sizeof(Linux::openFlagTable[0])); 477 478const char *Linux::hostname = "m5.eecs.umich.edu"; 479 480SyscallDesc Linux::syscallDescs[] = { 481 /* 0 */ SyscallDesc("osf_syscall", unimplementedFunc), 482 /* 1 */ SyscallDesc("exit", exitFunc), 483 /* 2 */ SyscallDesc("fork", unimplementedFunc), 484 /* 3 */ SyscallDesc("read", readFunc), 485 /* 4 */ SyscallDesc("write", writeFunc), 486 /* 5 */ SyscallDesc("osf_old_open", unimplementedFunc), 487 /* 6 */ SyscallDesc("close", closeFunc), 488 /* 7 */ SyscallDesc("osf_wait4", unimplementedFunc), 489 /* 8 */ SyscallDesc("osf_old_creat", unimplementedFunc), 490 /* 9 */ SyscallDesc("link", unimplementedFunc), 491 /* 10 */ SyscallDesc("unlink", unlinkFunc), 492 /* 11 */ SyscallDesc("osf_execve", unimplementedFunc), 493 /* 12 */ SyscallDesc("chdir", unimplementedFunc), 494 /* 13 */ SyscallDesc("fchdir", unimplementedFunc), 495 /* 14 */ SyscallDesc("mknod", unimplementedFunc), 496 /* 15 */ SyscallDesc("chmod", chmodFunc<Linux>), 497 /* 16 */ SyscallDesc("chown", chownFunc), 498 /* 17 */ SyscallDesc("brk", obreakFunc), 499 /* 18 */ SyscallDesc("osf_getfsstat", unimplementedFunc), 500 /* 19 */ SyscallDesc("lseek", lseekFunc), 501 /* 20 */ SyscallDesc("getxpid", getpidFunc), 502 /* 21 */ SyscallDesc("osf_mount", unimplementedFunc), 503 /* 22 */ SyscallDesc("umount", unimplementedFunc), 504 /* 23 */ SyscallDesc("setuid", setuidFunc), 505 /* 24 */ SyscallDesc("getxuid", getuidFunc), 506 /* 25 */ SyscallDesc("exec_with_loader", unimplementedFunc), 507 /* 26 */ SyscallDesc("osf_ptrace", unimplementedFunc), 508 /* 27 */ SyscallDesc("osf_nrecvmsg", unimplementedFunc), 509 /* 28 */ SyscallDesc("osf_nsendmsg", unimplementedFunc), 510 /* 29 */ SyscallDesc("osf_nrecvfrom", unimplementedFunc), 511 /* 30 */ SyscallDesc("osf_naccept", unimplementedFunc), 512 /* 31 */ SyscallDesc("osf_ngetpeername", unimplementedFunc), 513 /* 32 */ SyscallDesc("osf_ngetsockname", unimplementedFunc), 514 /* 33 */ SyscallDesc("access", unimplementedFunc), 515 /* 34 */ SyscallDesc("osf_chflags", unimplementedFunc), 516 /* 35 */ SyscallDesc("osf_fchflags", unimplementedFunc), 517 /* 36 */ SyscallDesc("sync", unimplementedFunc), 518 /* 37 */ SyscallDesc("kill", unimplementedFunc), 519 /* 38 */ SyscallDesc("osf_old_stat", unimplementedFunc), 520 /* 39 */ SyscallDesc("setpgid", unimplementedFunc), 521 /* 40 */ SyscallDesc("osf_old_lstat", unimplementedFunc), 522 /* 41 */ SyscallDesc("dup", unimplementedFunc), 523 /* 42 */ SyscallDesc("pipe", unimplementedFunc), 524 /* 43 */ SyscallDesc("osf_set_program_attributes", unimplementedFunc), 525 /* 44 */ SyscallDesc("osf_profil", unimplementedFunc), 526 /* 45 */ SyscallDesc("open", openFunc<Linux>), 527 /* 46 */ SyscallDesc("osf_old_sigaction", unimplementedFunc), 528 /* 47 */ SyscallDesc("getxgid", getgidFunc), 529 /* 48 */ SyscallDesc("osf_sigprocmask", ignoreFunc), 530 /* 49 */ SyscallDesc("osf_getlogin", unimplementedFunc), 531 /* 50 */ SyscallDesc("osf_setlogin", unimplementedFunc), 532 /* 51 */ SyscallDesc("acct", unimplementedFunc), 533 /* 52 */ SyscallDesc("sigpending", unimplementedFunc), 534 /* 53 */ SyscallDesc("osf_classcntl", unimplementedFunc), 535 /* 54 */ SyscallDesc("ioctl", ioctlFunc<Linux>), 536 /* 55 */ SyscallDesc("osf_reboot", unimplementedFunc), 537 /* 56 */ SyscallDesc("osf_revoke", unimplementedFunc), 538 /* 57 */ SyscallDesc("symlink", unimplementedFunc), 539 /* 58 */ SyscallDesc("readlink", unimplementedFunc), 540 /* 59 */ SyscallDesc("execve", unimplementedFunc), 541 /* 60 */ SyscallDesc("umask", unimplementedFunc), 542 /* 61 */ SyscallDesc("chroot", unimplementedFunc), 543 /* 62 */ SyscallDesc("osf_old_fstat", unimplementedFunc), 544 /* 63 */ SyscallDesc("getpgrp", unimplementedFunc), 545 /* 64 */ SyscallDesc("getpagesize", getpagesizeFunc), 546 /* 65 */ SyscallDesc("osf_mremap", unimplementedFunc), 547 /* 66 */ SyscallDesc("vfork", unimplementedFunc), 548 /* 67 */ SyscallDesc("stat", statFunc<Linux>), 549 /* 68 */ SyscallDesc("lstat", lstatFunc<Linux>), 550 /* 69 */ SyscallDesc("osf_sbrk", unimplementedFunc), 551 /* 70 */ SyscallDesc("osf_sstk", unimplementedFunc), 552 /* 71 */ SyscallDesc("mmap", mmapFunc<Linux>), 553 /* 72 */ SyscallDesc("osf_old_vadvise", unimplementedFunc), 554 /* 73 */ SyscallDesc("munmap", munmapFunc), 555 /* 74 */ SyscallDesc("mprotect", ignoreFunc), 556 /* 75 */ SyscallDesc("madvise", unimplementedFunc), 557 /* 76 */ SyscallDesc("vhangup", unimplementedFunc), 558 /* 77 */ SyscallDesc("osf_kmodcall", unimplementedFunc), 559 /* 78 */ SyscallDesc("osf_mincore", unimplementedFunc), 560 /* 79 */ SyscallDesc("getgroups", unimplementedFunc), 561 /* 80 */ SyscallDesc("setgroups", unimplementedFunc), 562 /* 81 */ SyscallDesc("osf_old_getpgrp", unimplementedFunc), 563 /* 82 */ SyscallDesc("setpgrp", unimplementedFunc), 564 /* 83 */ SyscallDesc("osf_setitimer", unimplementedFunc), 565 /* 84 */ SyscallDesc("osf_old_wait", unimplementedFunc), 566 /* 85 */ SyscallDesc("osf_table", unimplementedFunc), 567 /* 86 */ SyscallDesc("osf_getitimer", unimplementedFunc), 568 /* 87 */ SyscallDesc("gethostname", gethostnameFunc), 569 /* 88 */ SyscallDesc("sethostname", unimplementedFunc), 570 /* 89 */ SyscallDesc("getdtablesize", unimplementedFunc), 571 /* 90 */ SyscallDesc("dup2", unimplementedFunc), 572 /* 91 */ SyscallDesc("fstat", fstatFunc<Linux>), 573 /* 92 */ SyscallDesc("fcntl", fcntlFunc), 574 /* 93 */ SyscallDesc("osf_select", unimplementedFunc), 575 /* 94 */ SyscallDesc("poll", unimplementedFunc), 576 /* 95 */ SyscallDesc("fsync", unimplementedFunc), 577 /* 96 */ SyscallDesc("setpriority", unimplementedFunc), 578 /* 97 */ SyscallDesc("socket", unimplementedFunc), 579 /* 98 */ SyscallDesc("connect", unimplementedFunc), 580 /* 99 */ SyscallDesc("accept", unimplementedFunc), 581 /* 100 */ SyscallDesc("getpriority", unimplementedFunc), 582 /* 101 */ SyscallDesc("send", unimplementedFunc), 583 /* 102 */ SyscallDesc("recv", unimplementedFunc), 584 /* 103 */ SyscallDesc("sigreturn", unimplementedFunc), 585 /* 104 */ SyscallDesc("bind", unimplementedFunc), 586 /* 105 */ SyscallDesc("setsockopt", unimplementedFunc), 587 /* 106 */ SyscallDesc("listen", unimplementedFunc), 588 /* 107 */ SyscallDesc("osf_plock", unimplementedFunc), 589 /* 108 */ SyscallDesc("osf_old_sigvec", unimplementedFunc), 590 /* 109 */ SyscallDesc("osf_old_sigblock", unimplementedFunc), 591 /* 110 */ SyscallDesc("osf_old_sigsetmask", unimplementedFunc), 592 /* 111 */ SyscallDesc("sigsuspend", unimplementedFunc), 593 /* 112 */ SyscallDesc("osf_sigstack", ignoreFunc), 594 /* 113 */ SyscallDesc("recvmsg", unimplementedFunc), 595 /* 114 */ SyscallDesc("sendmsg", unimplementedFunc), 596 /* 115 */ SyscallDesc("osf_old_vtrace", unimplementedFunc), 597 /* 116 */ SyscallDesc("osf_gettimeofday", unimplementedFunc), 598 /* 117 */ SyscallDesc("osf_getrusage", unimplementedFunc), 599 /* 118 */ SyscallDesc("getsockopt", unimplementedFunc), 600 /* 119 */ SyscallDesc("numa_syscalls", unimplementedFunc), 601 /* 120 */ SyscallDesc("readv", unimplementedFunc), 602 /* 121 */ SyscallDesc("writev", writevFunc<Linux>), 603 /* 122 */ SyscallDesc("osf_settimeofday", unimplementedFunc), 604 /* 123 */ SyscallDesc("fchown", fchownFunc), 605 /* 124 */ SyscallDesc("fchmod", fchmodFunc<Linux>), 606 /* 125 */ SyscallDesc("recvfrom", unimplementedFunc), 607 /* 126 */ SyscallDesc("setreuid", unimplementedFunc), 608 /* 127 */ SyscallDesc("setregid", unimplementedFunc), 609 /* 128 */ SyscallDesc("rename", renameFunc), 610 /* 129 */ SyscallDesc("truncate", unimplementedFunc), 611 /* 130 */ SyscallDesc("ftruncate", unimplementedFunc), 612 /* 131 */ SyscallDesc("flock", unimplementedFunc), 613 /* 132 */ SyscallDesc("setgid", unimplementedFunc), 614 /* 133 */ SyscallDesc("sendto", unimplementedFunc), 615 /* 134 */ SyscallDesc("shutdown", unimplementedFunc), 616 /* 135 */ SyscallDesc("socketpair", unimplementedFunc), 617 /* 136 */ SyscallDesc("mkdir", unimplementedFunc), 618 /* 137 */ SyscallDesc("rmdir", unimplementedFunc), 619 /* 138 */ SyscallDesc("osf_utimes", unimplementedFunc), 620 /* 139 */ SyscallDesc("osf_old_sigreturn", unimplementedFunc), 621 /* 140 */ SyscallDesc("osf_adjtime", unimplementedFunc), 622 /* 141 */ SyscallDesc("getpeername", unimplementedFunc), 623 /* 142 */ SyscallDesc("osf_gethostid", unimplementedFunc), 624 /* 143 */ SyscallDesc("osf_sethostid", unimplementedFunc), 625 /* 144 */ SyscallDesc("getrlimit", getrlimitFunc<Linux>), 626 /* 145 */ SyscallDesc("setrlimit", ignoreFunc), 627 /* 146 */ SyscallDesc("osf_old_killpg", unimplementedFunc), 628 /* 147 */ SyscallDesc("setsid", unimplementedFunc), 629 /* 148 */ SyscallDesc("quotactl", unimplementedFunc), 630 /* 149 */ SyscallDesc("osf_oldquota", unimplementedFunc), 631 /* 150 */ SyscallDesc("getsockname", unimplementedFunc), 632 /* 151 */ SyscallDesc("osf_pread", unimplementedFunc), 633 /* 152 */ SyscallDesc("osf_pwrite", unimplementedFunc), 634 /* 153 */ SyscallDesc("osf_pid_block", unimplementedFunc), 635 /* 154 */ SyscallDesc("osf_pid_unblock", unimplementedFunc), 636 /* 155 */ SyscallDesc("osf_signal_urti", unimplementedFunc), 637 /* 156 */ SyscallDesc("sigaction", ignoreFunc), 638 /* 157 */ SyscallDesc("osf_sigwaitprim", unimplementedFunc), 639 /* 158 */ SyscallDesc("osf_nfssvc", unimplementedFunc), 640 /* 159 */ SyscallDesc("osf_getdirentries", unimplementedFunc), 641 /* 160 */ SyscallDesc("osf_statfs", unimplementedFunc), 642 /* 161 */ SyscallDesc("osf_fstatfs", unimplementedFunc), 643 /* 162 */ SyscallDesc("unknown #162", unimplementedFunc), 644 /* 163 */ SyscallDesc("osf_async_daemon", unimplementedFunc), 645 /* 164 */ SyscallDesc("osf_getfh", unimplementedFunc), 646 /* 165 */ SyscallDesc("osf_getdomainname", unimplementedFunc), 647 /* 166 */ SyscallDesc("setdomainname", unimplementedFunc), 648 /* 167 */ SyscallDesc("unknown #167", unimplementedFunc), 649 /* 168 */ SyscallDesc("unknown #168", unimplementedFunc), 650 /* 169 */ SyscallDesc("osf_exportfs", unimplementedFunc), 651 /* 170 */ SyscallDesc("unknown #170", unimplementedFunc), 652 /* 171 */ SyscallDesc("unknown #171", unimplementedFunc), 653 /* 172 */ SyscallDesc("unknown #172", unimplementedFunc), 654 /* 173 */ SyscallDesc("unknown #173", unimplementedFunc), 655 /* 174 */ SyscallDesc("unknown #174", unimplementedFunc), 656 /* 175 */ SyscallDesc("unknown #175", unimplementedFunc), 657 /* 176 */ SyscallDesc("unknown #176", unimplementedFunc), 658 /* 177 */ SyscallDesc("unknown #177", unimplementedFunc), 659 /* 178 */ SyscallDesc("unknown #178", unimplementedFunc), 660 /* 179 */ SyscallDesc("unknown #179", unimplementedFunc), 661 /* 180 */ SyscallDesc("unknown #180", unimplementedFunc), 662 /* 181 */ SyscallDesc("osf_alt_plock", unimplementedFunc), 663 /* 182 */ SyscallDesc("unknown #182", unimplementedFunc), 664 /* 183 */ SyscallDesc("unknown #183", unimplementedFunc), 665 /* 184 */ SyscallDesc("osf_getmnt", unimplementedFunc), 666 /* 185 */ SyscallDesc("unknown #185", unimplementedFunc), 667 /* 186 */ SyscallDesc("unknown #186", unimplementedFunc), 668 /* 187 */ SyscallDesc("osf_alt_sigpending", unimplementedFunc), 669 /* 188 */ SyscallDesc("osf_alt_setsid", unimplementedFunc), 670 /* 189 */ SyscallDesc("unknown #189", unimplementedFunc), 671 /* 190 */ SyscallDesc("unknown #190", unimplementedFunc), 672 /* 191 */ SyscallDesc("unknown #191", unimplementedFunc), 673 /* 192 */ SyscallDesc("unknown #192", unimplementedFunc), 674 /* 193 */ SyscallDesc("unknown #193", unimplementedFunc), 675 /* 194 */ SyscallDesc("unknown #194", unimplementedFunc), 676 /* 195 */ SyscallDesc("unknown #195", unimplementedFunc), 677 /* 196 */ SyscallDesc("unknown #196", unimplementedFunc), 678 /* 197 */ SyscallDesc("unknown #197", unimplementedFunc), 679 /* 198 */ SyscallDesc("unknown #198", unimplementedFunc), 680 /* 199 */ SyscallDesc("osf_swapon", unimplementedFunc), 681 /* 200 */ SyscallDesc("msgctl", unimplementedFunc), 682 /* 201 */ SyscallDesc("msgget", unimplementedFunc), 683 /* 202 */ SyscallDesc("msgrcv", unimplementedFunc), 684 /* 203 */ SyscallDesc("msgsnd", unimplementedFunc), 685 /* 204 */ SyscallDesc("semctl", unimplementedFunc), 686 /* 205 */ SyscallDesc("semget", unimplementedFunc), 687 /* 206 */ SyscallDesc("semop", unimplementedFunc), 688 /* 207 */ SyscallDesc("osf_utsname", unimplementedFunc), 689 /* 208 */ SyscallDesc("lchown", unimplementedFunc), 690 /* 209 */ SyscallDesc("osf_shmat", unimplementedFunc), 691 /* 210 */ SyscallDesc("shmctl", unimplementedFunc), 692 /* 211 */ SyscallDesc("shmdt", unimplementedFunc), 693 /* 212 */ SyscallDesc("shmget", unimplementedFunc), 694 /* 213 */ SyscallDesc("osf_mvalid", unimplementedFunc), 695 /* 214 */ SyscallDesc("osf_getaddressconf", unimplementedFunc), 696 /* 215 */ SyscallDesc("osf_msleep", unimplementedFunc), 697 /* 216 */ SyscallDesc("osf_mwakeup", unimplementedFunc), 698 /* 217 */ SyscallDesc("msync", unimplementedFunc), 699 /* 218 */ SyscallDesc("osf_signal", unimplementedFunc), 700 /* 219 */ SyscallDesc("osf_utc_gettime", unimplementedFunc), 701 /* 220 */ SyscallDesc("osf_utc_adjtime", unimplementedFunc), 702 /* 221 */ SyscallDesc("unknown #221", unimplementedFunc), 703 /* 222 */ SyscallDesc("osf_security", unimplementedFunc), 704 /* 223 */ SyscallDesc("osf_kloadcall", unimplementedFunc), 705 /* 224 */ SyscallDesc("unknown #224", unimplementedFunc), 706 /* 225 */ SyscallDesc("unknown #225", unimplementedFunc), 707 /* 226 */ SyscallDesc("unknown #226", unimplementedFunc), 708 /* 227 */ SyscallDesc("unknown #227", unimplementedFunc), 709 /* 228 */ SyscallDesc("unknown #228", unimplementedFunc), 710 /* 229 */ SyscallDesc("unknown #229", unimplementedFunc), 711 /* 230 */ SyscallDesc("unknown #230", unimplementedFunc), 712 /* 231 */ SyscallDesc("unknown #231", unimplementedFunc), 713 /* 232 */ SyscallDesc("unknown #232", unimplementedFunc), 714 /* 233 */ SyscallDesc("getpgid", unimplementedFunc), 715 /* 234 */ SyscallDesc("getsid", unimplementedFunc), 716 /* 235 */ SyscallDesc("sigaltstack", ignoreFunc), 717 /* 236 */ SyscallDesc("osf_waitid", unimplementedFunc), 718 /* 237 */ SyscallDesc("osf_priocntlset", unimplementedFunc), 719 /* 238 */ SyscallDesc("osf_sigsendset", unimplementedFunc), 720 /* 239 */ SyscallDesc("osf_set_speculative", unimplementedFunc), 721 /* 240 */ SyscallDesc("osf_msfs_syscall", unimplementedFunc), 722 /* 241 */ SyscallDesc("osf_sysinfo", unimplementedFunc), 723 /* 242 */ SyscallDesc("osf_uadmin", unimplementedFunc), 724 /* 243 */ SyscallDesc("osf_fuser", unimplementedFunc), 725 /* 244 */ SyscallDesc("osf_proplist_syscall", unimplementedFunc), 726 /* 245 */ SyscallDesc("osf_ntp_adjtime", unimplementedFunc), 727 /* 246 */ SyscallDesc("osf_ntp_gettime", unimplementedFunc), 728 /* 247 */ SyscallDesc("osf_pathconf", unimplementedFunc), 729 /* 248 */ SyscallDesc("osf_fpathconf", unimplementedFunc), 730 /* 249 */ SyscallDesc("unknown #249", unimplementedFunc), 731 /* 250 */ SyscallDesc("osf_uswitch", unimplementedFunc), 732 /* 251 */ SyscallDesc("osf_usleep_thread", unimplementedFunc), 733 /* 252 */ SyscallDesc("osf_audcntl", unimplementedFunc), 734 /* 253 */ SyscallDesc("osf_audgen", unimplementedFunc), 735 /* 254 */ SyscallDesc("sysfs", unimplementedFunc), 736 /* 255 */ SyscallDesc("osf_subsys_info", unimplementedFunc), 737 /* 256 */ SyscallDesc("osf_getsysinfo", osf_getsysinfoFunc), 738 /* 257 */ SyscallDesc("osf_setsysinfo", osf_setsysinfoFunc), 739 /* 258 */ SyscallDesc("osf_afs_syscall", unimplementedFunc), 740 /* 259 */ SyscallDesc("osf_swapctl", unimplementedFunc), 741 /* 260 */ SyscallDesc("osf_memcntl", unimplementedFunc), 742 /* 261 */ SyscallDesc("osf_fdatasync", unimplementedFunc), 743 /* 262 */ SyscallDesc("unknown #262", unimplementedFunc), 744 /* 263 */ SyscallDesc("unknown #263", unimplementedFunc), 745 /* 264 */ SyscallDesc("unknown #264", unimplementedFunc), 746 /* 265 */ SyscallDesc("unknown #265", unimplementedFunc), 747 /* 266 */ SyscallDesc("unknown #266", unimplementedFunc), 748 /* 267 */ SyscallDesc("unknown #267", unimplementedFunc), 749 /* 268 */ SyscallDesc("unknown #268", unimplementedFunc), 750 /* 269 */ SyscallDesc("unknown #269", unimplementedFunc), 751 /* 270 */ SyscallDesc("unknown #270", unimplementedFunc), 752 /* 271 */ SyscallDesc("unknown #271", unimplementedFunc), 753 /* 272 */ SyscallDesc("unknown #272", unimplementedFunc), 754 /* 273 */ SyscallDesc("unknown #273", unimplementedFunc), 755 /* 274 */ SyscallDesc("unknown #274", unimplementedFunc), 756 /* 275 */ SyscallDesc("unknown #275", unimplementedFunc), 757 /* 276 */ SyscallDesc("unknown #276", unimplementedFunc), 758 /* 277 */ SyscallDesc("unknown #277", unimplementedFunc), 759 /* 278 */ SyscallDesc("unknown #278", unimplementedFunc), 760 /* 279 */ SyscallDesc("unknown #279", unimplementedFunc), 761 /* 280 */ SyscallDesc("unknown #280", unimplementedFunc), 762 /* 281 */ SyscallDesc("unknown #281", unimplementedFunc), 763 /* 282 */ SyscallDesc("unknown #282", unimplementedFunc), 764 /* 283 */ SyscallDesc("unknown #283", unimplementedFunc), 765 /* 284 */ SyscallDesc("unknown #284", unimplementedFunc), 766 /* 285 */ SyscallDesc("unknown #285", unimplementedFunc), 767 /* 286 */ SyscallDesc("unknown #286", unimplementedFunc), 768 /* 287 */ SyscallDesc("unknown #287", unimplementedFunc), 769 /* 288 */ SyscallDesc("unknown #288", unimplementedFunc), 770 /* 289 */ SyscallDesc("unknown #289", unimplementedFunc), 771 /* 290 */ SyscallDesc("unknown #290", unimplementedFunc), 772 /* 291 */ SyscallDesc("unknown #291", unimplementedFunc), 773 /* 292 */ SyscallDesc("unknown #292", unimplementedFunc), 774 /* 293 */ SyscallDesc("unknown #293", unimplementedFunc), 775 /* 294 */ SyscallDesc("unknown #294", unimplementedFunc), 776 /* 295 */ SyscallDesc("unknown #295", unimplementedFunc), 777 /* 296 */ SyscallDesc("unknown #296", unimplementedFunc), 778 /* 297 */ SyscallDesc("unknown #297", unimplementedFunc), 779 /* 298 */ SyscallDesc("unknown #298", unimplementedFunc), 780 /* 299 */ SyscallDesc("unknown #299", unimplementedFunc), 781/* 782 * Linux-specific system calls begin at 300 783 */ 784 /* 300 */ SyscallDesc("bdflush", unimplementedFunc), 785 /* 301 */ SyscallDesc("sethae", unimplementedFunc), 786 /* 302 */ SyscallDesc("mount", unimplementedFunc), 787 /* 303 */ SyscallDesc("old_adjtimex", unimplementedFunc), 788 /* 304 */ SyscallDesc("swapoff", unimplementedFunc), 789 /* 305 */ SyscallDesc("getdents", unimplementedFunc), 790 /* 306 */ SyscallDesc("create_module", unimplementedFunc), 791 /* 307 */ SyscallDesc("init_module", unimplementedFunc), 792 /* 308 */ SyscallDesc("delete_module", unimplementedFunc), 793 /* 309 */ SyscallDesc("get_kernel_syms", unimplementedFunc), 794 /* 310 */ SyscallDesc("syslog", unimplementedFunc), 795 /* 311 */ SyscallDesc("reboot", unimplementedFunc), 796 /* 312 */ SyscallDesc("clone", unimplementedFunc), 797 /* 313 */ SyscallDesc("uselib", unimplementedFunc), 798 /* 314 */ SyscallDesc("mlock", unimplementedFunc), 799 /* 315 */ SyscallDesc("munlock", unimplementedFunc), 800 /* 316 */ SyscallDesc("mlockall", unimplementedFunc), 801 /* 317 */ SyscallDesc("munlockall", unimplementedFunc), 802 /* 318 */ SyscallDesc("sysinfo", unimplementedFunc), 803 /* 319 */ SyscallDesc("_sysctl", unimplementedFunc), 804 /* 320 */ SyscallDesc("was sys_idle", unimplementedFunc), 805 /* 321 */ SyscallDesc("oldumount", unimplementedFunc), 806 /* 322 */ SyscallDesc("swapon", unimplementedFunc), 807 /* 323 */ SyscallDesc("times", ignoreFunc), 808 /* 324 */ SyscallDesc("personality", unimplementedFunc), 809 /* 325 */ SyscallDesc("setfsuid", unimplementedFunc), 810 /* 326 */ SyscallDesc("setfsgid", unimplementedFunc), 811 /* 327 */ SyscallDesc("ustat", unimplementedFunc), 812 /* 328 */ SyscallDesc("statfs", unimplementedFunc), 813 /* 329 */ SyscallDesc("fstatfs", unimplementedFunc), 814 /* 330 */ SyscallDesc("sched_setparam", unimplementedFunc), 815 /* 331 */ SyscallDesc("sched_getparam", unimplementedFunc), 816 /* 332 */ SyscallDesc("sched_setscheduler", unimplementedFunc), 817 /* 333 */ SyscallDesc("sched_getscheduler", unimplementedFunc), 818 /* 334 */ SyscallDesc("sched_yield", unimplementedFunc), 819 /* 335 */ SyscallDesc("sched_get_priority_max", unimplementedFunc), 820 /* 336 */ SyscallDesc("sched_get_priority_min", unimplementedFunc), 821 /* 337 */ SyscallDesc("sched_rr_get_interval", unimplementedFunc), 822 /* 338 */ SyscallDesc("afs_syscall", unimplementedFunc), 823 /* 339 */ SyscallDesc("uname", unameFunc), 824 /* 340 */ SyscallDesc("nanosleep", unimplementedFunc), 825 /* 341 */ SyscallDesc("mremap", unimplementedFunc), 826 /* 342 */ SyscallDesc("nfsservctl", unimplementedFunc), 827 /* 343 */ SyscallDesc("setresuid", unimplementedFunc), 828 /* 344 */ SyscallDesc("getresuid", unimplementedFunc), 829 /* 345 */ SyscallDesc("pciconfig_read", unimplementedFunc), 830 /* 346 */ SyscallDesc("pciconfig_write", unimplementedFunc), 831 /* 347 */ SyscallDesc("query_module", unimplementedFunc), 832 /* 348 */ SyscallDesc("prctl", unimplementedFunc), 833 /* 349 */ SyscallDesc("pread", unimplementedFunc), 834 /* 350 */ SyscallDesc("pwrite", unimplementedFunc), 835 /* 351 */ SyscallDesc("rt_sigreturn", unimplementedFunc), 836 /* 352 */ SyscallDesc("rt_sigaction", ignoreFunc), 837 /* 353 */ SyscallDesc("rt_sigprocmask", unimplementedFunc), 838 /* 354 */ SyscallDesc("rt_sigpending", unimplementedFunc), 839 /* 355 */ SyscallDesc("rt_sigtimedwait", unimplementedFunc), 840 /* 356 */ SyscallDesc("rt_sigqueueinfo", unimplementedFunc), 841 /* 357 */ SyscallDesc("rt_sigsuspend", unimplementedFunc), 842 /* 358 */ SyscallDesc("select", unimplementedFunc), 843 /* 359 */ SyscallDesc("gettimeofday", gettimeofdayFunc<Linux>), 844 /* 360 */ SyscallDesc("settimeofday", unimplementedFunc), 845 /* 361 */ SyscallDesc("getitimer", unimplementedFunc), 846 /* 362 */ SyscallDesc("setitimer", unimplementedFunc), 847 /* 363 */ SyscallDesc("utimes", utimesFunc<Linux>), 848 /* 364 */ SyscallDesc("getrusage", getrusageFunc<Linux>), 849 /* 365 */ SyscallDesc("wait4", unimplementedFunc), 850 /* 366 */ SyscallDesc("adjtimex", unimplementedFunc), 851 /* 367 */ SyscallDesc("getcwd", unimplementedFunc), 852 /* 368 */ SyscallDesc("capget", unimplementedFunc), 853 /* 369 */ SyscallDesc("capset", unimplementedFunc), 854 /* 370 */ SyscallDesc("sendfile", unimplementedFunc), 855 /* 371 */ SyscallDesc("setresgid", unimplementedFunc), 856 /* 372 */ SyscallDesc("getresgid", unimplementedFunc), 857 /* 373 */ SyscallDesc("dipc", unimplementedFunc), 858 /* 374 */ SyscallDesc("pivot_root", unimplementedFunc), 859 /* 375 */ SyscallDesc("mincore", unimplementedFunc), 860 /* 376 */ SyscallDesc("pciconfig_iobase", unimplementedFunc), 861 /* 377 */ SyscallDesc("getdents64", unimplementedFunc), 862 /* 378 */ SyscallDesc("gettid", unimplementedFunc), 863 /* 379 */ SyscallDesc("readahead", unimplementedFunc), 864 /* 380 */ SyscallDesc("security", unimplementedFunc), 865 /* 381 */ SyscallDesc("tkill", unimplementedFunc), 866 /* 382 */ SyscallDesc("setxattr", unimplementedFunc), 867 /* 383 */ SyscallDesc("lsetxattr", unimplementedFunc), 868 /* 384 */ SyscallDesc("fsetxattr", unimplementedFunc), 869 /* 385 */ SyscallDesc("getxattr", unimplementedFunc), 870 /* 386 */ SyscallDesc("lgetxattr", unimplementedFunc), 871 /* 387 */ SyscallDesc("fgetxattr", unimplementedFunc), 872 /* 388 */ SyscallDesc("listxattr", unimplementedFunc), 873 /* 389 */ SyscallDesc("llistxattr", unimplementedFunc), 874 /* 390 */ SyscallDesc("flistxattr", unimplementedFunc), 875 /* 391 */ SyscallDesc("removexattr", unimplementedFunc), 876 /* 392 */ SyscallDesc("lremovexattr", unimplementedFunc), 877 /* 393 */ SyscallDesc("fremovexattr", unimplementedFunc), 878 /* 394 */ SyscallDesc("futex", unimplementedFunc), 879 /* 395 */ SyscallDesc("sched_setaffinity", unimplementedFunc), 880 /* 396 */ SyscallDesc("sched_getaffinity", unimplementedFunc), 881 /* 397 */ SyscallDesc("tuxcall", unimplementedFunc), 882 /* 398 */ SyscallDesc("io_setup", unimplementedFunc), 883 /* 399 */ SyscallDesc("io_destroy", unimplementedFunc), 884 /* 400 */ SyscallDesc("io_getevents", unimplementedFunc), 885 /* 401 */ SyscallDesc("io_submit", unimplementedFunc), 886 /* 402 */ SyscallDesc("io_cancel", unimplementedFunc), 887 /* 403 */ SyscallDesc("unknown #403", unimplementedFunc), 888 /* 404 */ SyscallDesc("unknown #404", unimplementedFunc), 889 /* 405 */ SyscallDesc("exit_group", exitFunc), // exit all threads... 890 /* 406 */ SyscallDesc("lookup_dcookie", unimplementedFunc), 891 /* 407 */ SyscallDesc("sys_epoll_create", unimplementedFunc), 892 /* 408 */ SyscallDesc("sys_epoll_ctl", unimplementedFunc), 893 /* 409 */ SyscallDesc("sys_epoll_wait", unimplementedFunc), 894 /* 410 */ SyscallDesc("remap_file_pages", unimplementedFunc), 895 /* 411 */ SyscallDesc("set_tid_address", unimplementedFunc), 896 /* 412 */ SyscallDesc("restart_syscall", unimplementedFunc), 897 /* 413 */ SyscallDesc("fadvise64", unimplementedFunc), 898 /* 414 */ SyscallDesc("timer_create", unimplementedFunc), 899 /* 415 */ SyscallDesc("timer_settime", unimplementedFunc), 900 /* 416 */ SyscallDesc("timer_gettime", unimplementedFunc), 901 /* 417 */ SyscallDesc("timer_getoverrun", unimplementedFunc), 902 /* 418 */ SyscallDesc("timer_delete", unimplementedFunc), 903 /* 419 */ SyscallDesc("clock_settime", unimplementedFunc), 904 /* 420 */ SyscallDesc("clock_gettime", unimplementedFunc), 905 /* 421 */ SyscallDesc("clock_getres", unimplementedFunc), 906 /* 422 */ SyscallDesc("clock_nanosleep", unimplementedFunc), 907 /* 423 */ SyscallDesc("semtimedop", unimplementedFunc), 908 /* 424 */ SyscallDesc("tgkill", unimplementedFunc), 909 /* 425 */ SyscallDesc("stat64", unimplementedFunc), 910 /* 426 */ SyscallDesc("lstat64", lstat64Func<Linux>), 911 /* 427 */ SyscallDesc("fstat64", fstat64Func<Linux>), 912 /* 428 */ SyscallDesc("vserver", unimplementedFunc), 913 /* 429 */ SyscallDesc("mbind", unimplementedFunc), 914 /* 430 */ SyscallDesc("get_mempolicy", unimplementedFunc), 915 /* 431 */ SyscallDesc("set_mempolicy", unimplementedFunc), 916 /* 432 */ SyscallDesc("mq_open", unimplementedFunc), 917 /* 433 */ SyscallDesc("mq_unlink", unimplementedFunc), 918 /* 434 */ SyscallDesc("mq_timedsend", unimplementedFunc), 919 /* 435 */ SyscallDesc("mq_timedreceive", unimplementedFunc), 920 /* 436 */ SyscallDesc("mq_notify", unimplementedFunc), 921 /* 437 */ SyscallDesc("mq_getsetattr", unimplementedFunc), 922 /* 438 */ SyscallDesc("waitid", unimplementedFunc), 923 /* 439 */ SyscallDesc("add_key", unimplementedFunc), 924 /* 440 */ SyscallDesc("request_key", unimplementedFunc), 925 /* 441 */ SyscallDesc("keyctl", unimplementedFunc) 926}; 927 928const int Linux::Num_Syscall_Descs = 929 sizeof(Linux::syscallDescs) / sizeof(SyscallDesc); 930 931const int Linux::Max_Syscall_Desc = Linux::Num_Syscall_Descs - 1; 932 933 934void 935AlphaLinuxProcess::syscall(ExecContext *xc) 936{ 937 num_syscalls++; 938 939 int64_t callnum = xc->regs.intRegFile[ReturnValueReg]; 940 941 Linux::doSyscall(callnum, this, xc); 942} 943 944 945AlphaLinuxProcess::AlphaLinuxProcess(const std::string &name, 946 ObjectFile *objFile, 947 int stdin_fd, 948 int stdout_fd, 949 int stderr_fd, 950 std::vector<std::string> &argv, 951 std::vector<std::string> &envp) 952 : LiveProcess(name, objFile, stdin_fd, stdout_fd, stderr_fd, argv, envp) 953{ 954 init_regs->intRegFile[0] = 0; 955} 956