source: trunk/IPs/systemC/hierarchy_memory/sim2os/service/service_lseek.h @ 2

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 1.2 KB
Line 
1#ifndef SERVICE_LSEEK_H
2#define SERVICE_LSEEK_H
3
4#include "../sim2os.h"
5
6namespace hierarchy_memory {
7  namespace sim2os {
8
9    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[ service_lseek ]~~~~~
10    void *
11    Sim2os ::
12    service_lseek ()
13    {
14      if (have_all_arguments(3) == false)
15        {
16          cerr << "<" << NAME << "> Usage : off_t lseek(int fildes, off_t offset, int whence);" << endl;
17          return NULL;
18        }
19 
20      int         flides   = (int)    arguments[1];
21      off_t       offset   = (off_t)  arguments[2];
22      int         whence   = (int)    arguments[3];
23      void *      result   = (void *) lseek(flides,offset,whence);
24      error                = errno;
25 
26      // No swap -> because no access memory
27
28      cout << "\n\t***** service : lseek         *****"        << endl;
29      cout << "\tflides    : " << (unsigned int) flides << endl;
30      cout << "\toffset    : " << (unsigned int) offset << endl;
31      cout << "\twhence    : " << (unsigned int) whence << endl;
32      cout << "\tresult    : " << (unsigned int) result << endl;
33      cout << "\terrno     : " << (unsigned int) error  << endl;
34
35      return      result;
36    }
37
38  };};
39#endif //SERVICE_LSEEK_H
Note: See TracBrowser for help on using the repository browser.