Date: Sun, 2 Jun 1996 16:29:30 -0700 From: pjf@cts.com (Paul Falstad) To: bde@freebsd.org Cc: hackers@freebsd.org Subject: Re: bugs Message-ID: <9606021629.ZM129@zoof> In-Reply-To: Alex Nash <alex@zen.nash.org> "Re: bugs" (Jun 2, 5:25pm) References: <199606022052.GAA06199@godzilla.zeta.org.au> <199606022225.RAA23224@zen.nash.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans says: | Subject: Re: bugs | The ftruncate() works if a prototype for ftruncate() is in scope or if | the `length' arg to ftruncate has the correct type (off_t = long long). | Otherwise the top 32 bits of the length are random. ftruncate() is | prototyped in <unistd.h>. You should also include <sys/types.h> before | including <sys/mman.h>. The above happens to work because <stdio.h> | bogusly includes <sys/types.h>. You should also include <fcntl.h> | instead of <sys/file.h> except on old systems. Sorry, bogus example again. Our real code has a proper set of #includes. | The strcpy() doesn't work unless PROT_WRITE is changed to | `PROT_READ | PROT_WRITE', and this isn't because strcpy() reads its | target - `buf[0] = 1' fails in the same way. Interesting. Well, that's a simple enough workaround... Alex Nash says: | Subject: Re: bugs | >This works on all of our 10 existing UNIX platforms except BSDI and | >Linux. BSDI has the same problem with ftruncate, I think; Linux's | >ftruncate works, but its mmap() appears to be totally broken, at least | >in 1.2.13. | | TRUNCATE(2) FreeBSD Programmer's Manual TRUNCATE(2) | [...] | DESCRIPTION | Truncate() causes the file named by path or referenced by fd to be trun- | cated to at most length bytes in size. | ^^^^^^^ All I can say is that your ftruncate() seems to work right (i.e. the same as everyone else) in spite of the documentation. :-) | As far as mmap is concerned, you cannot write beyond 'len' bytes as | specified in the call to mmap. [...] Nor would I wish to. -- Another problem: % vidcontrol VGA_80x50 Cannot set videomode: Invalid argument VGA_80x25 and VGA_40x25 work fine, for what it's worth. -- Paul Falstad, pjf@cts.com, 805-966-4935, http://www.ttinet.com/pjf/ work: pf@software.com, 805-882-2470, http://www.software.com Williams and Holland's Law: If enough data is collected, anything may be proven by statistical methods.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9606021629.ZM129>