Ok I have this problem which is very simple yet I can't find the solution anywhere.
I have a simple function:
bool MyClass::close(int fd)
{
// code
shutdown(sockFd, 2);
close(sockFd);
//code
}
This function does a lot of work and one of the things it needs to do it shutdown and close a socket with socket descriptor being "sockFd"
The problem is with the
close(sockFd);
call that I make to close the socket and release resources. The problem is that it has the same exact function signature as my function and so what ends up happening is a recursive call to my function rather than a call to the "close()" function to close a socket
I figured I need to somehow differentiate them so I tried using std::close() but close() is not part of that namespace.
So does anyone know where close() is defined so I could do something like "SomeClass::close()"
Oh and by the way I can't just rename my function to something else. Part of my requirements is that my function be called close().
Please if anyone has ideas I would appreciate them.