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