Lee Chin wrote: > How do I tell if a file descriptor is a socket or not in C? Use fstat(), e.g. struct stat st; if (fstat(fd, st) < 0) { perror("fstat"); exit(1); } if (S_ISSOCK(st.st_mode)) ... -- Glynn Clements <glynn.clements@virgin.net> - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org