diff options
| author | Bruce Momjian <bruce@momjian.us> | 2003-12-20 17:31:21 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2003-12-20 17:31:21 +0000 |
| commit | d75b2ec4ebbc7fdb51088e89da47c6523bf2c640 (patch) | |
| tree | 4f0a12508b01da4d98c663bbdadb4a2e1ae6837a /src/backend/storage/ipc/ipci.c | |
| parent | 1ee0ddf91df31669ca0d07871d3f5aa88791b78d (diff) | |
| download | postgresql-d75b2ec4ebbc7fdb51088e89da47c6523bf2c640.tar.gz | |
This patch is the next step towards (re)allowing fork/exec.
Claudio Natoli
Diffstat (limited to 'src/backend/storage/ipc/ipci.c')
| -rw-r--r-- | src/backend/storage/ipc/ipci.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c index 982846843a..eaf22a095f 100644 --- a/src/backend/storage/ipc/ipci.c +++ b/src/backend/storage/ipc/ipci.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/ipc/ipci.c,v 1.59 2003/12/01 21:59:25 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/storage/ipc/ipci.c,v 1.60 2003/12/20 17:31:21 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -87,7 +87,7 @@ CreateSharedMemoryAndSemaphores(bool makePrivate, /* * Set up shared memory allocation mechanism */ - InitShmemAllocation(seghdr); + InitShmemAllocation(seghdr, true); /* * Now initialize LWLocks, which do shared memory allocation and are @@ -135,12 +135,36 @@ CreateSharedMemoryAndSemaphores(bool makePrivate, } +#ifdef EXEC_BACKEND /* * AttachSharedMemoryAndSemaphores * Attaches to the existing shared resources. */ + +/* FIXME: [fork/exec] This function is starting to look pretty much like + CreateSharedMemoryAndSemaphores. Refactor? */ void AttachSharedMemoryAndSemaphores(void) { + PGShmemHeader *seghdr = PGSharedMemoryCreate(-1,false,-1); + + InitShmemAllocation(seghdr, false); + + InitShmemIndex(); + + XLOGShmemInit(); CLOGShmemInit(); + InitBufferPool(); + + InitLocks(); + InitLockTable(MaxBackends); + + InitProcGlobal(MaxBackends); + + CreateSharedInvalidationState(MaxBackends); + + InitFreeSpaceMap(); + + PMSignalInit(); } +#endif |
