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

Commit14ed773

Browse files
committed
Improve comments around startup_hacks() code.
These comments were not updated when we added the EXEC_BACKENDmechanism for Windows, even though it rendered them inaccurate.Also unify two unnecessarily-separate #ifdef __alpha code blocks.
1 parent61b5369 commit14ed773

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

‎src/backend/main/main.c

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
* Stub main() routine for the postgres executable.
55
*
66
* This does some essential startup tasks for any incarnation of postgres
7-
* (postmaster, standalone backend, or standalone bootstrap mode) and then
8-
* dispatches to the proper FooMain() routine for the incarnation.
7+
* (postmaster, standalone backend, standalone bootstrap process, or a
8+
* separately exec'd child of a postmaster) and then dispatches to the
9+
* proper FooMain() routine for the incarnation.
910
*
1011
*
1112
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
@@ -54,7 +55,9 @@ static void check_root(const char *progname);
5455
staticchar*get_current_username(constchar*progname);
5556

5657

57-
58+
/*
59+
* Any Postgres server process begins execution here.
60+
*/
5861
int
5962
main(intargc,char*argv[])
6063
{
@@ -192,10 +195,10 @@ main(int argc, char *argv[])
192195

193196
/*
194197
* Place platform-specific startup hacks here.This is the right
195-
* place to put code that must be executed early in launch ofeither a
196-
*postmaster, a standalone backend, or a standalone bootstrap run.
197-
*Note that this code will NOT be executed when abackend or
198-
*sub-bootstrap runisforked by the server.
198+
* place to put code that must be executed early inthelaunch ofany new
199+
*server process. Note that this code will NOT be executed when a backend
200+
*or sub-bootstrap process is forked, unless we are in afork/exec
201+
*environment (ie EXEC_BACKENDisdefined).
199202
*
200203
* XXX The need for code here is proof that the platform in question
201204
* is too brain-dead to provide a standard C execution environment
@@ -204,17 +207,10 @@ main(int argc, char *argv[])
204207
staticvoid
205208
startup_hacks(constchar*progname)
206209
{
207-
#if defined(__alpha)/* no __alpha__ ? */
208-
#ifdefNOFIXADE
209-
intbuffer[]= {SSIN_UACPROC,UAC_SIGBUS |UAC_NOPRINT};
210-
#endif
211-
#endif/* __alpha */
212-
213-
214210
/*
215211
* On some platforms, unaligned memory accesses result in a kernel trap;
216212
* the default kernel behavior is to emulate the memory access, but this
217-
* results in a significant performance penalty. Weought to fixPGnot to
213+
* results in a significant performance penalty.WewantPGnever to
218214
* make such unaligned memory accesses, so this code disables the kernel
219215
* emulation: unaligned accesses will result in SIGBUS instead.
220216
*/
@@ -225,14 +221,21 @@ startup_hacks(const char *progname)
225221
#endif
226222

227223
#if defined(__alpha)/* no __alpha__ ? */
228-
if (setsysinfo(SSI_NVPAIRS,buffer,1, (caddr_t)NULL,
229-
(unsigned long)NULL)<0)
230-
write_stderr("%s: setsysinfo failed: %s\n",
231-
progname,strerror(errno));
232-
#endif
233-
#endif/* NOFIXADE */
224+
{
225+
intbuffer[]= {SSIN_UACPROC,UAC_SIGBUS |UAC_NOPRINT};
234226

227+
if (setsysinfo(SSI_NVPAIRS,buffer,1, (caddr_t)NULL,
228+
(unsigned long)NULL)<0)
229+
write_stderr("%s: setsysinfo failed: %s\n",
230+
progname,strerror(errno));
231+
}
232+
#endif/* __alpha */
235233

234+
#endif/* NOFIXADE */
235+
236+
/*
237+
* Windows-specific execution environment hacking.
238+
*/
236239
#ifdefWIN32
237240
{
238241
WSADATAwsaData;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp