[ECOS] Filesystem get/setinfo
Savin Zlobec
savin@elatec.si
Thu Oct 23 12:33:00 GMT 2003
Nick Garnett wrote:
>Savin Zlobec <savin.zlobec@email.si> writes:
>
>
>
>>On Mon, 20 Oct 2003 at 19:07:19, Nick Garnett wrote:
>>
>>
>>
>>>Savin Zlobec <savin@elatec.si> 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.
>
Here it is
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fileio.diff
URL: <http://sourceware.org/pipermail/ecos-patches/attachments/20031023/92269130/attachment.ksh>
More information about the Ecos-patches
mailing list