MCPcopy Create free account
hub / github.com/F-Stack/f-stack / buferror

Function buferror

app/redis-6.2.6/deps/jemalloc/src/malloc_io.c:95–111  ·  view source on GitHub ↗

* glibc provides a non-standard strerror_r() when _GNU_SOURCE is defined, so * provide a wrapper. */

Source from the content-addressed store, hash-verified

93 * provide a wrapper.
94 */
95int
96buferror(int err, char *buf, size_t buflen) {
97#ifdef _WIN32
98 FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0,
99 (LPSTR)buf, (DWORD)buflen, NULL);
100 return 0;
101#elif defined(JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE) && defined(_GNU_SOURCE)
102 char *b = strerror_r(err, buf, buflen);
103 if (b != buf) {
104 strncpy(buf, b, buflen);
105 buf[buflen-1] = '\0';
106 }
107 return 0;
108#else
109 return strerror_r(err, buf, buflen);
110#endif
111}
112
113uintmax_t
114malloc_strtoumax(const char *restrict nptr, char **restrict endptr, int base) {

Callers 5

thd_startFunction · 0.85
mallctl_failureFunction · 0.85
TEST_BEGINFunction · 0.85
TEST_BEGINFunction · 0.85
pages.cFile · 0.85

Calls 1

strncpyFunction · 0.85

Tested by 4

thd_startFunction · 0.68
mallctl_failureFunction · 0.68
TEST_BEGINFunction · 0.68
TEST_BEGINFunction · 0.68