I've printed log out in the case of no disk, and the log shows that file
descriptor that I sent to fsync as an argument is 27, and the fsync
functions is called. But I don't know what will fsync do without a disk.
Appreciate for your quick response and great help.

On 01/19/2015 06:30 PM, Stephan Beal wrote:
> On Mon, Jan 19, 2015 at 11:23 AM, Wei, Catherine <catherine....@arris.com>
> wrote:
>
>> Thank you for your answer very much. But I have  removed the disk from
>> my set-up box, the data will be saved in memory and the system doesn't
>> know there's no disk, it will still call fsync. What do you think in
>> this case?
>>
> man fsync says:
>
> SYNOPSIS
>        #include <unistd.h>
>
>        int fsync(int fd);
>
>        int fdatasync(int fd);
>
> DESCRIPTION
>        fsync()  transfers  ("flushes")  all  modified  in-core  data of
> (i.e., modified buffer cache pages for) the file referred to by the file
>        descriptor fd to the disk device (or other permanent storage device)
> ...
>
>
> i.e. if you have no disk (you are using an in-memory VFS), then you have no
> file descriptor, so fsync/datasync _cannot_ be (legally) called.
>

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to