syscall_emul.cc (3079:13d9c24a7bba) syscall_emul.cc (3112:76b70de314b6)
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;

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

409SyscallReturn
410getpidPseudoFunc(SyscallDesc *desc, int callnum, Process *process,
411 ThreadContext *tc)
412{
413 // Make up a PID. There's no interprocess communication in
414 // fake_syscall mode, so there's no way for a process to know it's
415 // not getting a unique value.
416
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;

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

409SyscallReturn
410getpidPseudoFunc(SyscallDesc *desc, int callnum, Process *process,
411 ThreadContext *tc)
412{
413 // Make up a PID. There's no interprocess communication in
414 // fake_syscall mode, so there's no way for a process to know it's
415 // not getting a unique value.
416
417 tc->setIntReg(SyscallPseudoReturnReg, 99);
418 return 100;
417 tc->setIntReg(SyscallPseudoReturnReg, process->ppid);
418 return process->pid;
419}
420
421
422SyscallReturn
423getuidPseudoFunc(SyscallDesc *desc, int callnum, Process *process,
424 ThreadContext *tc)
425{
426 // Make up a UID and EUID... it shouldn't matter, and we want the
427 // simulation to be deterministic.
428
429 // EUID goes in r20.
419}
420
421
422SyscallReturn
423getuidPseudoFunc(SyscallDesc *desc, int callnum, Process *process,
424 ThreadContext *tc)
425{
426 // Make up a UID and EUID... it shouldn't matter, and we want the
427 // simulation to be deterministic.
428
429 // EUID goes in r20.
430 tc->setIntReg(SyscallPseudoReturnReg, 100); //EUID
431 return 100; // UID
430 tc->setIntReg(SyscallPseudoReturnReg, process->euid); //EUID
431 return process->uid; // UID
432}
433
434
435SyscallReturn
436getgidPseudoFunc(SyscallDesc *desc, int callnum, Process *process,
437 ThreadContext *tc)
438{
439 // Get current group ID. EGID goes in r20.
432}
433
434
435SyscallReturn
436getgidPseudoFunc(SyscallDesc *desc, int callnum, Process *process,
437 ThreadContext *tc)
438{
439 // Get current group ID. EGID goes in r20.
440 tc->setIntReg(SyscallPseudoReturnReg, 100); //EGID
441 return 100;
440 tc->setIntReg(SyscallPseudoReturnReg, process->egid); //EGID
441 return process->gid;
442}
443
444
445SyscallReturn
446setuidFunc(SyscallDesc *desc, int callnum, Process *process,
447 ThreadContext *tc)
448{
449 // can't fathom why a benchmark would call this.

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

454SyscallReturn
455getpidFunc(SyscallDesc *desc, int callnum, Process *process,
456 ThreadContext *tc)
457{
458 // Make up a PID. There's no interprocess communication in
459 // fake_syscall mode, so there's no way for a process to know it's
460 // not getting a unique value.
461
442}
443
444
445SyscallReturn
446setuidFunc(SyscallDesc *desc, int callnum, Process *process,
447 ThreadContext *tc)
448{
449 // can't fathom why a benchmark would call this.

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

454SyscallReturn
455getpidFunc(SyscallDesc *desc, int callnum, Process *process,
456 ThreadContext *tc)
457{
458 // Make up a PID. There's no interprocess communication in
459 // fake_syscall mode, so there's no way for a process to know it's
460 // not getting a unique value.
461
462 tc->setIntReg(SyscallPseudoReturnReg, 99); //PID
463 return 100;
462 tc->setIntReg(SyscallPseudoReturnReg, process->ppid); //PID
463 return process->pid;
464}
465
466SyscallReturn
467getppidFunc(SyscallDesc *desc, int callnum, Process *process,
468 ThreadContext *tc)
469{
464}
465
466SyscallReturn
467getppidFunc(SyscallDesc *desc, int callnum, Process *process,
468 ThreadContext *tc)
469{
470 return 99;
470 return process->ppid;
471}
472
473SyscallReturn
474getuidFunc(SyscallDesc *desc, int callnum, Process *process,
475 ThreadContext *tc)
476{
471}
472
473SyscallReturn
474getuidFunc(SyscallDesc *desc, int callnum, Process *process,
475 ThreadContext *tc)
476{
477 return 100; // UID
477 return process->uid; // UID
478}
479
480SyscallReturn
481geteuidFunc(SyscallDesc *desc, int callnum, Process *process,
482 ThreadContext *tc)
483{
478}
479
480SyscallReturn
481geteuidFunc(SyscallDesc *desc, int callnum, Process *process,
482 ThreadContext *tc)
483{
484 return 100; // UID
484 return process->euid; // UID
485}
486
487SyscallReturn
488getgidFunc(SyscallDesc *desc, int callnum, Process *process,
489 ThreadContext *tc)
490{
485}
486
487SyscallReturn
488getgidFunc(SyscallDesc *desc, int callnum, Process *process,
489 ThreadContext *tc)
490{
491 return 100;
491 return process->gid;
492}
493
494SyscallReturn
495getegidFunc(SyscallDesc *desc, int callnum, Process *process,
496 ThreadContext *tc)
497{
492}
493
494SyscallReturn
495getegidFunc(SyscallDesc *desc, int callnum, Process *process,
496 ThreadContext *tc)
497{
498 return 100;
498 return process->egid;
499}
500
501
499}
500
501