Files
Arquivotheca.SunOS-4.1.4/usr.etc/tfs/libtfs/fftruncate.c
seta75D ff309bfe1c Init
2021-10-11 18:37:13 -03:00

25 lines
434 B
C

#ifndef lint
static char sccsid[] = "@(#)fftruncate.c 1.1 94/10/31 Copyr 1988 Sun Micro";
#endif
/*
* Copyright (c) 1988 Sun Microsystems, Inc.
*/
#include <stdio.h>
/*
* Routine to truncate a file opened with fopen(3S). Will usually be used
* with files that have been opened with type "r+".
*/
int
nse_fftruncate(filep)
FILE *filep;
{
rewind(filep);
if (ftruncate(fileno(filep), 0L)) {
return (-1);
}
return (0);
}