lib: util: Add sys_pwrite_full().
authorJeremy Allison <jra@samba.org>
Thu, 7 May 2020 19:34:32 +0000 (12:34 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 14 May 2020 07:25:44 +0000 (07:25 +0000)
commit6c51b56282bf4b34433dd5718a75d2fa7d85adf1
tree9f2c41a38a850081e825777ccb365731d631e296
parent442fa5a97829c0a8bb293ffe224c7b08c743f8ad
lib: util: Add sys_pwrite_full().

A pwrite wrapper that will deal with EINTR and never return a short
write unless the file system returns an error. Copes with the
unspecified edge condition of pwrite returning zero by changing
the return to -1, errno = ENOSPC.

Thread-safe so may be used as a replacement for pwrite
inside pwrite_do() thread functions.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14361

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 3ba7a89cea85d134eacf1e624e011fe6f66146fc)
lib/util/sys_rw.c
lib/util/sys_rw.h