All of lore.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-man <linux-man@vger.kernel.org>
Subject: Re: [PATCH v3 1/1] ioctl-fat.2: new manpage for the ioctl fat API
Date: Tue, 03 Feb 2015 18:44:46 +0900	[thread overview]
Message-ID: <87fvane3ch.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <CAKgNAkhrvdAauGAQOukGQ6B8MJ3kbYWivvrzzMJMaQOKsCq4sA@mail.gmail.com> (Michael Kerrisk's message of "Tue, 3 Feb 2015 10:24:42 +0100")

"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> writes:

>> Quick reviewed, and looks good. However, entry[0].d_reclen == 0 works as
>> backward compatibility though. The example might be good to use usual
>> way of getdents().
>>
>> I.e., "ret" means
>>         -1 == error
>>         0  == EOD
>>         0  >  how many bytes read
>
> Sorry -- I do not really understand what you mean here
> "entry[0].d_reclen == 0 works as backward compatibility though"). Is
> the line
>
>                     if (ret == -1 || entry[0].d_reclen == 0)
>
> incorrect? If yes, what should the code look like?

Sorry. I meant, "entry[0].d_reclen == 0" check works because fatfs still
have backward compatibility code. However it would not be preferred way.

In ancient version, fatfs didn't return proper return code, so apps (I
know only use is wine) had to check "entry[0].d_reclen == 0" to know
EOD.

But for a long time, fatfs returns proper return code like said in
previous email (previous email was wrong on "0 > how many bytes read",
see below instead). I.e., now user can use "ret" as similar to
getdents(), user can know the result as usual from "ret" without
"entry[0].d_reclen == 0".

	while (1) {
		ret = ioctl();
	        if (ret == -1) {
	        	/* error */

		if (ret == 0)
			/* EOD */

	       	/* got entry (would be ret == 1) */
	}
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

WARNING: multiple messages have this Message-ID (diff)
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: "Michael Kerrisk \(man-pages\)" <mtk.manpages@gmail.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	"linux-fsdevel\@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-man <linux-man@vger.kernel.org>
Subject: Re: [PATCH v3 1/1] ioctl-fat.2: new manpage for the ioctl fat API
Date: Tue, 03 Feb 2015 18:44:46 +0900	[thread overview]
Message-ID: <87fvane3ch.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <CAKgNAkhrvdAauGAQOukGQ6B8MJ3kbYWivvrzzMJMaQOKsCq4sA@mail.gmail.com> (Michael Kerrisk's message of "Tue, 3 Feb 2015 10:24:42 +0100")

"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> writes:

>> Quick reviewed, and looks good. However, entry[0].d_reclen == 0 works as
>> backward compatibility though. The example might be good to use usual
>> way of getdents().
>>
>> I.e., "ret" means
>>         -1 == error
>>         0  == EOD
>>         0  >  how many bytes read
>
> Sorry -- I do not really understand what you mean here
> "entry[0].d_reclen == 0 works as backward compatibility though"). Is
> the line
>
>                     if (ret == -1 || entry[0].d_reclen == 0)
>
> incorrect? If yes, what should the code look like?

Sorry. I meant, "entry[0].d_reclen == 0" check works because fatfs still
have backward compatibility code. However it would not be preferred way.

In ancient version, fatfs didn't return proper return code, so apps (I
know only use is wine) had to check "entry[0].d_reclen == 0" to know
EOD.

But for a long time, fatfs returns proper return code like said in
previous email (previous email was wrong on "0 > how many bytes read",
see below instead). I.e., now user can use "ret" as similar to
getdents(), user can know the result as usual from "ret" without
"entry[0].d_reclen == 0".

	while (1) {
		ret = ioctl();
	        if (ret == -1) {
	        	/* error */

		if (ret == 0)
			/* EOD */

	       	/* got entry (would be ret == 1) */
	}
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

  reply	other threads:[~2015-02-03  9:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKgNAkhuGYKtUKkm2+wU+TwQb6iZ+EmnLDdr4qg4fWHJyL9K5A@mail.gmail.com>
     [not found] ` <CAKgNAkhuGYKtUKkm2+wU+TwQb6iZ+EmnLDdr4qg4fWHJyL9K5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-23 19:54   ` [PATCH v3 1/1] ioctl-fat.2: new manpage for the ioctl fat API Heinrich Schuchardt
2015-01-23 19:54     ` Heinrich Schuchardt
2015-02-03  8:25     ` Michael Kerrisk (man-pages)
2015-02-03  8:51       ` OGAWA Hirofumi
2015-02-03  8:51         ` OGAWA Hirofumi
     [not found]         ` <87k2zze5tg.fsf-UIVanBePwB70ZhReMnHkpc8NsWr+9BEh@public.gmane.org>
2015-02-03  9:24           ` Michael Kerrisk (man-pages)
2015-02-03  9:24             ` Michael Kerrisk (man-pages)
2015-02-03  9:44             ` OGAWA Hirofumi [this message]
2015-02-03  9:44               ` OGAWA Hirofumi
     [not found]               ` <87fvane3ch.fsf-UIVanBePwB70ZhReMnHkpc8NsWr+9BEh@public.gmane.org>
2015-02-03  9:54                 ` Michael Kerrisk (man-pages)
2015-02-03  9:54                   ` Michael Kerrisk (man-pages)
2015-02-03 10:05                   ` OGAWA Hirofumi
2015-02-03 10:05                     ` OGAWA Hirofumi
2015-02-06 22:10                 ` [PATCH 1/1] ioctl_fat.2: d_ino, d_off, return value explained Heinrich Schuchardt
     [not found]                   ` <1423260638-23504-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
2015-02-09  8:12                     ` Michael Kerrisk (man-pages)
2015-02-03  8:49     ` [PATCH v3 1/1] ioctl-fat.2: new manpage for the ioctl fat API Andreas Dilger
     [not found]       ` <5984550D-1518-490C-9A3F-3F9B1FA2EA00-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org>
2015-02-03  9:21         ` Michael Kerrisk (man-pages)
2015-02-03  9:21           ` Michael Kerrisk (man-pages)
     [not found]           ` <CAKgNAki1EnYx+chg1eouwF54youb_tjQ+hW9Ea_M_=cvccu1nA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-03  9:48             ` Andreas Dilger
2015-02-03  9:48               ` Andreas Dilger
2015-02-03  9:55               ` Michael Kerrisk (man-pages)
2015-02-03 10:10                 ` OGAWA Hirofumi
2015-02-03 10:10                   ` OGAWA Hirofumi

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=87fvane3ch.fsf@mail.parknet.co.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=xypron.glpk@gmx.de \
    /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.