PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <signal.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
Go to the source code of this file.
Macros | |
#define | log_error(errcodefn, ...) ereport(LOG, (errcodefn, errmsg_internal(__VA_ARGS__))) |
Functions | |
static int | resolve_symlinks (char *path) |
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, char *line, int maxsize) |
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 152 of file exec.c.
References _, argv0, canonicalize_path(), errcode(), errcode_for_file_access(), first_dir_separator(), first_path_var_separator(), is_absolute_path, join_path_components(), log_error, MAXPGPATH, Min, resolve_symlinks(), strlcpy(), and validate_exec().
Referenced by ensureCleanShutdown(), find_other_exec(), find_other_exec_or_die(), 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 351 of file exec.c.
References argv0, canonicalize_path(), EXE, find_my_exec(), last_dir_separator(), MAXPGPATH, pipe_read_line(), snprintf, and validate_exec().
Referenced by ensureCleanShutdown(), find_other_exec_or_die(), getInstallationPaths(), getRestoreCommand(), isolation_start_test(), main(), and setup_bin_paths().
int pclose_check | ( | FILE * | stream | ) |
Definition at line 422 of file exec.c.
References _, errcode(), log_error, pfree(), and wait_result_to_str().
Referenced by pipe_read_line().
char* pipe_read_line | ( | char * | cmd, |
char * | line, | ||
int | maxsize | ||
) |
Definition at line 387 of file exec.c.
References fflush(), fprintf, and pclose_check().
Referenced by check_exec(), find_other_exec(), and getRestoreCommand().
|
static |
Definition at line 259 of file exec.c.
References _, buf, canonicalize_path(), errcode_for_file_access(), join_path_components(), last_dir_separator(), log_error, lstat, MAXPGPATH, readlink, S_ISLNK, and strlcpy().
Referenced by find_my_exec().
void set_pglocale_pgservice | ( | const char * | argv0, |
const char * | app | ||
) |
Definition at line 460 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 80 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().