libcsdbg  1.28
C++ exception (and generic) stack trace debug library
sttybuf & csdbg::sttybuf::sync ( ) const
virtual

Commit cached data to the serial interface line.

Returns
*this
Exceptions
csdbg::exception

Implements csdbg::streambuf.

Definition at line 330 of file sttybuf.cpp.

References m_devnode, csdbg::streambuf::m_handle, and unlikely.

Referenced by flush().

331 {
332  i32 retval;
333  do {
334  retval = tcdrain(m_handle);
335  }
336  while ( unlikely(retval < 0 && errno == EINTR) );
337 
338  if ( unlikely(retval < 0) )
339  throw exception(
340  "failed to flush serial interface '%s' (errno %d - %s)",
341  m_devnode,
342  errno,
343  strerror(errno)
344  );
345 
346  return const_cast<sttybuf&> (*this);
347 }
sttybuf(const i8 *, u32=9600)
Object constructor.
Definition: sttybuf.cpp:67
i32 m_handle
Stream handle (descriptor)
Definition: streambuf.hpp:43
i8 * m_devnode
Device node file (devfs)
Definition: sttybuf.hpp:34
int i32
32-bit signed integer
Definition: config.hpp:82
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349

+ Here is the caller graph for this function: