]> xenbits.xensource.com Git - xen.git/commit
tools/libxs: Use writev()/sendmsg() instead of write()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 25 Nov 2024 10:53:44 +0000 (11:53 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 25 Nov 2024 10:53:44 +0000 (11:53 +0100)
commit823abf095561a389b38d5aba37307ac15bf4b70d
tree1b889de4f5900045eff068bc0013257df01da2da
parentc991b585c47177bf96afc1aa55fb8cb2a7dd20c5
tools/libxs: Use writev()/sendmsg() instead of write()

With the input data now conveniently arranged, use writev()/sendmsg() instead
of decomposing it into write() calls.

This causes all requests to be submitted with a single system call, rather
than at least two.  While in principle short writes can occur, the chances of
it happening are slim given that most xenbus comms are only a handful of
bytes.

Nevertheless, provide {writev,sendmsg}_exact() wrappers which take care of
resubmitting on EINTR or short write.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
master commit: ebaeb0c64a6d363313e213eb9995f48307604ebb
master date: 2024-07-23 15:11:27 +0100
tools/libs/store/xs.c