29 if (strcmp(argv[1],
"--help") == 0 || strcmp(argv[1],
"-?") == 0)
34 if (strcmp(argv[1],
"--version") == 0 || strcmp(argv[1],
"-V") == 0)
36 printf(
"%s (PostgreSQL) " PG_VERSION
"\n", fixed_progname);
51 int min_range,
int max_range,
64 while (*endptr !=
'\0' && isspace((
unsigned char) *endptr))
74 if (errno == ERANGE || val < min_range || val > max_range)
77 optname, min_range, max_range);
92 if (strcmp(
optarg,
"fsync") == 0)
94 else if (strcmp(
optarg,
"syncfs") == 0)
99 pg_log_error(
"this build does not support sync method \"%s\"",
@ DATA_DIR_SYNC_METHOD_SYNCFS
@ DATA_DIR_SYNC_METHOD_FSYNC
static DataDirSyncMethod sync_method
#define pg_log_error(...)
bool option_parse_int(const char *optarg, const char *optname, int min_range, int max_range, int *result)
void handle_help_version_opts(int argc, char *argv[], const char *fixed_progname, help_handler hlp)
bool parse_sync_method(const char *optarg, DataDirSyncMethod *sync_method)
void(* help_handler)(const char *progname)
PGDLLIMPORT char * optarg
const char * get_progname(const char *argv0)
int strtoint(const char *pg_restrict str, char **pg_restrict endptr, int base)