RE: [sqlite] vxworks

2005-10-12 Thread Mr. Tezozomoc

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 <[EMAIL PROTECTED]>
Reply-To: sqlite-users@sqlite.org
To: sqlite-users@sqlite.org
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





Ant: Re: [sqlite] vxworks

2005-10-12 Thread 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 <[EMAIL PROTECTED]> 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


Re: [sqlite] vxworks

2005-10-12 Thread John Stanton
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




Re: [sqlite] vxworks

2005-10-12 Thread drh
Martin Pfeifle <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>