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

Function gzdopen

freebsd/contrib/zstd/zlibWrapper/gzlib.c:289–306  ·  view source on GitHub ↗

-- see zlib.h -- */

(fd, mode)

Source from the content-addressed store, hash-verified

287
288/* -- see zlib.h -- */
289gzFile ZEXPORT gzdopen(fd, mode)
290 int fd;
291 const char *mode;
292{
293 char *path; /* identifier for error messages */
294 gzFile gz;
295
296 if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
297 return NULL;
298#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
299 (void)snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd);
300#else
301 sprintf(path, "<fd:%d>", fd); /* for debugging */
302#endif
303 gz = gz_open(path, fd, mode);
304 free(path);
305 return gz;
306}
307
308/* -- see zlib.h -- */
309#ifdef WIDECHAR

Callers

nothing calls this directly

Calls 5

mallocFunction · 0.85
snprintfFunction · 0.85
sprintfFunction · 0.85
gz_openFunction · 0.70
freeFunction · 0.50

Tested by

no test coverage detected