MCPcopy Create free account
hub / github.com/apache/cloudberry / InitStandaloneProcess

Function InitStandaloneProcess

src/backend/utils/init/miscinit.c:174–204  ·  view source on GitHub ↗

* Initialize the basic environment for a standalone process. * * argv0 has to be suitable to find the program's executable. */

Source from the content-addressed store, hash-verified

172 * argv0 has to be suitable to find the program's executable.
173 */
174void
175InitStandaloneProcess(const char *argv0)
176{
177 Assert(!IsPostmasterEnvironment);
178
179 InitProcessGlobals();
180
181 /* Initialize process-local latch support */
182 InitializeLatchSupport();
183 MyLatch = &LocalLatchData;
184 InitLatch(MyLatch);
185 InitializeLatchWaitSet();
186
187 /*
188 * For consistency with InitPostmasterChild, initialize signal mask here.
189 * But we don't unblock SIGQUIT or provide a default handler for it.
190 */
191 pqinitmask();
192 PG_SETMASK(&BlockSig);
193
194 /* Compute paths, no postmaster to inherit from */
195 if (my_exec_path[0] == '\0')
196 {
197 if (find_my_exec(argv0, my_exec_path) < 0)
198 elog(FATAL, "%s: could not locate my own executable path",
199 argv0);
200 }
201
202 if (pkglib_path[0] == '\0')
203 get_pkglib_path(my_exec_path, pkglib_path);
204}
205
206void
207SwitchToSharedLatch(void)

Callers 3

PostgresMainFunction · 0.85
CallExtMainFunction · 0.85
AuxiliaryProcessMainFunction · 0.85

Calls 7

InitProcessGlobalsFunction · 0.85
InitializeLatchSupportFunction · 0.85
InitLatchFunction · 0.85
InitializeLatchWaitSetFunction · 0.85
pqinitmaskFunction · 0.85
find_my_execFunction · 0.85
get_pkglib_pathFunction · 0.85

Tested by

no test coverage detected