Deleted Added
sdiff udiff text old ( 9112:6e854ea87bab ) new ( 9141:593fe25c86a6 )
full compact
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;

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

562 typedef TypedBufferArg<typename OS::tgt_stat64> tgt_stat_buf;
563 tgt_stat_buf tgt(addr);
564 convertStat64Buf<tgt_stat_buf, hst_stat64>(tgt, host, fakeTTY);
565 tgt.copyOut(mem);
566}
567
568/// Target ioctl() handler. For the most part, programs call ioctl()
569/// only to find out if their stdout is a tty, to determine whether to
570/// do line or block buffering. We always claim that output fds are
571/// not TTYs to provide repeatable results.
572template <class OS>
573SyscallReturn
574ioctlFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
575 ThreadContext *tc)
576{
577 int index = 0;
578 int fd = process->getSyscallArg(tc, index);
579 unsigned req = process->getSyscallArg(tc, index);
580
581 DPRINTF(SyscallVerbose, "ioctl(%d, 0x%x, ...)\n", fd, req);
582
583 if (fd < 0 || process->sim_fd(fd) < 0) {
584 // doesn't map to any simulator fd: not a valid target fd
585 return -EBADF;
586 }
587
588 if (OS::isTtyReq(req)) {
589 return -ENOTTY;
590 }
591
592 warn("Unsupported ioctl call: ioctl(%d, 0x%x, ...) @ \n",
593 fd, req, tc->pcState());
594 return -ENOTTY;
595}
596
597/// Target open() handler.
598template <class OS>
599SyscallReturn
600openFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
601 ThreadContext *tc)
602{

--- 739 unchanged lines hidden ---