Where in the world is ::close ( socket/fd ) defined ?

Nibbie
Posts: 1
Joined: 2009.07
Post: #1
On the iPhone SDK, Which framework should I include in order to include a header that declares the ::close ?

(I need to close function to close a TCP socket.)


Ive tried the following but the compiler complains that close is not declared Annoyed
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <netinet/in.h>
#include <netdb.h>
void test() {
::close( 0 );
}


Any clues to what im missing here ? Huh
Quote this message in a reply
Moderator
Posts: 1,562
Joined: 2003.10
Post: #2
It's in unistd.h. However, I don't see an #ifdef __cplusplus extern "C" { #endif in that file, so you may need to wrap the #include in one yourself if you really need to include it from C++ code.
Quote this message in a reply
Post Reply