vxworks

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

vxworks

Martin Pfeifle
Hi,
I am in deep trouble. I would like to use sqlite on
vxworks. There are no fysnc, fcntl calls available
which are used in os_unix.c.
Can anybody help me? PLEASE!



       

       
               
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
Reply | Threaded
Open this post in threaded view
|

Re: vxworks

D. Richard Hipp
Martin Pfeifle <[hidden email]> wrote:
> Hi,
> I am in deep trouble. I would like to use sqlite on
> vxworks. There are no fysnc, fcntl calls available
> which are used in os_unix.c.
> Can anybody help me? PLEASE!
>

You can comment-out those function calls.  SQLite will
still work, mostly.  If two or more processes try to
access a database at the same time, they will likely
collide and corruption the database file.  (That is what
fcntl() prevents).  So you should make sure that only
one process is using a database file at a time.  Also,
If you lose power while writing the database file it might
become corrupted.  (fsync() prevents that problem.)
But apart from those two problems, everything should
still work.

Longer term, you should figure out how to lock files
and sync files in vxworks then write a new backend
(call it "os_vxworks.c") specifically designed for that
operating system.

--
D. Richard Hipp <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: vxworks

John Stanton-3
In reply to this post by Martin Pfeifle
Fcntl is only used for locking.  Would your application be multi-user?
if so you could replace the file locking with some form of co-operative
lock or find out if a Windriver alternative file locking mechanism
exists and use it.  I would imagine a single user application can just
omit the locks by using the DJGPP compile option to insert a dummy fcntl.

Fsync just syncs the file by writing through the buffers.  Does Vxworks
have buffering on its file system?  Fsync may be unecessary and you can
compile Sqlite with the SQLITE_NO_SYNC option to omit it.

JS

Martin Pfeifle wrote:

> Hi,
> I am in deep trouble. I would like to use sqlite on
> vxworks. There are no fysnc, fcntl calls available
> which are used in os_unix.c.
> Can anybody help me? PLEASE!
>
>
>
>
>
>
>
> ___________________________________________________________
> Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de

Reply | Threaded
Open this post in threaded view
|

Ant: Re: vxworks

Martin Pfeifle
Hi,
I used the  DJGPP compile option and replaced the
Fsync call by ioctl(fd, FIOSYNC, 0).
I hope this works. Thank you.
Best Martin
--- John Stanton <[hidden email]> schrieb:

> Fcntl is only used for locking.  Would your
> application be multi-user?
> if so you could replace the file locking with some
> form of co-operative
> lock or find out if a Windriver alternative file
> locking mechanism
> exists and use it.  I would imagine a single user
> application can just
> omit the locks by using the DJGPP compile option to
> insert a dummy fcntl.
>
> Fsync just syncs the file by writing through the
> buffers.  Does Vxworks
> have buffering on its file system?  Fsync may be
> unecessary and you can
> compile Sqlite with the SQLITE_NO_SYNC option to
> omit it.
>
> JS
>
> Martin Pfeifle wrote:
> > Hi,
> > I am in deep trouble. I would like to use sqlite
> on
> > vxworks. There are no fysnc, fcntl calls available
> > which are used in os_unix.c.
> > Can anybody help me? PLEASE!
> >
> >
> >
> >
> >
> >
> >
> >
>
___________________________________________________________
>
> > Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher
> kostenlos - Hier anmelden: http://mail.yahoo.de
>
>



       

       
               
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
Reply | Threaded
Open this post in threaded view
|

RE: vxworks

Mr. Tezozomoc
In reply to this post by Martin Pfeifle
We have been successfully been using sqlite in several flavors of Vxworks.

I have ported it over to PPC604, X86, and PC_SIM.

We had to do some kludging to get it to work concurrently and coherently.

1.  We modified os.c and added a semaphore for the singleton file.
2.  We wrote our own arbitration handle between processes.... so, if one
data base is common across tasks, it needs arbitration and separate handles
to it.
3.  If you plan on using in memory databases we switched them over to a ram
drive and it the rest of the arbitration works just fine.

We have used this port successfully across several projects.

Please let me know if this helps.

Tezozomoc.


----Original Message Follows----
From: Martin Pfeifle <[hidden email]>
Reply-To: [hidden email]
To: [hidden email]
Subject: [sqlite] vxworks
Date: Wed, 12 Oct 2005 15:01:32 +0200 (CEST)

Hi,
I am in deep trouble. I would like to use sqlite on
vxworks. There are no fysnc, fcntl calls available
which are used in os_unix.c.
Can anybody help me? PLEASE!







___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden:
http://mail.yahoo.de


Reply | Threaded
Open this post in threaded view
|

SQLite vs. Firebird wiki page

Robert Simpson
I don't really want to update it myself, but under the section regarding the
database sizes being similar -- I've found that not to be the case at least
in the one very simplistic case I tried:

Using the following schema:
CREATE TABLE Foo ([Id] INTEGER NOT NULL PRIMARY KEY)

Inserting 100,000 items into a sqlite and firebird database, then updating
all 100,000 with an UPDATE statement, the final database size was:

SQLite (3.2.5)                 :   819,200 bytes
Firebird (1.5.2.4731 embedded) : 8,736,768 bytes

Robert