From owner-freebsd-bugs Wed Mar 20 15:10:06 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id PAA13314 for bugs-outgoing; Wed, 20 Mar 1996 15:10:06 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id PAA13287 Wed, 20 Mar 1996 15:10:03 -0800 (PST) Resent-Date: Wed, 20 Mar 1996 15:10:03 -0800 (PST) Resent-Message-Id: <199603202310.PAA13287@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, admin@dmzpc.bridge.com Received: from dmzpc.bridge.com (dmzpc.bridge.com.76.167.IN-ADDR.ARPA [167.76.159.150]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id PAA13005 for ; Wed, 20 Mar 1996 15:07:29 -0800 (PST) Received: (from admin@localhost) by dmzpc.bridge.com (8.6.12/8.6.12) id LAA08177; Wed, 20 Mar 1996 11:06:59 -0600 Message-Id: <199603201706.LAA08177@dmzpc.bridge.com> Date: Wed, 20 Mar 1996 11:06:59 -0600 From: admin Reply-To: admin@dmzpc.bridge.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/1092: trouble with ftruncate(2) Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1092 >Category: kern >Synopsis: ftruncate(2) returns EINVAL >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 20 15:10:02 PST 1996 >Last-Modified: >Originator: khardy@acm.org >Organization: >Release: FreeBSD 2.1-STABLE i386 >Environment: >Description: The ftruncate(2) system call always seems to return EINVAL, at least in all the ways I've tried it. >How-To-Repeat: /* This pgm succeeds on FreeBSD 2.0, BSDI 1.1, and SunOS 4.1.3C, but * fails on FreeBSD 2.1 */ #include #include main (int argc, char **argv) { int fd ; if (argc != 2) { fprintf (stderr, "usage: %s filename\n", argv[0]) ; return (-1) ; } if ( (fd = open (argv[1], O_CREAT|O_TRUNC|O_RDWR, 0600) ) < 0) { perror (argv[1]) ; return (-1) ; } if (ftruncate (fd, 0L) ) { perror ("truncate(fd,0)") ; return (-1) ; } printf ("OK\n") ; return 0 ; } >Fix: >Audit-Trail: >Unformatted: