Date: Wed, 12 Mar 1997 15:40:03 -0800 (PST) From: j@uriah.heep.sax.de (J Wunsch) To: freebsd-bugs Subject: Re: kern/2966: ftruncate() problem in FreeBSD 2.1.7-RELEASE i386 Message-ID: <199703122340.PAA19860@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/2966; it has been noted by GNATS. From: j@uriah.heep.sax.de (J Wunsch) To: rick@softport.nyc.ny.us (Rick Ace) Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: kern/2966: ftruncate() problem in FreeBSD 2.1.7-RELEASE i386 Date: Wed, 12 Mar 1997 23:58:26 +0100 As Rick Ace wrote: > ftruncate() fails with error (EINVAL) when called to truncate > a file whose descriptor is open for read and write. > It should succeed. j@uriah 589% cc foo.c j@uriah 590% ./a.out ok write() returns 3 ok Rule #1: Thou shalt declare all your functions. ftruncate() takes an argument of type off_t. If you fail to declare this function (and fail to cast the argument), you get what you deserve. #include <unistd.h> -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703122340.PAA19860>