#include <stdbool.h>
#include <isc/file.h>
-#include <isc/offset.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/stdio.h>
const cfg_obj_t *suffixobj = cfg_tuple_get(fileobj, "suffix");
int32_t versions = ISC_LOG_ROLLNEVER;
isc_log_rollsuffix_t suffix = isc_log_rollsuffix_increment;
- isc_offset_t size = 0;
+ off_t size = 0;
uint64_t maxoffset;
/*
- * isc_offset_t is a signed integer type, so the maximum
+ * off_t is a signed integer type, so the maximum
* value is all 1s except for the MSB.
*/
- switch (sizeof(isc_offset_t)) {
+ switch (sizeof(off_t)) {
case 4:
maxoffset = 0x7fffffffULL;
break;
if (sizeobj != NULL && cfg_obj_isuint64(sizeobj) &&
cfg_obj_asuint64(sizeobj) < maxoffset)
{
- size = (isc_offset_t)cfg_obj_asuint64(sizeobj);
+ size = (off_t)cfg_obj_asuint64(sizeobj);
}
if (suffixobj != NULL && cfg_obj_isstring(suffixobj) &&
strcasecmp(cfg_obj_asstring(suffixobj), "timestamp") == 0)
unsigned char serial[4]; /*%< SOA serial before update. */
/*
* XXXRTH Should offset be 8 bytes?
- * XXXDCL ... probably, since isc_offset_t is 8 bytes on many OSs.
+ * XXXDCL ... probably, since off_t is 8 bytes on many OSs.
* XXXAG ... but we will not be able to seek >2G anyway on many
* platforms as long as we are using fseek() rather
* than lseek().
*/
typedef struct {
uint32_t serial;
- isc_offset_t offset;
+ off_t offset;
} journal_pos_t;
#define POS_VALID(pos) ((pos).offset != 0)
* while reading the journal */
char *filename; /*%< Journal file name */
FILE *fp; /*%< File handle */
- isc_offset_t offset; /*%< Current file offset */
+ off_t offset; /*%< Current file offset */
journal_xhdr_t curxhdr; /*%< Current transaction header */
journal_header_t header; /*%< In-core journal header */
unsigned char *rawindex; /*%< In-core buffer for journal index
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
}
- j->offset += (isc_offset_t)nbytes;
+ j->offset += (off_t)nbytes;
return (ISC_R_SUCCESS);
}
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
}
- j->offset += (isc_offset_t)nbytes;
+ j->offset += (off_t)nbytes;
return (ISC_R_SUCCESS);
}
static isc_result_t
maybe_fixup_xhdr(dns_journal_t *j, journal_xhdr_t *xhdr, uint32_t serial,
- isc_offset_t offset) {
+ off_t offset) {
isc_result_t result = ISC_R_SUCCESS;
/*
? sizeof(journal_rawxhdr_t)
: sizeof(journal_rawxhdr_ver1_t);
- if ((isc_offset_t)(pos->offset + hdrsize + xhdr.size) < pos->offset) {
+ if ((off_t)(pos->offset + hdrsize + xhdr.size) < pos->offset) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR,
"%s: offset too large", j->filename);
return (ISC_R_UNEXPECTED);
CHECK(journal_fsync(j));
if (j->state == JOURNAL_STATE_TRANSACTION) {
- isc_offset_t offset;
+ off_t offset;
offset = (j->x.pos[1].offset - j->x.pos[0].offset) -
(j->header_ver1 ? sizeof(journal_rawxhdr_ver1_t)
: sizeof(journal_rawxhdr_t));
*/
while (rewrite && len > 0) {
journal_xhdr_t xhdr;
- isc_offset_t offset = j1->offset;
+ off_t offset = j1->offset;
uint32_t count;
result = journal_read_xhdr(j1, &xhdr);
+++ /dev/null
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * 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 https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-#pragma once
-
-/*! \file
- * \brief
- * File offsets are operating-system dependent.
- */
-#include <limits.h> /* Required for CHAR_BIT. */
-#include <stddef.h> /* For Linux Standard Base. */
-
-#include <sys/types.h>
-
-typedef off_t isc_offset_t;