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

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

Import Morpheo

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.