Miscellany
public c v1 · immutableint check_read(int sock, char *name){ char *buf; fprintf(stderr,"sock er %d \n", sock); ssize_t n = read(sock, buf, 4); if (n == -1) perror("check_read: "); if( (strcmp(buf,"HAI")) != 0){ exit(1); //This should hopefully never happen } n = write(sock, "SUP", 4); if (n == -1) perror("write: ");/* printf("We are ready for incomming connections \n"); DEBUG */ return 1;}