syscall_emul.cc (2834:c8342a71404b) | syscall_emul.cc (3071:12e952ddba98) |
---|---|
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; --- 387 unchanged lines hidden (view full) --- 396SyscallReturn 397getpidPseudoFunc(SyscallDesc *desc, int callnum, Process *process, 398 ThreadContext *tc) 399{ 400 // Make up a PID. There's no interprocess communication in 401 // fake_syscall mode, so there's no way for a process to know it's 402 // not getting a unique value. 403 | 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; --- 387 unchanged lines hidden (view full) --- 396SyscallReturn 397getpidPseudoFunc(SyscallDesc *desc, int callnum, Process *process, 398 ThreadContext *tc) 399{ 400 // Make up a PID. There's no interprocess communication in 401 // fake_syscall mode, so there's no way for a process to know it's 402 // not getting a unique value. 403 |
404 tc->setIntReg(SyscallPseudoReturnReg, 99); 405 return 100; | 404 tc->setIntReg(SyscallPseudoReturnReg, process->ppid); 405 return process->pid; |
406} 407 408 409SyscallReturn 410getuidPseudoFunc(SyscallDesc *desc, int callnum, Process *process, 411 ThreadContext *tc) 412{ 413 // Make up a UID and EUID... it shouldn't matter, and we want the 414 // simulation to be deterministic. 415 416 // EUID goes in r20. | 406} 407 408 409SyscallReturn 410getuidPseudoFunc(SyscallDesc *desc, int callnum, Process *process, 411 ThreadContext *tc) 412{ 413 // Make up a UID and EUID... it shouldn't matter, and we want the 414 // simulation to be deterministic. 415 416 // EUID goes in r20. |
417 tc->setIntReg(SyscallPseudoReturnReg, 100); //EUID 418 return 100; // UID | 417 tc->setIntReg(SyscallPseudoReturnReg, process->euid); //EUID 418 return process->uid; // UID |
419} 420 421 422SyscallReturn 423getgidPseudoFunc(SyscallDesc *desc, int callnum, Process *process, 424 ThreadContext *tc) 425{ 426 // Get current group ID. EGID goes in r20. | 419} 420 421 422SyscallReturn 423getgidPseudoFunc(SyscallDesc *desc, int callnum, Process *process, 424 ThreadContext *tc) 425{ 426 // Get current group ID. EGID goes in r20. |
427 tc->setIntReg(SyscallPseudoReturnReg, 100); //EGID 428 return 100; | 427 tc->setIntReg(SyscallPseudoReturnReg, process->egid); //EGID 428 return process->gid; |
429} 430 431 432SyscallReturn 433setuidFunc(SyscallDesc *desc, int callnum, Process *process, 434 ThreadContext *tc) 435{ 436 // can't fathom why a benchmark would call this. --- 4 unchanged lines hidden (view full) --- 441SyscallReturn 442getpidFunc(SyscallDesc *desc, int callnum, Process *process, 443 ThreadContext *tc) 444{ 445 // Make up a PID. There's no interprocess communication in 446 // fake_syscall mode, so there's no way for a process to know it's 447 // not getting a unique value. 448 | 429} 430 431 432SyscallReturn 433setuidFunc(SyscallDesc *desc, int callnum, Process *process, 434 ThreadContext *tc) 435{ 436 // can't fathom why a benchmark would call this. --- 4 unchanged lines hidden (view full) --- 441SyscallReturn 442getpidFunc(SyscallDesc *desc, int callnum, Process *process, 443 ThreadContext *tc) 444{ 445 // Make up a PID. There's no interprocess communication in 446 // fake_syscall mode, so there's no way for a process to know it's 447 // not getting a unique value. 448 |
449 tc->setIntReg(SyscallPseudoReturnReg, 99); //PID 450 return 100; | 449 tc->setIntReg(SyscallPseudoReturnReg, process->ppid); //PID 450 return process->pid; |
451} 452 453SyscallReturn 454getppidFunc(SyscallDesc *desc, int callnum, Process *process, 455 ThreadContext *tc) 456{ | 451} 452 453SyscallReturn 454getppidFunc(SyscallDesc *desc, int callnum, Process *process, 455 ThreadContext *tc) 456{ |
457 return 99; | 457 return process->ppid; |
458} 459 460SyscallReturn 461getuidFunc(SyscallDesc *desc, int callnum, Process *process, 462 ThreadContext *tc) 463{ | 458} 459 460SyscallReturn 461getuidFunc(SyscallDesc *desc, int callnum, Process *process, 462 ThreadContext *tc) 463{ |
464 return 100; // UID | 464 return process->uid; // UID |
465} 466 467SyscallReturn 468geteuidFunc(SyscallDesc *desc, int callnum, Process *process, 469 ThreadContext *tc) 470{ | 465} 466 467SyscallReturn 468geteuidFunc(SyscallDesc *desc, int callnum, Process *process, 469 ThreadContext *tc) 470{ |
471 return 100; // UID | 471 return process->euid; // UID |
472} 473 474SyscallReturn 475getgidFunc(SyscallDesc *desc, int callnum, Process *process, 476 ThreadContext *tc) 477{ | 472} 473 474SyscallReturn 475getgidFunc(SyscallDesc *desc, int callnum, Process *process, 476 ThreadContext *tc) 477{ |
478 return 100; | 478 return process->gid; |
479} 480 481SyscallReturn 482getegidFunc(SyscallDesc *desc, int callnum, Process *process, 483 ThreadContext *tc) 484{ | 479} 480 481SyscallReturn 482getegidFunc(SyscallDesc *desc, int callnum, Process *process, 483 ThreadContext *tc) 484{ |
485 return 100; | 485 return process->egid; |
486} 487 488 | 486} 487 488 |