Last change
on this file since 102 was
88,
checked in by rosiere, 16 years ago
|
Almost complete design
with Test and test platform
|
-
Property svn:keywords set to
Id
|
File size:
1.2 KB
|
Rev | Line | |
---|
[81] | 1 | #include "../include/Sim2OS.h" |
---|
| 2 | |
---|
| 3 | namespace environment { |
---|
| 4 | namespace sim2os { |
---|
| 5 | |
---|
| 6 | void * Sim2OS::service_lseek (void) |
---|
| 7 | { |
---|
| 8 | if (have_all_arguments(3) == false) |
---|
| 9 | { |
---|
| 10 | std::cerr << "<" << name << "> Usage : off_t lseek(int fildes, off_t offset, int whence);" << std::endl; |
---|
| 11 | return NULL; |
---|
| 12 | } |
---|
| 13 | |
---|
[88] | 14 | int flides = static_cast<int >(reinterpret_cast<int64_t>(arguments[1])); |
---|
| 15 | off_t offset = static_cast<off_t>(reinterpret_cast<int64_t>(arguments[2])); |
---|
| 16 | int whence = static_cast<int >(reinterpret_cast<int64_t>(arguments[3])); |
---|
[81] | 17 | void * result = (void *) lseek(flides,offset,whence); |
---|
| 18 | error = errno; |
---|
| 19 | |
---|
| 20 | // No swap -> because no access memory |
---|
| 21 | |
---|
| 22 | std::cout << "\n\t***** service : lseek *****" << std::endl; |
---|
| 23 | std::cout << "\tflides : " << (unsigned int) flides << std::endl; |
---|
| 24 | std::cout << "\toffset : " << (unsigned int) offset << std::endl; |
---|
| 25 | std::cout << "\twhence : " << (unsigned int) whence << std::endl; |
---|
[88] | 26 | std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; |
---|
[81] | 27 | std::cout << "\terrno : " << (unsigned int) error << std::endl; |
---|
| 28 | |
---|
| 29 | return result; |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | }; |
---|
| 33 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.