Skip to content

Commit 781e5d9

Browse files
committed
Implement #8230: Ability to obtain PID of server process for current connection without querying mon$ tables
1 parent c4bc943 commit 781e5d9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/jrd/SysFunction.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ const char
396396
CLIENT_VERSION_NAME[] = "CLIENT_VERSION",
397397
CURRENT_USER_NAME[] = "CURRENT_USER",
398398
CURRENT_ROLE_NAME[] = "CURRENT_ROLE",
399+
SERVER_PID_NAME[] = "SERVER_PID",
399400
SESSION_IDLE_TIMEOUT[] = "SESSION_IDLE_TIMEOUT",
400401
STATEMENT_TIMEOUT[] = "STATEMENT_TIMEOUT",
401402
EFFECTIVE_USER_NAME[] = "EFFECTIVE_USER",
@@ -4709,6 +4710,8 @@ dsc* evlGetContext(thread_db* tdbb, const SysFunction*, const NestValueArray& ar
47094710

47104711
resultStr = role.c_str();
47114712
}
4713+
else if (nameStr == SERVER_PID_NAME)
4714+
resultStr.printf("%d", getpid());
47124715
else if (nameStr == SESSION_IDLE_TIMEOUT)
47134716
resultStr.printf("%" ULONGFORMAT, attachment->getIdleTimeout());
47144717
else if (nameStr == STATEMENT_TIMEOUT)

0 commit comments

Comments
 (0)