syscall_emul.cc (11140:cf07f8bf58db) | syscall_emul.cc (11379:bfe4c2a8ad36) |
---|---|
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; --- 292 unchanged lines hidden (view full) --- 301 if (sim_fd < 0) 302 return -EBADF; 303 304 uint64_t offset = (offset_high << 32) | offset_low; 305 306 uint64_t result = lseek(sim_fd, offset, whence); 307 result = TheISA::htog(result); 308 | 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; --- 292 unchanged lines hidden (view full) --- 301 if (sim_fd < 0) 302 return -EBADF; 303 304 uint64_t offset = (offset_high << 32) | offset_low; 305 306 uint64_t result = lseek(sim_fd, offset, whence); 307 result = TheISA::htog(result); 308 |
309 if (result == (off_t)-1) { 310 //The seek failed. | 309 if (result == (off_t)-1) |
311 return -errno; | 310 return -errno; |
312 } else { 313 // The seek succeeded. 314 // Copy "result" to "result_ptr" 315 // XXX We'll assume that the size of loff_t is 64 bits on the 316 // target platform 317 BufferArg result_buf(result_ptr, sizeof(result)); 318 memcpy(result_buf.bufferPtr(), &result, sizeof(result)); 319 result_buf.copyOut(tc->getMemProxy()); 320 return 0; 321 } | 311 // Assuming that the size of loff_t is 64 bits on the target platform 312 BufferArg result_buf(result_ptr, sizeof(result)); 313 memcpy(result_buf.bufferPtr(), &result, sizeof(result)); 314 result_buf.copyOut(tc->getMemProxy()); 315 return 0; |
322} 323 324 325SyscallReturn 326munmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) 327{ 328 // given that we don't really implement mmap, munmap is really easy 329 return 0; --- 629 unchanged lines hidden --- | 316} 317 318 319SyscallReturn 320munmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) 321{ 322 // given that we don't really implement mmap, munmap is really easy 323 return 0; --- 629 unchanged lines hidden --- |