add isc_stdio_tell, add missing comma
(cherry picked from commit 793a8c9aa29986422e7bae75dc5e65f201081a57)
(cherry picked from commit 8e9bbdda10)
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include <isc/stdio.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include "errno2result.h"
|
||||
|
||||
@@ -63,6 +64,28 @@ isc_stdio_seek(FILE *f, off_t offset, int whence) {
|
||||
return (isc__errno2result(errno));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
isc_stdio_tell(FILE *f, off_t *offsetp) {
|
||||
#ifndef _WIN64
|
||||
long r;
|
||||
#else
|
||||
__int64 r;
|
||||
#endif
|
||||
|
||||
REQUIRE(offsetp != NULL);
|
||||
|
||||
#ifndef _WIN64
|
||||
r = ftell(f);
|
||||
#else
|
||||
r = _ftelli64(f);
|
||||
#endif
|
||||
if (r >= 0) {
|
||||
*offsetp = r;
|
||||
return (ISC_R_SUCCESS);
|
||||
} else
|
||||
return (isc__errno2result(errno));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
isc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f, size_t *nret) {
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user