[LTP] [PATCH] lib: tlibio.c: Restore LIO_IO_SYNCV
Petr Vorel
pvorel@suse.cz
Wed Apr 30 16:41:30 CEST 2025
Hi Cyril,
> There was a single case of "#ifndef CRAY" in all the "#ifdef CRAY"
> macros that got removed accidentally. This patch restores that piece.
> Fixes: fed3e3ee6399 ('lib/tlibio: Get rid of support for old UNIXes')
> Reported-by: Avinesh Kumar <akumar@suse.de>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Thanks for a quick fix!
> ---
> lib/tlibio.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 56 insertions(+), 1 deletion(-)
> diff --git a/lib/tlibio.c b/lib/tlibio.c
> index 451244525..b3e723aa7 100644
> --- a/lib/tlibio.c
> +++ b/lib/tlibio.c
> @@ -767,6 +767,34 @@ int lio_write_buffer(int fd, /* open file descriptor */
> return -errno;
> }
> }
> + else if (method & LIO_IO_SYNCV) {
> + io_type = "writev(2)";
> +
> + sprintf(Lio_SysCall, "writev(%d, &iov, 1) nbyte:%d", fd, size);
> +
> + if (Debug_level) {
> + printf("DEBUG %s/%d: %s\n", __FILE__, __LINE__,
> + Lio_SysCall);
> + }
> + if ((ret = writev(fd, &iov, 1)) == -1) {
> + sprintf(Errormsg,
> + "%s/%d writev(%d, iov, 1) nbyte:%d ret:-1, errno=%d %s",
> + __FILE__, __LINE__, fd, size, errno,
> + strerror(errno));
> + return -errno;
> + }
> +
> + if (ret != size) {
> + sprintf(Errormsg,
> + "%s/%d writev(%d, iov, 1) nbyte:%d returned=%d",
> + __FILE__, __LINE__, fd, size, ret);
> + } else if (Debug_level > 1)
> + printf
> + ("DEBUG %s/%d: writev completed without error (ret %d)\n",
> + __FILE__, __LINE__, ret);
> +
> + return ret;
> + } /* LIO_IO_SYNCV */
> /* LIO_IO_ALISTIO */
> else if (method & LIO_IO_SYNCP) {
> io_type = "pwrite(2)";
> @@ -1150,6 +1178,34 @@ int lio_read_buffer(int fd, /* open file descriptor */
> }
> }
> /* LIO_IO_ALISTIO */
> + else if (method & LIO_IO_SYNCV) {
nit: FYI LIO_IO_ALISTIO was originally on a slightly different place.
Kind regards,
Petr
diff --git lib/tlibio.c lib/tlibio.c
index d6765f8c48..b877393df2 100644
--- lib/tlibio.c
+++ lib/tlibio.c
@@ -767,6 +767,7 @@ int lio_write_buffer(int fd, /* open file descriptor */
return -errno;
}
}
+ /* LIO_IO_ALISTIO */
else if (method & LIO_IO_SYNCV) {
io_type = "writev(2)";
@@ -795,7 +796,6 @@ int lio_write_buffer(int fd, /* open file descriptor */
return ret;
} /* LIO_IO_SYNCV */
- /* LIO_IO_ALISTIO */
else if (method & LIO_IO_SYNCP) {
io_type = "pwrite(2)";
More information about the ltp
mailing list