MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3-linux / alloc_sysconf_buffer

Function alloc_sysconf_buffer

src/common/lookup.cpp:41–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40
41static inline char *alloc_sysconf_buffer(int name, size_t *retlen)
42{
43 long buflen = sysconf(name);
44 if (buflen == -1)
45 {
46 // Some Linux distributions/libc libraries may fail to lookup the
47 // the proper sysconf() value. Fallback to a reasonable size most
48 // likely large enough. This is a known issue with Alpine Linux.
49 buflen = 16384;
50 }
51 *retlen = buflen;
52 char *retbuf = (char *)malloc((size_t)buflen);
53 memset(retbuf, 0, buflen);
54 return retbuf;
55}
56
57
58/**

Callers 3

lookup_usernameFunction · 0.85
lookup_uidFunction · 0.85
lookup_gidFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected