Linux Test Project
 help / color / mirror / Atom feed
From: Avinesh Kumar <akumar@suse.de>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] lib: tlibio.c: Restore LIO_IO_SYNCV
Date: Wed, 30 Apr 2025 16:41:11 +0200	[thread overview]
Message-ID: <12656046.O9o76ZdvQC@thinkpad> (raw)
In-Reply-To: <20250430133615.15571-1-chrubis@suse.cz>

On Wednesday, April 30, 2025 3:36:15 PM CEST Cyril Hrubis wrote:
> 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>

Thank you Cyril!

Tested-by: Avinesh Kumar <akumar@suse.de>

> ---
>  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) {
> +		io_type = "readv(2)";
> +
> +		sprintf(Lio_SysCall, "readv(%d, &iov, 1) nbyte:%d", fd, size);
> +
> +		if (Debug_level) {
> +			printf("DEBUG %s/%d: %s\n", __FILE__, __LINE__,
> +			       Lio_SysCall);
> +		}
> +		if ((ret = readv(fd, &iov, 1)) == -1) {
> +			sprintf(Errormsg,
> +				"%s/%d readv(%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 readv(%d, iov, 1) nbyte:%d returned=%d",
> +				__FILE__, __LINE__, fd, size, ret);
> +		} else if (Debug_level > 1)
> +			printf
> +			    ("DEBUG %s/%d: readv completed without error (ret %d)\n",
> +			     __FILE__, __LINE__, ret);
> +
> +		return ret;
> +	}			/* LIO_IO_SYNCV */
>  	else if (method & LIO_IO_SYNCP) {
>  		io_type = "pread(2)";
>  
> 

Regards,
Avinesh



-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2025-04-30 14:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30 13:36 [LTP] [PATCH] lib: tlibio.c: Restore LIO_IO_SYNCV Cyril Hrubis
2025-04-30 14:41 ` Avinesh Kumar [this message]
2025-04-30 14:41 ` Petr Vorel
2025-04-30 15:19   ` Petr Vorel
2025-04-30 14:48 ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12656046.O9o76ZdvQC@thinkpad \
    --to=akumar@suse.de \
    --cc=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox