#include <unistd.h>
#include <iostream>
// w/o the following errno is not defined
#include <errno.h>
using namespace std;

int main()
{
    int file_descriptor = 42;  // this is NOT a valid file descriptor

    int result = close(file_descriptor);

    cout << "result = " << result << endl;

    cout << "errno = " << errno << endl;

    cout << strerror(errno) << endl;

    perror("call to close() failed");

}

