*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.264 2002/01/10 01:11:45 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.265 2002/02/19 19:53:35 tgl Exp $
*
* NOTES
*
/*
* Set up signal handlers for the postmaster process.
+ *
+ * CAUTION: when changing this list, check for side-effects on the
+ * signal handling setup of child processes. See tcop/postgres.c,
+ * bootstrap/bootstrap.c, and postmaster/pgstat.c.
*/
pqinitmask();
PG_SETMASK(&BlockSig);
*/
whereToSendOutput = None;
+ /*
+ * On many platforms, the first call of localtime() incurs significant
+ * overhead to load timezone info from the system configuration files.
+ * By doing it once in the postmaster, we avoid having to do it in every
+ * started child process. The savings are not huge, but they add up...
+ */
+ {
+ time_t now = time(NULL);
+
+ (void) localtime(&now);
+ }
+
/*
* Initialize and startup the statistics collector process
*/
Dlelem *curr,
*next;
Backend *bp;
- int mypid = getpid();
curr = DLGetHead(BackendList);
while (curr)
next = DLGetSucc(curr);
bp = (Backend *) DLE_VAL(curr);
- if (bp->pid != mypid)
+ if (bp->pid != MyProcPid)
{
if (DebugLvl >= 1)
elog(DEBUG, "SignalChildren: sending signal %d to process %d",
{
Dlelem *curr;
Backend *bp;
- int mypid = getpid();
int cnt = 0;
for (curr = DLGetHead(BackendList); curr; curr = DLGetSucc(curr))
{
bp = (Backend *) DLE_VAL(curr);
- if (bp->pid != mypid)
+ if (bp->pid != MyProcPid)
cnt++;
}
if (CheckPointPID != 0)