Rev | Line | |
---|
[2] | 1 | #ifndef SERVICE_CLOSE_H |
---|
| 2 | #define SERVICE_CLOSE_H |
---|
| 3 | |
---|
| 4 | #include "../sim2os.h" |
---|
| 5 | |
---|
| 6 | namespace 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.