Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Nov 1996 22:52:56 +0100 (MET)
From:      Mattias Karlsson <Mattias.Karlsson@sdf.se>
To:        scrappy@ki.net (Marc G. Fournier)
Cc:        hackers@freefall.freebsd.org
Subject:   Re: Hate to ask more about sockets...but...
Message-ID:  <199611172152.WAA19161@what.sdf.se>
In-Reply-To: <Pine.NEB.3.95.961116144609.7019A-100000@quagmire.ki.net> from "Marc G. Fournier" at Nov 16, 96 03:13:04 pm

next in thread | previous in thread | raw e-mail | index | archive | help


>     if( (fd = open(TESTFILE, O_RDONLY)) != -1) {
>       fstat(fd, &fi); 
>       fp = mmap(NULL, fi.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
>       if(fp == (caddr_t) -1) {
>         fprintf(stderr, "MMAP() failed\n");
>         exit(1);
>       }
>       close(fd);
>       while(cnt-- != 0) { /* set to 1 for initial test */
>         start = time(0);
>         nwritten = write(newsockfd, START, strlen(START));

Does this file you are trying to send contain NULL chars? in that case you 
probably have the problem here ... then the strlen call only return to the 
number of bytes to the NULL char ..

/Matte



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611172152.WAA19161>