]> xenbits.xensource.com Git - xen.git/commit
tools/libxs: Use writev()/sendmsg() instead of write()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 18 Jul 2024 11:55:48 +0000 (12:55 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 23 Jul 2024 14:11:27 +0000 (15:11 +0100)
commitebaeb0c64a6d363313e213eb9995f48307604ebb
treeab5b1ef5c27457893d74bf0b7a5b49de2d753d55
parent046efe529e82b8b999d8453d4ea49cb817c3f9b5
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>
tools/libs/store/xs.c