source: trunk/IPs/systemC/hierarchy_memory/sim2os/service/service_close.h @ 81

Last change on this file since 81 was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
  • Property svn:keywords set to Id
File size: 883 bytes
Line 
1#ifndef SERVICE_CLOSE_H
2#define SERVICE_CLOSE_H
3
4#include "../sim2os.h"
5
6namespace hierarchy_memory {
7  namespace sim2os {
8
9    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[ service_close ]~~~~~
10    void *
11    Sim2os ::
12    service_close ()
13    {
14      if (have_all_arguments(1) == false)
15        {
16          cerr << "<" << NAME << "> Usage : int close(int fd);" << endl;
17          return NULL;
18        }
19 
20      int         fd       = (int)          arguments[1];
21      void *      result   = (void *)       close(fd);
22      error                = errno;
23
24      cout << "\n\t***** service : close         *****" << endl;
25      cout << "\tfd        : " << (unsigned int) fd     << endl;
26      cout << "\tresult    : " << (unsigned int) result << endl;
27      cout << "\terrno     : " << (unsigned int) error  << endl;
28
29      return      result;
30    }
31
32  };};
33#endif //!SERVICE_CLOSE_H
Note: See TracBrowser for help on using the repository browser.