From mboxrd@z Thu Jan 1 00:00:00 1970 From: OGAWA Hirofumi 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 Message-ID: <87fvane3ch.fsf@mail.parknet.co.jp> References: <1422042884-10824-1-git-send-email-xypron.glpk@gmx.de> <87k2zze5tg.fsf@mail.parknet.co.jp> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: (Michael Kerrisk's message of "Tue, 3 Feb 2015 10:24:42 +0100") Sender: linux-fsdevel-owner@vger.kernel.org To: "Michael Kerrisk (man-pages)" Cc: Heinrich Schuchardt , "linux-fsdevel@vger.kernel.org" , lkml , linux-man List-Id: linux-man@vger.kernel.org "Michael Kerrisk (man-pages)" 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: OGAWA Hirofumi 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 Message-ID: <87fvane3ch.fsf@mail.parknet.co.jp> References: <1422042884-10824-1-git-send-email-xypron.glpk@gmx.de> <87k2zze5tg.fsf@mail.parknet.co.jp> Mime-Version: 1.0 Content-Type: text/plain Cc: Heinrich Schuchardt , "linux-fsdevel\@vger.kernel.org" , lkml , linux-man To: "Michael Kerrisk \(man-pages\)" Return-path: Received: from mail.parknet.co.jp ([210.171.160.6]:54924 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752637AbbBCJov (ORCPT ); Tue, 3 Feb 2015 04:44:51 -0500 In-Reply-To: (Michael Kerrisk's message of "Tue, 3 Feb 2015 10:24:42 +0100") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: "Michael Kerrisk (man-pages)" 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