<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def safe_write(buf):
 """We can get a SIGWINCH when printing, which will cause write to raise an EINTR. That's not a reason to stop printing."""

    assert isinstance(buf, bytes)
    while True:
        try:
            os.write(1, buf)
            break
        except IOError as e:
            if e.errno != errno.EINTR:
                raise