stdio.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 2000, 2001, 2004, 2007, 2013, 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* $Id: stdio.c,v 1.6 2007/06/19 23:47:19 tbox Exp $ */
#include <config.h>
#include <io.h>
#include <errno.h>
#include "errno2result.h"
FILE *f;
if (f == NULL)
return (isc__errno2result(errno));
*fp = f;
return (ISC_R_SUCCESS);
}
isc_stdio_close(FILE *f) {
int r;
r = fclose(f);
if (r == 0)
return (ISC_R_SUCCESS);
else
return (isc__errno2result(errno));
}
int r;
#ifndef _WIN64
#else
#endif
if (r == 0)
return (ISC_R_SUCCESS);
else
return (isc__errno2result(errno));
}
#ifndef _WIN64
long r;
#else
__int64 r;
#endif
#ifndef _WIN64
r = ftell(f);
#else
r = _ftelli64(f);
#endif
if (r >= 0) {
*offsetp = r;
return (ISC_R_SUCCESS);
} else
return (isc__errno2result(errno));
}
size_t r;
clearerr(f);
if (r != nmemb) {
if (feof(f))
else
}
*nret = r;
return (result);
}
{
size_t r;
clearerr(f);
if (r != nmemb)
*nret = r;
return (result);
}
isc_stdio_flush(FILE *f) {
int r;
r = fflush(f);
if (r == 0)
return (ISC_R_SUCCESS);
else
return (isc__errno2result(errno));
}
isc_stdio_sync(FILE *f) {
int r;
if (r == 0)
return (ISC_R_SUCCESS);
else
return (isc__errno2result(errno));
}