udp support
[nestedvm.git] / upstream / misc / extraheaders.sh
index 17d2612..7550e07 100755 (executable)
@@ -1,13 +1,14 @@
+
 #!/bin/sh -e
 
 mkdir -p arpa netinet sys nestedvm
 
 for f in arpa/inet.h netdb.h netinet/in.h sys/socket.h; do
-    test -e $f || echo "#include <nestedvm/socket.h>" > $f
+    test -f $f || echo "#include <nestedvm/socket.h>" > $f
 done
 
 for f in getopt.h; do
-    test -e $f || echo "#include <unistd.h>" > $f
+    test -f $f || echo "#include <unistd.h>" > $f
 done
 
 cat <<__EOF__ > sys/ioctl.h
@@ -369,6 +370,7 @@ cat <<__EOF__ > nestedvm/socket.h
 #define __NESTEDVM_SOCKETS_H
 
 #include <sys/types.h>
+#include <sys/time.h>
 
 static unsigned short htons(int x) { return x; }
 static unsigned long htonl(int x) { return x; }
@@ -444,6 +446,9 @@ int accept(int s, struct sockaddr *addr, socklen_t *addrlen);
 int shutdown(int s, int how);
 int connect(int s, const struct sockaddr *name, socklen_t namelen);
 char *inet_ntoa(struct in_addr in);
+int recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen);
+int sendto(int s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen);
+int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
 
 int getsockopt(int s, int level, int name, void *val, socklen_t *len);
 int setsockopt(int s, int level, int name, const void *val, socklen_t len);