1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-15 03:41:20 +03:00

Provide helper for retrying partial vectored I/O.

compute_remaining_iovec() is a re-usable routine for retrying after
pg_readv() or pg_writev() reports a short transfer.  This will gain new
users in a later commit, but can already replace the open-coded
equivalent code in the existing pg_pwritev_with_retry() function.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/CA+hUKGJkOiOCa+mag4BF+zHo7qo=o9CFheB8=g6uT5TUm2gkvA@mail.gmail.com
This commit is contained in:
Thomas Munro
2023-12-12 10:28:46 +13:00
parent baf7c93ed5
commit 0c6be59f5e
2 changed files with 57 additions and 25 deletions

View File

@@ -46,6 +46,11 @@ extern PGFileType get_dirent_type(const char *path,
bool look_through_symlinks,
int elevel);
extern int compute_remaining_iovec(struct iovec *destination,
const struct iovec *source,
int iovcnt,
size_t transferred);
extern ssize_t pg_pwritev_with_retry(int fd,
const struct iovec *iov,
int iovcnt,