Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd75b2ec

Browse files
committed
This patch is the next step towards (re)allowing fork/exec.
Claudio Natoli
1 parent1ee0ddf commitd75b2ec

File tree

23 files changed

+492
-218
lines changed

23 files changed

+492
-218
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.128 2003/12/14 00:34:47 neilc Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.129 2003/12/20 17:31:20 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -166,7 +166,7 @@ XLogRecPtrProcLastRecEnd = {0, 0};
166166
* to update from XLogCtl->Insert.RedoRecPtr if we hold the info_lck;
167167
* see GetRedoRecPtr.
168168
*/
169-
staticXLogRecPtrRedoRecPtr;
169+
NON_EXEC_STATICXLogRecPtrRedoRecPtr;
170170

171171
/*----------
172172
* Shared-memory data structures for XLOG control
@@ -231,12 +231,6 @@ typedef struct XLogwrtRqst
231231
XLogRecPtrFlush;/* last byte + 1 to flush */
232232
}XLogwrtRqst;
233233

234-
typedefstructXLogwrtResult
235-
{
236-
XLogRecPtrWrite;/* last byte + 1 written out */
237-
XLogRecPtrFlush;/* last byte + 1 flushed */
238-
}XLogwrtResult;
239-
240234
/*
241235
* Shared state data for XLogInsert.
242236
*/
@@ -404,7 +398,7 @@ static char ControlFilePath[MAXPGPATH];
404398
* Private, possibly out-of-date copy of shared LogwrtResult.
405399
* See discussion above.
406400
*/
407-
staticXLogwrtResultLogwrtResult= {{0,0}, {0,0}};
401+
NON_EXEC_STATICXLogwrtResultLogwrtResult= {{0,0}, {0,0}};
408402

409403
/*
410404
* openLogFile is -1 or a kernel FD for an open log file segment.
@@ -2398,7 +2392,7 @@ XLOGShmemSize(void)
23982392
void
23992393
XLOGShmemInit(void)
24002394
{
2401-
boolfound;
2395+
boolfoundXLog,foundCFile;
24022396

24032397
/* this must agree with space requested by XLOGShmemSize() */
24042398
if (XLOGbuffers<MinXLOGbuffers)
@@ -2409,11 +2403,16 @@ XLOGShmemInit(void)
24092403
MAXALIGN(sizeof(XLogCtlData)+
24102404
sizeof(XLogRecPtr)*XLOGbuffers)
24112405
+BLCKSZ*XLOGbuffers,
2412-
&found);
2413-
Assert(!found);
2406+
&foundXLog);
24142407
ControlFile= (ControlFileData*)
2415-
ShmemInitStruct("Control File",sizeof(ControlFileData),&found);
2416-
Assert(!found);
2408+
ShmemInitStruct("Control File",sizeof(ControlFileData),&foundCFile);
2409+
2410+
if (foundXLog||foundCFile)
2411+
{
2412+
/* both should be present or neither */
2413+
Assert(foundXLog&&foundCFile);
2414+
return;
2415+
}
24172416

24182417
memset(XLogCtl,0,sizeof(XLogCtlData));
24192418

‎src/backend/bootstrap/bootstrap.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.170 2003/12/12 18:45:08 petere Exp $
11+
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.171 2003/12/20 17:31:21 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -347,9 +347,10 @@ BootstrapMain(int argc, char *argv[])
347347
if (!dbname||argc!=optind)
348348
usage();
349349

350-
351-
if (IsUnderPostmaster&&ExecBackend&&MyProc/* ordinary backend */ )
350+
#ifdefEXEC_BACKEND
351+
if (IsUnderPostmaster&&MyProc/* ordinary backend */ )
352352
AttachSharedMemoryAndSemaphores();
353+
#endif
353354

354355
if (!IsUnderPostmaster/* when exec || ExecBackend */ )
355356
{

‎src/backend/postmaster/pgstat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
*Copyright (c) 2001-2003, PostgreSQL Global Development Group
1515
*
16-
*$PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.48 2003/11/29 19:51:55 pgsql Exp $
16+
*$PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.49 2003/12/20 17:31:21 momjian Exp $
1717
* ----------
1818
*/
1919
#include"postgres.h"
@@ -71,7 +71,7 @@ boolpgstat_is_running = false;
7171
* Local data
7272
* ----------
7373
*/
74-
staticintpgStatSock=-1;
74+
NON_EXEC_STATICintpgStatSock=-1;
7575
staticintpgStatPipe[2];
7676
staticstructsockaddr_storagepgStatAddr;
7777
staticintpgStatPmPipe[2]= {-1,-1};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp