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

Commitd3f62f2

Browse files
committed
Send paramHandle to subprocesses as 64-bit on Win64
The handle to the shared memory segment containing startupparameters was sent as 32-bit even on 64-bit systems. SinceHANDLEs appear to be allocated sequentially this shouldn'tbe a problem until we reach 2^32 open handles in the postmaster,but a 64-bit value should be sent across as 64-bit, and notzero out the top 32 bits.Noted by Tom Lane.
1 parent821bb17 commitd3f62f2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3749,7 +3749,11 @@ internal_forkexec(int argc, char *argv[], Port *port)
37493749
}
37503750

37513751
/* Insert temp file name after --fork argument */
3752+
#ifdef_WIN64
3753+
sprintf(paramHandleStr,"%llu", (LONG_PTR)paramHandle);
3754+
#else
37523755
sprintf(paramHandleStr,"%lu", (DWORD)paramHandle);
3756+
#endif
37533757
argv[2]=paramHandleStr;
37543758

37553759
/* Format the cmd line */
@@ -4819,7 +4823,11 @@ read_backend_variables(char *id, Port *port)
48194823
HANDLEparamHandle;
48204824
BackendParameters*paramp;
48214825

4826+
#ifdef_WIN64
4827+
paramHandle= (HANDLE)_atoi64(id);
4828+
#else
48224829
paramHandle= (HANDLE)atol(id);
4830+
#endif
48234831
paramp=MapViewOfFile(paramHandle,FILE_MAP_READ,0,0,0);
48244832
if (!paramp)
48254833
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp