lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKgNAkh81o6FGY-M5HX5Qt+kk9S8SPW+WcqOZBrA+5PdEn+RGg@mail.gmail.com>
Date:	Tue, 3 Feb 2015 10:54:53 +0100
From:	"Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>
To:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Cc:	Heinrich Schuchardt <xypron.glpk@....de>,
	"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
	lkml <linux-kernel@...r.kernel.org>,
	linux-man <linux-man@...r.kernel.org>
Subject: Re: [PATCH v3 1/1] ioctl-fat.2: new manpage for the ioctl fat API

Hello Hirofumi,

On 3 February 2015 at 10:44, OGAWA Hirofumi <hirofumi@...l.parknet.co.jp> wrote:
> "Michael Kerrisk (man-pages)" <mtk.manpages@...il.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) */
>         }

Thanks for the clarification. I have one other question. Currently the
man page does not document two fields in the __fat_dirent structure:
d_ino and d_offset. d_ino is presumably the inode number. But, what is
d_offset?

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ