MCPcopy Create free account
hub / github.com/fmtlib/fmt / pipe

Method pipe

src/os.cc:342–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340# endif
341
342pipe::pipe() {
343 int fds[2] = {};
344# ifdef _WIN32
345 // Make the default pipe capacity same as on Linux 2.6.11+.
346 enum { DEFAULT_CAPACITY = 65536 };
347 int result = FMT_POSIX_CALL(pipe(fds, DEFAULT_CAPACITY, _O_BINARY));
348# else
349 // Don't retry as the pipe function doesn't return EINTR.
350 // http://pubs.opengroup.org/onlinepubs/009696799/functions/pipe.html
351 int result = FMT_POSIX_CALL(pipe(fds));
352# endif
353 if (result != 0)
354 FMT_THROW(system_error(errno, FMT_STRING("cannot create pipe")));
355 // The following assignments don't throw.
356 read_end = file(fds[0]);
357 write_end = file(fds[1]);
358}
359
360# if !defined(__MSDOS__)
361auto getpagesize() -> long {

Callers

nothing calls this directly

Calls 2

system_errorFunction · 0.85
fileFunction · 0.50

Tested by

no test coverage detected