* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: file.h,v 1.24 2001/07/16 18:33:00 gson Exp $ */
+/* $Id: file.h,v 1.25 2001/08/30 04:55:34 marka Exp $ */
#ifndef ISC_FILE_H
#define ISC_FILE_H 1
* (see write_open() in BIND 8's ns_config.c).
*/
+isc_result_t
+isc_file_truncate(const char *filename, isc_offset_t size);
+/*
+ * Truncate/Extend the file specified to 'size' bytes.
+ */
+
ISC_LANG_ENDDECLS
#endif /* ISC_FILE_H */
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: file.c,v 1.38 2001/07/16 18:33:01 gson Exp $ */
+/* $Id: file.c,v 1.39 2001/08/30 04:55:36 marka Exp $ */
#include <config.h>
strcat(path, filename);
return (ISC_R_SUCCESS);
}
+
+isc_result_t
+isc_file_truncate(const char *filename, isc_offset_t size) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ if (truncate(filename, size) < 0)
+ result = isc__errno2result(errno);
+ return (result);
+}