MCPcopy Create free account
hub / github.com/Warzone2100/warzone2100 / writeAll

Function writeAll

lib/exceptionhandler/exceptionhandler.cpp:366–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366static ssize_t writeAll(int const fd, const char* const str)
367{
368 size_t const to_write = strlen(str);
369 size_t written = 0;
370 while (written < to_write)
371 {
372 ssize_t ret = write(fd, str + written, to_write - written);
373 if (ret == -1)
374 {
375 switch (errno)
376 {
377 case EAGAIN:
378#if defined(EWOULDBLOCK) && EAGAIN != EWOULDBLOCK
379 case EWOULDBLOCK:
380#endif
381 case EINTR:
382 continue;
383 default:
384 return -1;
385 }
386 }
387 written += ret;
388 }
389
390 return written;
391}
392
393/**
394 * Spawn a new GDB process and attach it to the current process.

Callers 3

execGdbFunction · 0.85
gdbExtendedBacktraceFunction · 0.85
posixExceptionHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected