syscall_emul.cc (2680:246e7104f744) syscall_emul.cc (2687:9721a59675b8)
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;

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

336
337 default:
338 warn("Unknown fcntl command %d\n", cmd);
339 return 0;
340 }
341}
342
343SyscallReturn
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;

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

336
337 default:
338 warn("Unknown fcntl command %d\n", cmd);
339 return 0;
340 }
341}
342
343SyscallReturn
344fcntl64Func(SyscallDesc *desc, int num, Process *process,
345 ThreadContext *tc)
346{
347 int fd = tc->getSyscallArg(0);
348
349 if (fd < 0 || process->sim_fd(fd) < 0)
350 return -EBADF;
351
352 int cmd = tc->getSyscallArg(1);
353 switch (cmd) {
354 case 33: //F_GETLK64
355 warn("fcntl64(%d, F_GETLK64) not supported, error returned\n", fd);
356 return -EMFILE;
357
358 case 34: // F_SETLK64
359 case 35: // F_SETLKW64
360 warn("fcntl64(%d, F_SETLK(W)64) not supported, error returned\n", fd);
361 return -EMFILE;
362
363 default:
364 // not sure if this is totally valid, but we'll pass it through
365 // to the underlying OS
366 warn("fcntl64(%d, %d) passed through to host\n", fd, cmd);
367 return fcntl(process->sim_fd(fd), cmd);
368 // return 0;
369 }
370}
371
372SyscallReturn
344pipePseudoFunc(SyscallDesc *desc, int callnum, Process *process,
345 ThreadContext *tc)
346{
347 int fds[2], sim_fds[2];
348 int pipe_retval = pipe(fds);
349
350 if (pipe_retval < 0) {
351 // error

--- 106 unchanged lines hidden ---
373pipePseudoFunc(SyscallDesc *desc, int callnum, Process *process,
374 ThreadContext *tc)
375{
376 int fds[2], sim_fds[2];
377 int pipe_retval = pipe(fds);
378
379 if (pipe_retval < 0) {
380 // error

--- 106 unchanged lines hidden ---