From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10547 invoked by alias); 22 Oct 2003 09:32:02 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 10526 invoked from network); 22 Oct 2003 09:32:01 -0000 Received: from unknown (HELO anchor-post-35.mail.demon.net) (194.217.242.85) by sources.redhat.com with SMTP; 22 Oct 2003 09:32:01 -0000 Received: from calivar.demon.co.uk ([212.228.213.211] helo=miso.calivar.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.35 #1) id 1ACFLU-0000c6-0Z; Wed, 22 Oct 2003 10:32:00 +0100 Received: from miso.calivar.com (miso.calivar.com [127.0.0.2]) by miso.calivar.com (Postfix) with ESMTP id 0AD7F28DF46; Wed, 22 Oct 2003 10:31:58 +0100 (BST) To: Savin Zlobec Cc: ecos-discuss@sources.redhat.com References: <3F93D904.7090204@elatec.si> <20031020182517.3DFE08BA45@www.email.si> From: Nick Garnett Date: Wed, 22 Oct 2003 09:32:00 -0000 In-Reply-To: <20031020182517.3DFE08BA45@www.email.si> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [ECOS] Filesystem get/setinfo X-SW-Source: 2003-10/txt/msg00391.txt.bz2 Savin Zlobec writes: > On Mon, 20 Oct 2003 at 19:07:19, Nick Garnett wrote: > > > Savin Zlobec writes: > > > > > I need to write some filesystem specific functions. > > > The get/setinfo calls seem to be the right way to do this, > > > but I can't find any functions to access them from my application. > > > > > > The following functions would do the trick for me: > > > > > > int cyg_fs_getinfo(const char *path, int key, void *buf, int len); > > > int cyg_fs_setinfo(const char *path, int key, void *buf, int len); > > > int cyg_fs_fgetinfo(int fd, int key, void *buf, int len); > > > int cyg_fs_fsetinfo(int fd, int key, void *buf. int len); > > > > > > Or is there any way to do this already without accessing internal > > > structures? > > > > For filesystems you should be using ioctl() for these sorts of > > out-of-band control operations. That's what it's there for, and more > > than likely there is already a code defined for what you want to do. > > I could work with ioctl, but if the desired operation is filesystem > oriented (as opposed to file oriented), then I would need to open a > file just to get a file descriptor for use with ioctl. > > > What do you need these functions for? > > Currently I need fs info like total/free/used sectors count, > status flags (if it was cleanly unmounted and if there were any IO errors). > Later I may need some sort of special access to reserved sectors... I see. Like mount()/umount() POSIX has not defined interface for these sorts of things. Given that, then the functions you propose are probably a worthwhile addition. If you would like to submit a patch I'm sure that it will be accepted. -- Nick Garnett eCos Kernel Architect http://www.ecoscentric.com The eCos and RedBoot experts -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss