Freedos rlock()

161 views
Skip to first unread message

António

unread,
Feb 24, 2016, 2:22:04 PM2/24/16
to Harbour Users
Dear All,
I've been using Windows and Linux Habour applications, happily co-existing with Clipper 5.2 compiled for MS-DOS.
They access the same databases (DBF/NTX) residing on Linux Samba server.
Access to these DBF is concurrent and record locks are fully respected in any combination of Linux+Harbour with Windows+Harbour and MS-DOS+Clipper applications.

Lately I've been experimenting with FreeDos, as I need to expand number of simple machines running single task Clipper applications, and buying new copies of MS-DOS is not easy these days...

Clipper executable seems to run perfectly fine under FreeDos, but unfortunately the record locks appear to be incompatible. Locking a record under Clipper+FreeDos does not disallow other machines to lock the same record. This is an example of byte range locks as reported by the Samba server (smbstatus -L -B):

Pid        dev:inode       R/W  start     size      SharePath               Name
--------------------------------------------------------------------------------
4851       97c:4035436e:0  W    2365587456 10                                 APLIC/CC/PCS.DBF      
5096       97c:4035436e:0  W    1000000481 1                                  APLIC/CC/PCS.DBF 

Line with Pid 4851 is the lock requested by Clipper+FreeDos on a specific record of PCS.DBF
Line with Pid 5096 is the lock requested by Win7-64+Harbour on the very same record.

Both applications get the lock granted, so the record is editable by both at the same time.

In addition:
Runnig the exact same Clipper executable under MS-DOS instead of FreeDos, and requesting the very same record lock:
Byte range locks:
Pid        dev:inode       R/W  start     size      SharePath               Name
--------------------------------------------------------------------------------
8381       97c:4035436e:0  W    1000000481 1                                  APLIC/CC/PCS.DBF     


So my question:
Is there anything I can do to make Clipper+FreeDos to use the same record locking as all the other combination of compiler+OS do ?
I understand this might be FreeDos related only. Is there any other place you know of, where I could post this question ?

Thank you very much,
António Vila-Chã
Viana do Castelo, Portugal

Francesco Perillo

unread,
Feb 24, 2016, 2:33:30 PM2/24/16
to harbou...@googlegroups.com

Not directly related... what about using raspberry as simple computer? I see them used more and more in production and it uses linux...

elch

unread,
Feb 25, 2016, 3:34:54 AM2/25/16
to Harbour Users

Hi António,


Pid        dev:inode       R/W  start     size      SharePath               Name
--------------------------------------------------------------------------------
4851       97c:4035436e:0  W    2365587456 10                                 APLIC/CC/PCS.DBF      
 
not only the locked address is obviously different, but important also wrong size:
it should be IMHO one byte, not 10.
( JFYI: https://github.com/harbour/core/blob/master/doc/locks.txt )

My DOS knowledge faded, was there something about: share.exe ?
You may compare, if you use different setups for MS-DOS versus FreeDOS in config.sys/ autoexec.bat, and that causes the trouble.
Or even try parts from MS-DOS, e.g. this share.exe if formerly used.
And sure, it could be FreeDOS itself, if they implemented e.g. something for int86() wrongly ...
( http://www.htl-steyr.ac.at/~morg/pcinfo/hardware/interrupts/inte89f4.htm )

Let's see, perhaps someone knows better ...

best regards
Rolf

Przemyslaw Czerpak

unread,
Feb 25, 2016, 1:44:17 PM2/25/16
to harbou...@googlegroups.com
Hi António,

AFAIR it was general problem with MS network client for DOS
It accesses some internal MS-DOS structures in undocumented way.
Problem with record locking and this client was reported about
13 years ago on FreeDOS devel list. I guess you are using this
SMB client. I do not know if it was ever fixed. First you should
check if you are using share.exe from FreeDOS or from MS. If
replacing it does not help then I'm afraid the only one choice
is switching to Harbour and HBNETIO.
In such case install on your Linux server HBNETIO server with
rootpath which allows to access your SAMBA shared volume.
Then you have two choices:
1. Using Harbour DOS build recompile your application with
HBNETIO file IO redirector enabled and use it to replace
your Clipper DOS program.
2. Replace on your client station OS and using one of small Linux
distros. You need only kernel with TCP support so it should
be quite easy to create it if you want to make it yourself,
i.e. for our own use we created such minidistro which can
be loaded using network (PXE) or locally (CD/USB).
Client station needs at least 8GB of RAM.
Then use can use locally harbour application for Linux and
access your files by HBNTIO like above or telnet/ssh and
execute it remotely.

best regards,
Przemek
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> Unsubscribe: harbour-user...@googlegroups.com
> Web: http://groups.google.com/group/harbour-users
>
> ---
> You received this message because you are subscribed to the Google Groups "Harbour Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Przemyslaw Czerpak

unread,
Feb 25, 2016, 1:45:12 PM2/25/16
to harbou...@googlegroups.com
On Wed, 24 Feb 2016, Francesco Perillo wrote:

Hi Francesco,

> Not directly related... what about using raspberry as simple computer? I
> see them used more and more in production and it uses linux...

It's fully functional Linux so all will work correctly.

best regards,
Przemek

António

unread,
Feb 25, 2016, 6:09:51 PM2/25/16
to Harbour Users


quarta-feira, 24 de Fevereiro de 2016 às 19:33:30 UTC, fperillo escreveu:

Not directly related... what about using raspberry as simple computer? I see them used more and more in production and it uses linux...


Hi Francesco.
I did considered Pi and have one nearby I used for testing. Had problems with automated logins and applications beeing left running in the server even after it disconnected. Also had some glitches with adapter for vga monitor and in some situations the parallel port is still important.
But thanks for the point, it's something I will need to re-consider after exploring other solutions I fell more comfortable with...

António

unread,
Feb 25, 2016, 6:25:13 PM2/25/16
to Harbour Users


Hi Rolf, thanks for pointing the information.
Not the easiest thing for me to fully digest the different locking schemas, but still very interesting.
As you say, the problem might be on something FreeDos implement different then MS...


António

unread,
Feb 25, 2016, 7:24:23 PM2/25/16
to Harbour Users


Thank you Przemyslaw, as usual you are most kind in helping and pointing solutions.

I did tried using MS-DOS share.exe instead of FreeDOS share.com, but it complained something like "incorrect dos version".
Since you point the locking issue has been raised on FreeDOS devel list, I believe it has not been resolved, as the copy I'm using is a fresh download with about a week ago.

You suggestion 1 - HBNETIO immediately catched my attention. I will sure explore this, because it really looks like the ideal solution.
I am not familiar with HBNETIO, but I'll try to find my way in the examples, code and readme as well as in the forum.

Again, thanks.
António


Reply all
Reply to author
Forward
0 new messages