All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/3] syscalls/sendfile: Convert sendfile06 to the new API
Date: Fri, 18 Jun 2021 10:14:54 +0200	[thread overview]
Message-ID: <YMxV/hsYgmegkg5Y@pevik> (raw)
In-Reply-To: <81961ede-0a43-36d5-ce50-996e81daf867@huawei.com>

Hi Ziyao,

> Hi, Petr,

> > > 1. Convert sendfile06 to the new API with file descriptors instead
> > > of socket descriptors.
> > I wonder if this is ok, suppose yes, but better if other check.
> I noticed that it is described in `man 2 sendfile` as follows:

> In Linux kernels before 2.6.33, out_fd must refer to a socket.  Since Linux
> 2.6.33 it can be any file.
+1

> And if we need to cover the case where out_fd is a socket, I suggest adding
> it to sendfile02.c, which tests the basic functionality of the sendfile(),
> just like sendfile07.c:

> in_fd = SAFE_OPEN("in_file", O_RDONLY);

> SAFE_SOCKETPAIR(PF_UNIX, SOCK_DGRAM | SOCK_NONBLOCK, 0, p);
> out_fd = p[1];

Sounds reasonable, but given we test for compilation with 3.10 [1], we can
forget on 2.6.33. We haven't decided the minimal version, maybe we should state
that anything < 3.0 can be removed (it's probably to early to declare 3.10 as
minimal supported version).


> > > 2. Remove the support for UCLINUX.

> > LGTM.
> > Reviewed-by: Petr Vorel <pvorel@suse.cz>

> > ...
> > > +	TEST(sendfile(out_fd, in_fd, NULL, sb.st_size));
> > > +	after_pos = SAFE_LSEEK(in_fd, 0, SEEK_CUR);
> > > +
> > > +	if (TST_RET != sb.st_size)
> > nit: checkpatch.pl complains, it should be if (sb.st_size != TST_RET)
> > (can be fixed during merge)
> Oh yes, sometimes forgot to use checkpatch.pl to check my code files. Thanks
> for your tips, Petr.
np, it's really a detail.

Kind regards,
Petr

> Kind Regards,
> Ziyao

[1] https://github.com/linux-test-project/ltp/wiki/Supported-kernel,-libc,-toolchain-versions

  reply	other threads:[~2021-06-18  8:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03  3:36 [LTP] [PATCH 0/3] Fix and convert sendfile{02, 06} to the new API Xie Ziyao
2021-06-03  3:36 ` [LTP] [PATCH 1/3] syscalls/sendfile: Convert sendfile02 " Xie Ziyao
2021-06-16 14:15   ` Petr Vorel
2021-06-03  3:36 ` [LTP] [PATCH 2/3] syscalls/sendfile: Convert sendfile06 " Xie Ziyao
2021-06-17 20:06   ` Petr Vorel
2021-06-18  3:37     ` Xie Ziyao
2021-06-18  8:14       ` Petr Vorel [this message]
2021-06-18  8:03     ` Cyril Hrubis
2021-06-21 12:12       ` Petr Vorel
2021-06-03  3:36 ` [LTP] [PATCH 3/3] syscalls/sendfile: Remove unnecessary header files Xie Ziyao
2021-06-17 20:08   ` 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=YMxV/hsYgmegkg5Y@pevik \
    --to=pvorel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.