lkml.org 
[lkml]   [2015]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 1/1] ioctl-fat.2: new manpage for the ioctl fat API
Hello Hirofumi,

Thanks for checking the page over.

On 3 February 2015 at 09:51, OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> wrote:
> "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> writes:
>
>> Hello Heinrich and Ogawa,
>
> Hi,
>
>> On 23 January 2015 at 20:54, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>> The ioctl(2) system call may be used to retrieve information about
>>> the fat file system and to set file attributes.
>>>
>>> This new manpage describes the details.
>>
>> @Ogawa, as the FAT maintainer, might you be willing to review this page?
>
>
> for (;;) {
>
> /*
> * Read next directory entry.
> */
> ret = ioctl( fd, VFAT_IOCTL_READDIR_BOTH, entry);
>
> /*
> * If an error occurs, the return value is -1.
> * If d_reclen is zero, the end of the directory
> * list has been reached.
> */
> if (ret == -1 || entry[0].d_reclen == 0)
> break;
>
> 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?

Thanks,

Michael

--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/


\
 
 \ /
  Last update: 2015-02-03 10:41    [W:0.929 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site