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

Function interactive_getc

src/backend/tcop/postgres.c:420–442  ·  view source on GitHub ↗

* interactive_getc -- collect one character from stdin * * Even though we are not reading from a "client" process, we still want to * respond to signals, particularly SIGTERM/SIGQUIT. */

Source from the content-addressed store, hash-verified

418 * respond to signals, particularly SIGTERM/SIGQUIT.
419 */
420static int
421interactive_getc(void)
422{
423 int c;
424
425 /*
426 * This will not process catchup interrupts or notifications while
427 * reading. But those can't really be relevant for a standalone backend
428 * anyway. To properly handle SIGTERM there's a hack in die() that
429 * directly processes interrupts at this stage...
430 */
431 CHECK_FOR_INTERRUPTS();
432
433 enable_client_wait_timeout_interrupt();
434
435 c = getc(stdin);
436
437 disable_client_wait_timeout_interrupt();
438
439 ProcessClientReadInterrupt(false);
440
441 return c;
442}
443
444/* ----------------
445 * SocketBackend() Is called for frontend-backend connections

Callers 1

InteractiveBackendFunction · 0.85

Tested by

no test coverage detected