+void *NetTest_OpenUnix(const char *Path)
+{
+ int fd = socket(AF_UNIX, SOCK_DGRAM, 0);
+ struct sockaddr_un sa = {AF_UNIX, ""};
+ struct sockaddr_un sa_local = {AF_UNIX, ""};
+ strcpy(sa.sun_path, Path);
+ if( connect(fd, (struct sockaddr*)&sa, sizeof(sa)) ) {
+ perror("NetTest_OpenUnix - connect");
+ close(fd);
+ return NULL;
+ }
+ if( bind(fd, (struct sockaddr*)&sa_local, sizeof(sa)) ) {
+ perror("NetTest_OpenUnix - bind");
+ close(fd);
+ return NULL;
+ }
+
+ {
+ char somenulls[] = { 0,0,0,0,0,0, 0,0,0,0,0, 0,0};
+ write(fd, somenulls, sizeof(somenulls));
+ }
+
+ return (void*)(intptr_t)fd;
+}
+