git/write-or-die.h

#ifndef WRITE_OR_DIE_H
#define WRITE_OR_DIE_H

void maybe_flush_or_die(FILE *, const char *);
__attribute__((format (printf, 2, 3)))
void fprintf_or_die(FILE *, const char *fmt, ...);
void fwrite_or_die(FILE *f, const void *buf, size_t count);
void fflush_or_die(FILE *f);
void write_or_die(int fd, const void *buf, size_t count);

/*
 * These values are used to help identify parts of a repository to fsync.
 * FSYNC_COMPONENT_NONE identifies data that will not be a persistent part of the
 * repository and so shouldn't be fsynced.
 */
enum fsync_component {};

#define FSYNC_COMPONENTS_OBJECTS

#define FSYNC_COMPONENTS_DERIVED_METADATA

#define FSYNC_COMPONENTS_DEFAULT

#define FSYNC_COMPONENTS_COMMITTED

#define FSYNC_COMPONENTS_ADDED

#define FSYNC_COMPONENTS_ALL

#ifndef FSYNC_COMPONENTS_PLATFORM_DEFAULT
#define FSYNC_COMPONENTS_PLATFORM_DEFAULT
#endif

/* IO helper functions */
void fsync_or_die(int fd, const char *);
int fsync_component(enum fsync_component component, int fd);
void fsync_component_or_die(enum fsync_component component, int fd, const char *msg);

/*
 * A bitmask indicating which components of the repo should be fsynced.
 */
extern enum fsync_component fsync_components;
extern int fsync_object_files;
extern int use_fsync;

enum fsync_method {};

extern enum fsync_method fsync_method;

static inline int batch_fsync_enabled(enum fsync_component component)
{}

#endif /* WRITE_OR_DIE_H */