Re: [sqlite] HELP sqlite3 used in vxworks has some problem

2014-09-04 Thread Andy Ling
> > > Please try the patch at
> > >
> http://www.sqlite.org/src/info/b0f6b91f36b503d8ba8d5257bb194f8c1afb483
> > > 3 and
> > > see if that fixes the problem.
> > >
> >
> > I think that fixes unixDelete. Running on the vxWorks dosFs disk
> > everything works as before.
> >
> > If I use the host filing system, then I think the delete of the
> > non-existent file works, but it then fails in unixSync followed by a fail
> > in unixDelete
> >
> > os_unix.c:27830: (35) full_fsync(/tgtsvr/testdb.sql-journal) -  (1034)
> >
> 
> 
> Error code 35 is ENOTSUP - fsync is apparently not supported on your
> filesystem.
> 

I have asked WindRiver about the various issues we have seen and their initial 
response was...

 An errno of EACCES is set by the hostFS and unfortunately it’s not 
aligned
 with POSIX errno. I have suggested to our developers to update that 
and it’s
 tracked internally as VXW6-83401 but the request will be considered an
 enhancement and the decision will be taken later in time when the 
product management
 team will decide to implement it.

 The fsync is indeed not supported on hostFS so the error is expected. 
Because the target
 server connection is mostly used for debugging sessions implementing 
POSIX API is not in plan.

I did query whether fsync is just "unnecessary" and whether it could be made a 
no-op that
just returned OK. So far I haven't had a response.

I did wonder whether the ENOTSUP error could be ignored for vxWorks. It seems 
vaguely reasonable
that if fsync is not supported it isn't needed so SQLite could just ignore the 
error.

I did complain to WindRiver that this mess of differences between filing 
systems makes writing
portable code very difficult. Again, I haven't had a reply.

Regards

Andy Ling




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


Re: [sqlite] HELP sqlite3 used in vxworks has some problem

2014-09-02 Thread 王庆刚

Thank  Andy Ling. best wishes.
 
 
regards
 
Wang Qinggang.







At 2014-09-02 09:45:47, "Andy Ling" <andy.l...@quantel.com> wrote:
>> -Original Message-
>> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
>> boun...@sqlite.org] On Behalf Of ???
>> Sent: 02 September 2014 13:41
>> To: General Discussion of SQLite Database
>> Subject: Re: [sqlite] HELP sqlite3 used in vxworks has some problem
>> 
>> 
>> 
>> firstly :
>> Even if I used
>> #if OS_VXWORKS
>> || osAccess(zPath,0) != 0
>> #endif
>> 
>> 
>> or I used
>> #if OS_VXWORKS
>> }else if(errno == 0x380003 || errno == 13 )
>>   rc  = SQLITE_IOERR_DELETE_NOENT:
>> #endif
>> 
>> 
>> Without the SQLITE_ENABLE_LOCKING_STYLE compile option, I tried the
>> above two method, but  it still told me the error : disk I/o error.
>> 
>
>If you read what I wrote in the email you are answering, you will see that the 
>problem is that the host file system does not support fsync.
>
>So the short answer is that you cannot use SQLite with a database that is 
>stored on your host PC. You must use a file system that is part of the target 
>system.
>
>Regards
>
>Andy Ling
>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has some problem

2014-09-02 Thread Andy Ling
> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of ???
> Sent: 02 September 2014 13:41
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] HELP sqlite3 used in vxworks has some problem
> 
> 
> 
> firstly :
> Even if I used
> #if OS_VXWORKS
> || osAccess(zPath,0) != 0
> #endif
> 
> 
> or I used
> #if OS_VXWORKS
> }else if(errno == 0x380003 || errno == 13 )
>   rc  = SQLITE_IOERR_DELETE_NOENT:
> #endif
> 
> 
> Without the SQLITE_ENABLE_LOCKING_STYLE compile option, I tried the
> above two method, but  it still told me the error : disk I/o error.
> 

If you read what I wrote in the email you are answering, you will see that the 
problem is that the host file system does not support fsync.

So the short answer is that you cannot use SQLite with a database that is 
stored on your host PC. You must use a file system that is part of the target 
system.

Regards

Andy Ling

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


Re: [sqlite] HELP sqlite3 used in vxworks has some problem

2014-09-02 Thread 王庆刚


firstly :
Even if I used 
#if OS_VXWORKS
|| osAccess(zPath,0) != 0
#endif


or I used 
#if OS_VXWORKS
}else if(errno == 0x380003 || errno == 13 )
  rc  = SQLITE_IOERR_DELETE_NOENT:
#endif 


Without the SQLITE_ENABLE_LOCKING_STYLE compile option, I tried the above two 
method, but  it still told me the error : disk I/o error.


secondly,
I found another problem. When I download the *.out file, it tells me Unresolved 
Symbols List: sem_post, ftruncate, sem_trywait,sem_open.
when building with spec:PPC604gnu, have the above problem, build spec:SIMNTdiab 
do not. 









At 2014-09-01 11:40:53, "Andy Ling" <andy.l...@quantel.com> wrote:
>
>
>> -Original Message-
>> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
>> boun...@sqlite.org] On Behalf Of Richard Hipp
>> Sent: 01 September 2014 15:30
>> To: General Discussion of SQLite Database
>> Subject: Re: [sqlite] HELP sqlite3 used in vxworks has some problem
>> > > Please try the patch at
>> > >
>> http://www.sqlite.org/src/info/b0f6b91f36b503d8ba8d5257bb194f8c1afb483
>> > > 3 and
>> > > see if that fixes the problem.
>> > >
>> >
>> > I think that fixes unixDelete. Running on the vxWorks dosFs disk
>> > everything works as before.
>> >
>> > If I use the host filing system, then I think the delete of the
>> > non-existent file works, but it then fails in unixSync followed by a fail
>> > in unixDelete
>> >
>> > os_unix.c:27830: (35) full_fsync(/tgtsvr/testdb.sql-journal) -  (1034)
>> >
>> 
>> 
>> Error code 35 is ENOTSUP - fsync is apparently not supported on your
>> filesystem.
>> 
>
>OK. So it sounds like the answer to Wang Qinggang at the moment is that the 
>host filing system is not supported.
>
>I'm slightly surprised fsync isn't supported, but a quick test here proves 
>that it isn't. I will try and raise it with WindRiver and see what they say. 
>It may be a general problem with any network filing system under vxWorks.
>
>I'm happy that dosFs works. That's all I need for the time being.
>
>Regards
>
>Andy Ling
>
>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has some problem

2014-09-01 Thread Andy Ling


> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Richard Hipp
> Sent: 01 September 2014 15:30
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] HELP sqlite3 used in vxworks has some problem
> > > Please try the patch at
> > >
> http://www.sqlite.org/src/info/b0f6b91f36b503d8ba8d5257bb194f8c1afb483
> > > 3 and
> > > see if that fixes the problem.
> > >
> >
> > I think that fixes unixDelete. Running on the vxWorks dosFs disk
> > everything works as before.
> >
> > If I use the host filing system, then I think the delete of the
> > non-existent file works, but it then fails in unixSync followed by a fail
> > in unixDelete
> >
> > os_unix.c:27830: (35) full_fsync(/tgtsvr/testdb.sql-journal) -  (1034)
> >
> 
> 
> Error code 35 is ENOTSUP - fsync is apparently not supported on your
> filesystem.
> 

OK. So it sounds like the answer to Wang Qinggang at the moment is that the 
host filing system is not supported.

I'm slightly surprised fsync isn't supported, but a quick test here proves that 
it isn't. I will try and raise it with WindRiver and see what they say. It may 
be a general problem with any network filing system under vxWorks.

I'm happy that dosFs works. That's all I need for the time being.

Regards

Andy Ling


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


Re: [sqlite] HELP sqlite3 used in vxworks has some problem

2014-09-01 Thread Richard Hipp
On Mon, Sep 1, 2014 at 10:15 AM, Andy Ling  wrote:

> > -Original Message-
> > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> > boun...@sqlite.org] On Behalf Of Richard Hipp
> > Sent: 01 September 2014 14:39
> > To: General Discussion of SQLite Database
> > Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
> >
> > Please try the patch at
> > http://www.sqlite.org/src/info/b0f6b91f36b503d8ba8d5257bb194f8c1afb483
> > 3 and
> > see if that fixes the problem.
> >
>
> I think that fixes unixDelete. Running on the vxWorks dosFs disk
> everything works as before.
>
> If I use the host filing system, then I think the delete of the
> non-existent file works, but it then fails in unixSync followed by a fail
> in unixDelete
>
> os_unix.c:27830: (35) full_fsync(/tgtsvr/testdb.sql-journal) -  (1034)
>


Error code 35 is ENOTSUP - fsync is apparently not supported on your
filesystem.



> Error deleting file /tgtsvr/testdb.sql-journal errno 13
> os_unix.c:30167: (13) unlink(/tgtsvr/testdb.sql-journal) -  (2570)
> Error executing statement CREATE TABLE t (id INTEGER PRIMARY KEY ASC) -
> disk I/O error
> Error message disk I/O error
>
> Regards
>
> Andy Ling
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] HELP sqlite3 used in vxworks has some problem

2014-09-01 Thread Andy Ling
> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Richard Hipp
> Sent: 01 September 2014 14:39
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
> 
> Please try the patch at
> http://www.sqlite.org/src/info/b0f6b91f36b503d8ba8d5257bb194f8c1afb483
> 3 and
> see if that fixes the problem.
> 

I think that fixes unixDelete. Running on the vxWorks dosFs disk everything 
works as before.

If I use the host filing system, then I think the delete of the non-existent 
file works, but it then fails in unixSync followed by a fail in unixDelete

os_unix.c:27830: (35) full_fsync(/tgtsvr/testdb.sql-journal) -  (1034)
Error deleting file /tgtsvr/testdb.sql-journal errno 13
os_unix.c:30167: (13) unlink(/tgtsvr/testdb.sql-journal) -  (2570)
Error executing statement CREATE TABLE t (id INTEGER PRIMARY KEY ASC) - disk 
I/O error
Error message disk I/O error

Regards

Andy Ling


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


Re: [sqlite] HELP sqlite3 used in vxworks has some problem

2014-09-01 Thread Andy Ling
> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Jan Nijtmans
> Sent: 01 September 2014 12:29
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?
> 
> 2014-09-01 13:04 GMT+02:00 Andy Ling :
> > Although this doesn't feel right having to keep extending the list of error
> codes that are checked.
> > I'm not sure what else can be done though. Maybe some compile options
> that let you choose.
> 
> Here is a list of possible error-codes I found:
> 
>  >

That list is from an older version of vxWorks (5.5). So some things have 
changed slightly.

> 
> The value 13 is listed here as EACCES, I really doubt this one
> should be added: If there really is an access problem, I
> think that shouldn't be masked.
> 

That code is still as listed. I suspect the problem is vxWorks can't tell the 
difference between
a file not there and not being able to access the file. Although see later...

> There are two entries that end with _FILE_NOT_FOUND, the other one is:
> 1310723  0x140003  S_rt11FsLib_FILE_NOT_FOUND
> This suggests that for VxWorks an additional check for 0x140003
> might work if you use the rt11 filesystem (whatever that is .)
> 

rt11 is not supported any longer. It harks back to the days of the LSI11 and 
DEC. rt11 was the
OS DEC used then. It was a bit like a cut down version of VMS.

> Other possible candidates:
> 2686989  0x29000d  S_netDrv_NO_SUCH_FILE_OR_DIR
> 2949130  0x2d000a  S_nfsDrv_NO_SUCH_FILE_OR_DIR
> 7602186  0x74000a  S_cdromFsLib_NO_SUCH_FILE_OR_DIRECTORY
> 

They are still current.

vxWorks now includes the TrueFlashFilingSystem which has the error code

13303810  0xcb0002  S_tffsLib_FILE_NOT_FOUND

I have done some more investigation accessing the host file system.
First, running unlink from the command line. Calling unlink for a file that 
exists works correctly. It deletes the file and returns OK. Calling unlink for 
a file that doesn't exist returns error and sets errno to EACCES. So this may 
be a bug or vxWorks may not be able to tell when talking over a network. If I 
get time I will put in a call to WindRiver to see what the official line is.

So I added the check in unixDelete for errno 13 to see what happens.

The open does create a database file on my host PC. The create table still 
fails with a disk I/O error, but it gets a bit further.
I've added a print in unixLogError and it prints the following...

os_unix.c:27830: (35) full_fsync(/tgtsvr/testdb.sql-journal) -  (1034)

The 1034 on the end is errno.

So it is failing in unixSync. It has created the testdb.sql-journal file and it 
is 512 bytes long. So I suspect things are working, but the error checks don't 
think they are. At this point I probably need more help to save me wasting too 
much time.

Personally I'm not sure how much effort needs to be put into this if it is only 
the host file system that is a problem. Most vxWorks systems would only be 
using the host filing system during development.

Regards

Andy Ling

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