mirror of /home/gitosis/repositories/libowfat.git
Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat
https://www.fefe.de/libowfat/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
377 B
14 lines
377 B
#include <sys/types.h> |
|
#include <sys/socket.h> |
|
#include <netinet/in.h> |
|
#include "socket.h" |
|
|
|
int socket_accept4(int s,char *ip,uint16 *port) { |
|
struct sockaddr_in si; |
|
unsigned int len = sizeof si; |
|
int fd; |
|
if ((fd=accept(s,(struct sockaddr*) &si,&len))<0) return -1; |
|
*(uint32*)ip = *(uint32*)&si.sin_addr; |
|
uint16_unpack_big((char *) &si.sin_port,port); |
|
return fd; |
|
}
|
|
|