| View previous topic :: View next topic |
| Author |
Message |
Grant Edwards Guest
|
Posted: Fri Oct 31, 2008 7:19 pm Post subject: Re: Multiple programs accessing serial device |
|
|
On 2008-10-31, Christoph Kobe <christoph@kobenetz.de> wrote:
| Quote: | I remember being stunned when I found out that on windows you
can't even read a file to which somebody else is writing. I
had written a program that was writing messages to a log file,
and I just couldn't believe that I wasn't allowed to read the
messages until after the program closed the file. [I still
have no idea why there should be such a limitation.]
I remember beeing stunned when I first learned about all the
advantages (and some disadvantages) of my linux system. I remember
installing a rather early version of it (kernel 2.0.???), no GUI,
sitting in front of the console and having no idea what to do with
it
|
Why no GUI? I started using Linux in the 0.9x kernel days 15+
years ago, and X11 worked fine back then (with 8MB of RAM, a
40MB hard drive, and a "Hercules" monochrome video card).
Before that I ran another flavor of Unix -- I tried using DOS
for a while, but it was pretty lame. I tried Windows when it
came out, and it seemed to be just as broken as DOS.
| Quote: | You should be able to do that under Unix by using the TIOCEXCL
ioctl.
Ok, I learnt that I don't need it anymore, but maybe I'll try
it anyway
|
If you do try it, let us know if it works. It looks like it
should do what you want based on my examination of the tty
driver source code, but I've never tried it.
--
Grant Edwards grante Yow! Now I'm concentrating
at on a specific tank battle
visi.com toward the end of World
War II! |
|
| |
|
Back to top |
Christoph Kobe Guest
|
Posted: Sun Nov 02, 2008 4:55 am Post subject: Re: Multiple programs accessing serial device |
|
|
On Fri, 31 Oct 2008 09:19:50 -0500
Grant Edwards <grante@visi.com> wrote:
| Quote: | Why no GUI? I started using Linux in the 0.9x kernel days 15+
years ago, and X11 worked fine back then (with 8MB of RAM, a
40MB hard drive, and a "Hercules" monochrome video card).
|
Because at that time I was unable to configure it. I was about 14 years old, had nobody to help me,
no internet connection and absolutely no idea what to do with linux - so I had not much motivation
to try anyway. That was with SuSE Linux 4.4. But a few years later I succeeded with SuSE 6.2, which
was already quite comfortable for a linux at that time. Today I'm using Debian. |
|
| |
|
Back to top |
Christoph Kobe Guest
|
Posted: Sun Nov 02, 2008 5:25 am Post subject: Re: Multiple programs accessing serial device |
|
|
On Fri, 31 Oct 2008 09:19:50 -0500
Grant Edwards <grante@visi.com> wrote:
| Quote: | You should be able to do that under Unix by using the TIOCEXCL
ioctl.
Ok, I learnt that I don't need it anymore, but maybe I'll try
it anyway ;-)
If you do try it, let us know if it works. It looks like it
should do what you want based on my examination of the tty
driver source code, but I've never tried it.
|
Here is the result: It works!
lock with TIOCEXCL
ech bla > /dev/ttyS0
and
cat /dev/ttyS0
both give me:
Device or resource busy (or whatever it is in english).
Fine  |
|
| |
|
Back to top |
|