Re: [Yaffs] Yaffs memory full handling

Páxina inicial
Anexos:
Mensaxe orixinal
+ (text/plain)
+ (text/html)
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Charles Manning
Data:  
Para: 曾炫錡
CC: yaffs
Asunto: Re: [Yaffs] Yaffs memory full handling
yaffs_freespace() provides a rougher guess of the space. You could use
that, but clearly there are threading issues if you do it that way.

yaffs_write() will return the number of bytes written.

ret = yaffs_write(...);
if ( ret != write_size)
SetMemFullError();


Regards

Charles





On Thu, Apr 14, 2016 at 7:42 PM, 曾炫錡 <> wrote:

> Hi, I am developing YAFFS2 on ThreadX, in my application it need report
> error
> message for user when flash memory storage full, how could I detect this
> error
> by YAFFS service ? Is it suitable to check yaffs_freespace("mount_path")
> before
> yaffs_write such as:
>
> fwrite(int fd, u8* buf, int size)
> {
>     if( size>yaffs_freespace("mount_path"))
>        SetMemFullErr( );

>
> yaffs_write(fd, (const void*)buf, size);
> }
>
> Best Regards,
> Ski Tseng
>
> _______________________________________________
> yaffs mailing list
>
> http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
>
>