PostgreSQL Source Code git master
|
#include "postgres.h"
#include <signal.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
#include "common/string.h"
Go to the source code of this file.
Macros | |
#define | _DARWIN_BETTER_REALPATH |
#define | log_error(errcodefn, ...) ereport(LOG, (errcodefn, errmsg_internal(__VA_ARGS__))) |
Functions | |
static int | normalize_exec_path (char *path) |
static char * | pg_realpath (const char *fname) |
int | validate_exec (const char *path) |
int | find_my_exec (const char *argv0, char *retpath) |
int | find_other_exec (const char *argv0, const char *target, const char *versionstr, char *retpath) |
char * | pipe_read_line (char *cmd) |
int | pclose_check (FILE *stream) |
void | set_pglocale_pgservice (const char *argv0, const char *app) |
#define log_error | ( | errcodefn, | |
... | |||
) | ereport(LOG, (errcodefn, errmsg_internal(__VA_ARGS__))) |
int find_my_exec | ( | const char * | argv0, |
char * | retpath | ||
) |
Definition at line 160 of file exec.c.
References _, argv0, canonicalize_path(), errcode(), first_dir_separator(), first_path_var_separator(), join_path_components(), log_error, MAXPGPATH, Min, normalize_exec_path(), strlcpy(), and validate_exec().
Referenced by ensureCleanShutdown(), find_other_exec(), find_other_exec_or_die(), get_exec_path(), getInstallationPaths(), getRestoreCommand(), InitStandaloneProcess(), main(), process_psqlrc(), set_pglocale_pgservice(), setup(), and setup_bin_paths().
int find_other_exec | ( | const char * | argv0, |
const char * | target, | ||
const char * | versionstr, | ||
char * | retpath | ||
) |
Definition at line 310 of file exec.c.
References argv0, canonicalize_path(), EXE, find_my_exec(), last_dir_separator(), MAXPGPATH, pfree(), pipe_read_line(), snprintf, and validate_exec().
Referenced by ensureCleanShutdown(), find_other_exec_or_die(), get_exec_path(), getInstallationPaths(), getRestoreCommand(), isolation_start_test(), main(), and setup_bin_paths().
|
static |
Definition at line 241 of file exec.c.
References _, canonicalize_path(), errcode_for_file_access(), free, log_error, MAXPGPATH, pg_realpath(), and strlcpy().
Referenced by find_my_exec().
int pclose_check | ( | FILE * | stream | ) |
Definition at line 391 of file exec.c.
References _, errcode(), log_error, pfree(), and wait_result_to_str().
Referenced by pipe_read_line().
|
static |
Definition at line 282 of file exec.c.
Referenced by normalize_exec_path().
char * pipe_read_line | ( | char * | cmd | ) |
Definition at line 352 of file exec.c.
References _, errcode(), errcode_for_file_access(), fflush(), log_error, pclose_check(), and pg_get_line().
Referenced by check_exec(), find_other_exec(), and getRestoreCommand().
void set_pglocale_pgservice | ( | const char * | argv0, |
const char * | app | ||
) |
Definition at line 429 of file exec.c.
References argv0, find_my_exec(), get_etc_path(), get_locale_path(), MAXPGPATH, my_exec_path, PG_TEXTDOMAIN, setenv, and setlocale.
Referenced by main(), and regression_main().
int validate_exec | ( | const char * | path | ) |
Definition at line 88 of file exec.c.
References buf, MAXPGPATH, pg_strcasecmp(), S_IRUSR, S_ISDIR, S_ISREG, S_IXUSR, stat, and strlcpy().
Referenced by check_exec(), find_my_exec(), and find_other_exec().