#include "postgres.h"
#include <fcntl.h>
#include <signal.h>
#include <time.h>
#include <sys/stat.h>
#include <unistd.h>
#include "libpq/pqsignal.h"
#include "miscadmin.h"
#include "postmaster/fork_process.h"
Go to the source code of this file.
◆ fork_process()
pid_t fork_process |
( |
void |
| ) |
|
Definition at line 33 of file fork_process.c.
36 const char *oomfilename;
56 getitimer(ITIMER_PROF, &prof_itimer);
65 sigprocmask(SIG_SETMASK, &
BlockSig, &save_mask);
72 setitimer(ITIMER_PROF, &prof_itimer, NULL);
91 oomfilename = getenv(
"PG_OOM_ADJUST_FILE");
93 if (oomfilename != NULL)
99 int fd = open(oomfilename, O_WRONLY, 0);
104 const char *oomvalue = getenv(
"PG_OOM_ADJUST_VALUE");
107 if (oomvalue == NULL)
110 rc =
write(
fd, oomvalue, strlen(oomvalue));
122 sigprocmask(SIG_SETMASK, &save_mask, NULL);
static void const char fflush(stdout)
void pg_strong_random_init(void)
static int fd(const char *x, int i)
int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue)
References BlockSig, close, fd(), fflush(), MyProcPid, pg_strong_random_init(), setitimer(), and write.
Referenced by postmaster_child_launch().