* $Id$
*****************************************************************************/
+#ifdef WIN32
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_BROKEN_MS_ASYNC
+#include <sys/types.h>
#include <utime.h>
+#endif
#include "rrd_tool.h"
#include "unused.h"
/* Are we creating a new file? */
if((rdwr & RRD_CREAT) && (rrd->stat_head != NULL))
{
- header_len = \
- sizeof(stat_head_t) + \
- sizeof(ds_def_t) * rrd->stat_head->ds_cnt + \
- sizeof(rra_def_t) * rrd->stat_head->rra_cnt + \
- sizeof(time_t) + \
- sizeof(live_head_t) + \
- sizeof(pdp_prep_t) * rrd->stat_head->ds_cnt + \
- sizeof(cdp_prep_t) * rrd->stat_head->ds_cnt * rrd->stat_head->rra_cnt + \
- sizeof(rra_ptr_t) * rrd->stat_head->rra_cnt;
+ header_len = rrd_get_header_size(rrd);
value_cnt = 0;
for (ui = 0; ui < rrd->stat_head->rra_cnt; ui++)
size_t dontneed_start;
size_t rra_start;
size_t active_block;
- unsigned long i;
+ size_t i;
ssize_t _page_size = sysconf(_SC_PAGESIZE);
if (rrd_file == NULL) {