*BSD News Article 43849


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!spool.mu.edu!sdd.hp.com!usc!hookup!ames!newsfeed.gsfc.nasa.gov!news!kstailey
From: kstailey@leidecker.gsfc.nasa.gov (Kenneth Stailey)
Newsgroups: comp.unix.bsd.netbsd.misc
Subject: Re: ftrunctate fails in popper
Date: 01 May 1995 03:15:14 GMT
Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA
Lines: 24
Message-ID: <KSTAILEY.95Apr30231514@leidecker.gsfc.nasa.gov>
References: <3o0n2m$a9c_001@mstar.morningstar.com> <3o11p7$g2q@news.iastate.edu>
NNTP-Posting-Host: leidecker.gsfc.nasa.gov
In-reply-to: Chris Csanady's message of 30 Apr 1995 22:08:39 GMT

In article <3o11p7$g2q@news.iastate.edu> Chris Csanady <ccsanady> writes:

   this might be completely worthless advice, but... i ran into trouble
   with the ftruncate function, and here was the problem.  it seems that
   you _must_ #include <unistd.h> or it just does not work.  try including
   it.  if thats not the problem though, i have no idea what to tell you..

NetBSD 1.0A now also defines it in <sys/types.h>
[excerpted from sys/types.h]
/*
 * These belong in unistd.h, but are placed here too to ensure that
 * long arguments will be promoted to off_t if the program fails to 
 * include that header or explicitly cast them to off_t.
 */
#ifndef _KERNEL
#include <sys/cdefs.h>
__BEGIN_DECLS
off_t    lseek __P((int, off_t, int));
int      ftruncate __P((int, off_t));
int      truncate __P((const char *, off_t));
__END_DECLS
#endif
[end excerpt]