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

Function initMasks

src/backend/postmaster/postmaster.c:2225–2246  ·  view source on GitHub ↗

* Initialise the masks for select() for the ports we are listening on. * Return the number of sockets to listen on. */

Source from the content-addressed store, hash-verified

2223 * Return the number of sockets to listen on.
2224 */
2225static int
2226initMasks(fd_set *rmask)
2227{
2228 int maxsock = -1;
2229 int i;
2230
2231 FD_ZERO(rmask);
2232
2233 for (i = 0; i < MAXLISTEN; i++)
2234 {
2235 int fd = ListenSocket[i];
2236
2237 if (fd == PGINVALID_SOCKET)
2238 break;
2239 FD_SET(fd, rmask);
2240
2241 if (fd > maxsock)
2242 maxsock = fd;
2243 }
2244
2245 return maxsock + 1;
2246}
2247
2248/*
2249 * Once the flag is reset, libpq connections (e.g. FTS probe requests) should

Callers 1

ServerLoopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected