Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c16ebb0f
Commit
c16ebb0f
authored
Jan 25, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getpid/pid cleanup
parent
fc754845
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
61 additions
and
102 deletions
+61
-102
src/backend/bootstrap/bootstrap.c
src/backend/bootstrap/bootstrap.c
+2
-2
src/backend/commands/async.c
src/backend/commands/async.c
+7
-11
src/backend/commands/user.c
src/backend/commands/user.c
+1
-1
src/backend/executor/nodeHash.c
src/backend/executor/nodeHash.c
+3
-3
src/backend/libpq/pqcomm.c
src/backend/libpq/pqcomm.c
+5
-4
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+2
-2
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/bufmgr.c
+2
-6
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/lock.c
+10
-13
src/backend/storage/lmgr/proc.c
src/backend/storage/lmgr/proc.c
+12
-40
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+3
-3
src/backend/tcop/utility.c
src/backend/tcop/utility.c
+2
-2
src/backend/utils/error/elog.c
src/backend/utils/error/elog.c
+3
-3
src/backend/utils/init/globals.c
src/backend/utils/init/globals.c
+3
-2
src/backend/utils/sort/psort.c
src/backend/utils/sort/psort.c
+2
-2
src/include/miscadmin.h
src/include/miscadmin.h
+3
-2
src/include/storage/proc.h
src/include/storage/proc.h
+1
-6
No files found.
src/backend/bootstrap/bootstrap.c
View file @
c16ebb0f
...
...
@@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.3
2 1998/01/07 21:02:30
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.3
3 1998/01/25 05:12:47
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -322,7 +322,7 @@ BootstrapMain(int argc, char *argv[])
* -------------------
*/
M
aster
Pid
=
getpid
();
M
yProc
Pid
=
getpid
();
/* ----------------
* process command arguments
...
...
src/backend/commands/async.c
View file @
c16ebb0f
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.2
6 1997/12/17 04:44:49 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.2
7 1998/01/25 05:12:54 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -67,6 +67,7 @@
#include <postgres.h>
#include <miscadmin.h>
#include <utils/syscache.h>
#include <access/relscan.h>
#include <access/xact.h>
...
...
@@ -264,7 +265,6 @@ Async_NotifyAtCommit()
TupleDesc
tdesc
;
ScanKeyData
key
;
Datum
d
;
int
ourpid
;
bool
isnull
;
Buffer
b
;
extern
TransactionState
CurrentTransactionState
;
...
...
@@ -291,7 +291,6 @@ Async_NotifyAtCommit()
RelationSetLockForWrite
(
lRel
);
sRel
=
heap_beginscan
(
lRel
,
0
,
false
,
1
,
&
key
);
tdesc
=
RelationGetTupleDescriptor
(
lRel
);
ourpid
=
getpid
();
while
(
HeapTupleIsValid
(
lTuple
=
heap_getnext
(
sRel
,
0
,
&
b
)))
{
...
...
@@ -303,7 +302,7 @@ Async_NotifyAtCommit()
d
=
heap_getattr
(
lTuple
,
b
,
Anum_pg_listener_pid
,
tdesc
,
&
isnull
);
if
(
ourp
id
==
DatumGetInt32
(
d
))
if
(
MyProcP
id
==
DatumGetInt32
(
d
))
{
#ifdef ASYNC_DEBUG
elog
(
DEBUG
,
"Notifying self, setting notifyFronEndPending to 1"
);
...
...
@@ -420,7 +419,6 @@ Async_Listen(char *relname, int pid)
int
i
;
bool
isnull
;
int
alreadyListener
=
0
;
int
ourPid
=
getpid
();
char
*
relnamei
;
TupleDesc
tupDesc
;
...
...
@@ -453,7 +451,7 @@ Async_Listen(char *relname, int pid)
{
d
=
heap_getattr
(
htup
,
b
,
Anum_pg_listener_pid
,
tdesc
,
&
isnull
);
pid
=
DatumGetInt32
(
d
);
if
(
pid
==
our
Pid
)
if
(
pid
==
MyProc
Pid
)
{
alreadyListener
=
1
;
}
...
...
@@ -537,7 +535,7 @@ static void
Async_UnlistenOnExit
(
int
code
,
/* from exitpg */
char
*
relname
)
{
Async_Unlisten
((
char
*
)
relname
,
getpid
()
);
Async_Unlisten
((
char
*
)
relname
,
MyProcPid
);
}
/*
...
...
@@ -579,7 +577,6 @@ Async_NotifyFrontEnd()
char
repl
[
3
],
nulls
[
3
];
Buffer
b
;
int
ourpid
;
bool
isnull
;
notifyFrontEndPending
=
0
;
...
...
@@ -589,7 +586,6 @@ Async_NotifyFrontEnd()
#endif
StartTransactionCommand
();
ourpid
=
getpid
();
ScanKeyEntryInitialize
(
&
key
[
0
],
0
,
Anum_pg_listener_notify
,
Integer32EqualRegProcedure
,
...
...
@@ -597,7 +593,7 @@ Async_NotifyFrontEnd()
ScanKeyEntryInitialize
(
&
key
[
1
],
0
,
Anum_pg_listener_pid
,
Integer32EqualRegProcedure
,
Int32GetDatum
(
ourp
id
));
Int32GetDatum
(
MyProcP
id
));
lRel
=
heap_openr
(
ListenerRelationName
);
RelationSetLockForWrite
(
lRel
);
tdesc
=
RelationGetTupleDescriptor
(
lRel
);
...
...
@@ -621,7 +617,7 @@ Async_NotifyFrontEnd()
if
(
whereToSendOutput
==
Remote
)
{
pq_putnchar
(
"A"
,
1
);
pq_putint
(
ourpid
,
sizeof
(
ourpid
));
pq_putint
(
(
int32
)
MyProcPid
,
sizeof
(
int32
));
pq_putstr
(
DatumGetName
(
d
)
->
data
);
pq_flush
();
}
...
...
src/backend/commands/user.c
View file @
c16ebb0f
...
...
@@ -51,7 +51,7 @@ void UpdatePgPwdFile(char* sql) {
*/
filename
=
crypt_getpwdfilename
();
tempname
=
(
char
*
)
malloc
(
strlen
(
filename
)
+
12
);
sprintf
(
tempname
,
"%s.%d"
,
filename
,
getpid
()
);
sprintf
(
tempname
,
"%s.%d"
,
filename
,
MyProcPid
);
/* Copy the contents of pg_user to the pg_pwd ASCII file using a the SEPCHAR
* character as the delimiter between fields. Then rename the file to its
...
...
src/backend/executor/nodeHash.c
View file @
c16ebb0f
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.1
6 1998/01/13 04:03:53 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.1
7 1998/01/25 05:13:03 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -30,7 +30,7 @@
#include <unistd.h>
#include "postgres.h"
#include "miscadmin.h"
#include "executor/execdebug.h"
#include "executor/executor.h"
#include "executor/nodeHash.h"
...
...
@@ -887,6 +887,6 @@ static int hjtmpcnt = 0;
static
void
mk_hj_temp
(
char
*
tempname
)
{
sprintf
(
tempname
,
"HJ%d.%d"
,
(
int
)
getpid
()
,
hjtmpcnt
);
sprintf
(
tempname
,
"HJ%d.%d"
,
(
int
)
MyProcPid
,
hjtmpcnt
);
hjtmpcnt
=
(
hjtmpcnt
+
1
)
%
1000
;
}
src/backend/libpq/pqcomm.c
View file @
c16ebb0f
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.3
3 1998/01/07 21:03:21
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.3
4 1998/01/25 05:13:18
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -56,6 +56,7 @@
#include <postgres.h>
#include <miscadmin.h>
#include <libpq/pqsignal.h>
#include <libpq/auth.h>
#include <libpq/libpq.h>
/* where the declarations go */
...
...
@@ -515,11 +516,11 @@ pq_regoob(void (*fptr) ())
int
fd
=
fileno
(
Pfout
);
#if defined(hpux)
ioctl
(
fd
,
FIOSSAIOOWN
,
getpid
()
);
ioctl
(
fd
,
FIOSSAIOOWN
,
MyProcPid
);
#elif defined(sco)
ioctl
(
fd
,
SIOCSPGRP
,
getpid
()
);
ioctl
(
fd
,
SIOCSPGRP
,
MyProcPid
);
#else
fcntl
(
fd
,
F_SETOWN
,
getpid
()
);
fcntl
(
fd
,
F_SETOWN
,
MyProcPid
);
#endif
/* hpux */
pqsignal
(
SIGURG
,
fptr
);
}
...
...
src/backend/postmaster/postmaster.c
View file @
c16ebb0f
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.6
8 1997/12/19 02:06:37 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.6
9 1998/01/25 05:13:35 momjian
Exp $
*
* NOTES
*
...
...
@@ -1337,7 +1337,7 @@ DoExec(StartupInfo *packet, int portFd)
if
(
DebugLvl
>
1
)
{
fprintf
(
stderr
,
"%s child[%ld]: execv("
,
progname
,
(
long
)
getpid
()
);
progname
,
(
long
)
MyProcPid
);
for
(
i
=
0
;
i
<
ac
;
++
i
)
fprintf
(
stderr
,
"%s, "
,
av
[
i
]);
fprintf
(
stderr
,
")
\n
"
);
...
...
src/backend/storage/buffer/bufmgr.c
View file @
c16ebb0f
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.3
1 1998/01/07 21:04:49
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.3
2 1998/01/25 05:13:53
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1828,14 +1828,10 @@ refcount = %ld, file: %s, line: %d\n",
_bm_trace
(
Oid
dbId
,
Oid
relId
,
int
blkNo
,
int
bufNo
,
int
allocType
)
{
static
int
mypid
=
0
;
long
start
,
cur
;
bmtrace
*
tb
;
if
(
mypid
==
0
)
mypid
=
getpid
();
start
=
*
CurTraceBuf
;
if
(
start
>
0
)
...
...
@@ -1871,7 +1867,7 @@ _bm_trace(Oid dbId, Oid relId, int blkNo, int bufNo, int allocType)
okay:
tb
=
&
TraceBuf
[
start
];
tb
->
bmt_pid
=
myp
id
;
tb
->
bmt_pid
=
MyProcP
id
;
tb
->
bmt_buf
=
bufNo
;
tb
->
bmt_dbid
=
dbId
;
tb
->
bmt_relid
=
relId
;
...
...
src/backend/storage/lmgr/lock.c
View file @
c16ebb0f
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.2
0 1998/01/23 22:16:46
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.2
1 1998/01/25 05:14:02
momjian Exp $
*
* NOTES
* Outside modules can create a lock table and acquire/release
...
...
@@ -37,6 +37,7 @@
#include <unistd.h>
#include "postgres.h"
#include "miscadmin.h"
#include "storage/shmem.h"
#include "storage/spin.h"
#include "storage/proc.h"
...
...
@@ -77,7 +78,7 @@ static char *lock_types[] = {
if ((lockDebug >= 1) && (tag->relId >= lock_debug_oid_min)) \
elog(DEBUG, \
"%s: pid (%d) rel (%d) dbid (%d) tid (%d,%d) type (%s)",where, \
getpid()
,\
MyProcPid
,\
tag->relId, tag->dbId, \
((tag->tupleId.ip_blkid.bi_hi<<16)+\
tag->tupleId.ip_blkid.bi_lo),\
...
...
@@ -92,7 +93,7 @@ static char *lock_types[] = {
elog(DEBUG, \
"%s: pid (%d) rel (%d) dbid (%d) tid (%d,%d) nHolding (%d) "\
"holders (%d,%d,%d,%d,%d) type (%s)",where, \
getpid()
,\
MyProcPid
,\
lock->tag.relId, lock->tag.dbId, \
((lock->tag.tupleId.ip_blkid.bi_hi<<16)+\
lock->tag.tupleId.ip_blkid.bi_lo),\
...
...
@@ -113,7 +114,7 @@ static char *lock_types[] = {
"%s: pid (%d) xid (%d) pid (%d) lock (%x) nHolding (%d) "\
"holders (%d,%d,%d,%d,%d)",\
where,\
getpid()
,\
MyProcPid
,\
xidentP->tag.xid,\
xidentP->tag.pid,\
xidentP->tag.lock,\
...
...
@@ -550,7 +551,7 @@ LockAcquire(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
#ifdef USER_LOCKS
if
(
is_user_lock
)
{
item
.
tag
.
pid
=
getpid
()
;
item
.
tag
.
pid
=
MyProcPid
;
item
.
tag
.
xid
=
myXid
=
0
;
#ifdef USER_LOCKS_DEBUG
elog
(
NOTICE
,
"LockAcquire: user lock xid [%d,%d,%d]"
,
...
...
@@ -975,7 +976,7 @@ LockRelease(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
#ifdef USER_LOCKS
if
(
is_user_lock
)
{
item
.
tag
.
pid
=
getpid
()
;
item
.
tag
.
pid
=
MyProcPid
;
item
.
tag
.
xid
=
0
;
#ifdef USER_LOCKS_DEBUG
elog
(
NOTICE
,
"LockRelease: user lock xid [%d,%d,%d]"
,
...
...
@@ -1153,14 +1154,12 @@ LockReleaseAll(LockTableId tableId, SHM_QUEUE *lockQueue)
#ifdef USER_LOCKS
int
is_user_lock_table
,
my_pid
,
count
,
nskip
;
is_user_lock_table
=
(
tableId
==
0
);
my_pid
=
getpid
();
#ifdef USER_LOCKS_DEBUG
elog
(
NOTICE
,
"LockReleaseAll: tableId=%d, pid=%d"
,
tableId
,
my_p
id
);
elog
(
NOTICE
,
"LockReleaseAll: tableId=%d, pid=%d"
,
tableId
,
MyProcP
id
);
#endif
if
(
is_user_lock_table
)
{
...
...
@@ -1226,7 +1225,7 @@ LockReleaseAll(LockTableId tableId, SHM_QUEUE *lockQueue)
nskip
++
;
goto
next_item
;
}
if
(
xidLook
->
tag
.
pid
!=
my_p
id
)
if
(
xidLook
->
tag
.
pid
!=
MyProcP
id
)
{
/* This should never happen */
#ifdef USER_LOCKS_DEBUG
...
...
@@ -1433,13 +1432,11 @@ DumpLocks()
SPINLOCK
masterLock
;
int
nLockTypes
;
LOCK
*
lock
;
int
pid
,
count
;
int
tableId
=
1
;
LOCKTAB
*
ltable
;
pid
=
getpid
();
ShmemPIDLookup
(
pid
,
&
location
);
ShmemPIDLookup
(
MyProcPid
,
&
location
);
if
(
location
==
INVALID_OFFSET
)
return
;
proc
=
(
PROC
*
)
MAKE_PTR
(
location
);
...
...
src/backend/storage/lmgr/proc.c
View file @
c16ebb0f
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.2
7 1998/01/23 22:16:48
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.2
8 1998/01/25 05:14:09
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -46,7 +46,7 @@
* This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95
*
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.2
7 1998/01/23 22:16:48
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.2
8 1998/01/25 05:14:09
momjian Exp $
*/
#include <sys/time.h>
#include <unistd.h>
...
...
@@ -127,7 +127,6 @@ InitProcGlobal(IPCKey key)
{
int
i
;
ProcGlobal
->
numProcs
=
0
;
ProcGlobal
->
freeProcs
=
INVALID_OFFSET
;
ProcGlobal
->
currKey
=
IPCGetProcessSemaphoreInitKey
(
key
);
for
(
i
=
0
;
i
<
MAX_PROC_SEMS
/
PROC_NSEMS_PER_SET
;
i
++
)
...
...
@@ -144,7 +143,6 @@ void
InitProcess
(
IPCKey
key
)
{
bool
found
=
false
;
int
pid
;
int
semstat
;
unsigned
long
location
,
myOffset
;
...
...
@@ -201,8 +199,6 @@ InitProcess(IPCKey key)
/* this cannot be initialized until after the buffer pool */
SHMQueueInit
(
&
(
MyProc
->
lockQueue
));
MyProc
->
procId
=
ProcGlobal
->
numProcs
;
ProcGlobal
->
numProcs
++
;
}
/*
...
...
@@ -253,11 +249,8 @@ InitProcess(IPCKey key)
*/
SpinRelease
(
ProcStructLock
);
MyProc
->
pid
=
0
;
MyProc
->
pid
=
MyProcPid
;
MyProc
->
xid
=
InvalidTransactionId
;
#if 0
MyProc->pid = MyPid;
#endif
/* ----------------
* Start keeping spin lock stats from here on. Any botch before
...
...
@@ -273,9 +266,8 @@ InitProcess(IPCKey key)
* exit.
* -------------------------
*/
pid
=
getpid
();
location
=
MAKE_OFFSET
(
MyProc
);
if
((
!
ShmemPIDLookup
(
p
id
,
&
location
))
||
(
location
!=
MAKE_OFFSET
(
MyProc
)))
if
((
!
ShmemPIDLookup
(
MyProcP
id
,
&
location
))
||
(
location
!=
MAKE_OFFSET
(
MyProc
)))
{
elog
(
FATAL
,
"InitProc: ShmemPID table broken"
);
}
...
...
@@ -283,7 +275,7 @@ InitProcess(IPCKey key)
MyProc
->
errType
=
NO_ERROR
;
SHMQueueElemInit
(
&
(
MyProc
->
links
));
on_exitpg
(
ProcKill
,
(
caddr_t
)
p
id
);
on_exitpg
(
ProcKill
,
(
caddr_t
)
MyProcP
id
);
ProcInitialized
=
TRUE
;
}
...
...
@@ -352,12 +344,7 @@ ProcKill(int exitStatus, int pid)
if
(
exitStatus
!=
0
)
return
;
if
(
!
pid
)
{
pid
=
getpid
();
}
ShmemPIDLookup
(
pid
,
&
location
);
ShmemPIDLookup
(
MyProcPid
,
&
location
);
if
(
location
==
INVALID_OFFSET
)
return
;
...
...
@@ -365,7 +352,7 @@ ProcKill(int exitStatus, int pid)
if
(
proc
!=
MyProc
)
{
Assert
(
pid
!=
getpid
()
);
Assert
(
pid
!=
MyProcPid
);
}
else
MyProc
=
NULL
;
...
...
@@ -572,19 +559,6 @@ ProcWakeup(PROC *proc, int errType)
return
retProc
;
}
/*
* ProcGetId --
*/
#ifdef NOT_USED
int
ProcGetId
()
{
return
(
MyProc
->
procId
);
}
#endif
/*
* ProcLockWakeup -- routine for waking up processes when a lock is
* released.
...
...
@@ -652,8 +626,7 @@ ProcAddLock(SHM_QUEUE *elem)
static
void
HandleDeadLock
(
int
sig
)
{
LOCK
*
lock
;
int
size
;
LOCK
*
mywaitlock
;
LockLockTable
();
...
...
@@ -692,8 +665,7 @@ HandleDeadLock(int sig)
return
;
}
lock
=
MyProc
->
waitLock
;
size
=
lock
->
waitProcs
.
size
;
/* so we can look at this in the core */
mywaitlock
=
MyProc
->
waitLock
;
#ifdef DEADLOCK_DEBUG
DumpLocks
();
...
...
@@ -703,8 +675,8 @@ HandleDeadLock(int sig)
* Get this process off the lock's wait queue
* ------------------------
*/
Assert
(
lock
->
waitProcs
.
size
>
0
);
--
lock
->
waitProcs
.
size
;
Assert
(
mywait
lock
->
waitProcs
.
size
>
0
);
--
mywait
lock
->
waitProcs
.
size
;
SHMQueueDelete
(
&
(
MyProc
->
links
));
SHMQueueElemInit
(
&
(
MyProc
->
links
));
...
...
src/backend/tcop/postgres.c
View file @
c16ebb0f
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.6
1 1998/01/13 04:04:36 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.6
2 1998/01/25 05:14:18 momjian
Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -886,7 +886,7 @@ PostgresMain(int argc, char *argv[])
* -------------------
*/
M
aster
Pid
=
getpid
();
M
yProc
Pid
=
getpid
();
/* ----------------
* parse command line arguments
...
...
@@ -1381,7 +1381,7 @@ PostgresMain(int argc, char *argv[])
if
(
IsUnderPostmaster
==
false
)
{
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"$Revision: 1.6
1 $ $Date: 1998/01/13 04:04:36
$"
);
puts
(
"$Revision: 1.6
2 $ $Date: 1998/01/25 05:14:18
$"
);
}
/* ----------------
...
...
src/backend/tcop/utility.c
View file @
c16ebb0f
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.3
6 1998/01/05 18:43:09
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.3
7 1998/01/25 05:14:27
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -589,7 +589,7 @@ ProcessUtility(Node * parsetree,
commandTag
=
"LISTEN"
;
CHECK_IF_ABORTED
();
Async_Listen
(
stmt
->
relname
,
M
aster
Pid
);
Async_Listen
(
stmt
->
relname
,
M
yProc
Pid
);
}
break
;
...
...
src/backend/utils/error/elog.c
View file @
c16ebb0f
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.2
4 1998/01/07 21:06:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.2
5 1998/01/25 05:14:35
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -177,7 +177,7 @@ elog(int lev, const char *fmt,...)
ProcReleaseSpins
(
NULL
);
/* get rid of spinlocks we hold */
if
(
!
InError
)
{
kill
(
getpid
()
,
1
);
/* abort to traffic cop */
kill
(
MyProcPid
,
1
);
/* abort to traffic cop */
pause
();
}
...
...
@@ -257,7 +257,7 @@ DebugFileOpen(void)
if
(
fcntl
(
fd
,
F_GETFD
,
0
)
<
0
)
{
sprintf
(
OutputFileName
,
"%s/pg.errors.%d"
,
DataDir
,
(
int
)
getpid
()
);
DataDir
,
(
int
)
MyProcPid
);
fd
=
open
(
OutputFileName
,
O_CREAT
|
O_APPEND
|
O_WRONLY
,
0666
);
}
if
(
fd
<
0
)
...
...
src/backend/utils/init/globals.c
View file @
c16ebb0f
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.1
7 1997/11/24 05:09:13
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.1
8 1998/01/25 05:14:42
momjian Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
...
...
@@ -39,7 +39,8 @@ int Portfd = -1;
int
Noversion
=
0
;
int
Quiet
=
1
;
int
MasterPid
;
int
MyProcPid
;
char
*
DataDir
;
/*
...
...
src/backend/utils/sort/psort.c
View file @
c16ebb0f
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.3
2 1998/01/15 19:46:10 pgsql
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.3
3 1998/01/25 05:14:49 momjian
Exp $
*
* NOTES
* Sorts the first relation into the second relation.
...
...
@@ -988,7 +988,7 @@ gettape()
tp
=
(
struct
tapelst
*
)
palloc
((
unsigned
)
sizeof
(
struct
tapelst
));
sprintf
(
uniqueName
,
"%spg_psort.%d.%d"
,
TEMPDIR
,
(
int
)
getpid
()
,
uniqueFileId
);
sprintf
(
uniqueName
,
"%spg_psort.%d.%d"
,
TEMPDIR
,
(
int
)
MyProcPid
,
uniqueFileId
);
uniqueFileId
++
;
tapeinit
=
1
;
...
...
src/include/miscadmin.h
View file @
c16ebb0f
...
...
@@ -11,7 +11,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: miscadmin.h,v 1.1
8 1997/12/04 23:58:01 thomas
Exp $
* $Id: miscadmin.h,v 1.1
9 1998/01/25 05:15:01 momjian
Exp $
*
* NOTES
* some of the information in this file will be moved to
...
...
@@ -36,10 +36,11 @@ extern int PostmasterMain(int argc, char *argv[]);
*/
extern
int
Portfd
;
extern
int
Noversion
;
extern
int
MasterPid
;
extern
int
Quiet
;
extern
char
*
DataDir
;
extern
int
MyProcPid
;
extern
char
OutputFileName
[];
/*
...
...
src/include/storage/proc.h
View file @
c16ebb0f
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: proc.h,v 1.
9 1998/01/23 06:01:2
5 momjian Exp $
* $Id: proc.h,v 1.
10 1998/01/25 05:15:1
5 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -35,10 +35,6 @@ typedef struct proc
SEMA
sem
;
/* ONE semaphore to sleep on */
int
errType
;
/* error code tells why we woke up */
int
procId
;
/* unique number for this structure NOT
* unique per backend, these things are
* reused after the backend dies. */
int
critSects
;
/* If critSects > 0, we are in sensitive
* routines that cannot be recovered when
* the process fails. */
...
...
@@ -69,7 +65,6 @@ typedef struct proc
typedef
struct
procglobal
{
SHMEM_OFFSET
freeProcs
;
int
numProcs
;
IPCKey
currKey
;
int32
freeSemMap
[
MAX_PROC_SEMS
/
PROC_NSEMS_PER_SET
];
}
PROC_HDR
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment