libowfat/socket/socket_connected.c

12 lines
205 B
C
Raw Normal View History

2001-02-05 17:50:19 +00:00
#include <sys/socket.h>
#include <netinet/in.h>
#include "socket.h"
int socket_connected(int s) {
struct sockaddr si;
socklen_t sl=sizeof si;
if (getpeername(s,&si,&sl))
return 0;
return 1;
}