Call sendfile in a loop to handle short writes
Call sendfile in a loop to handle short writes

(this is a cherry-pick of aosp/1382518)

Bug: 176059199
Change-Id: Id312cceb42aea4f97f9c2f3039ee0dd093fe48b5
Merged-In: Id312cceb42aea4f97f9c2f3039ee0dd093fe48b5

google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto