Thanks, but it’s not the way the cat program opens and then reads from a
file I want to know. I know that under Unix systems for example, the /proc
filesystem is a special filesystem where the kernel updates special files?
with information, for example version, time, pci listings etc. /proc is a
pseudo filesystem used as an interface to kernel data structures.
Qnx microkernel seems to do the same? So if the resource manager that I
write can register itself the with the kernel /proc functionality and
respond with an ascii dump of internal resource manager status that would be
great.
It’s called command line utility at page 3 in “Writing a resource manager”
in the QNX documentation.
Regards,
Oystein Solvberg
Robert Krten <nospam88@parse.com> wrote in message
news:ae4ul8$4d0$1@inn.qnx.com…
Oystein Solvberg <> oystein.solvberg@telenor.com> > wrote:
Hi!
I am wondering if some of you have an example of how to get a resource
manager respond via an ASCII text dump to the console if for example a
command like this were executed: “cat /proc/asistat”.
In the QNX documentation it says that this is possible, but there are no
examples of this usage. What kind of message shall the resource manager
respond to when a request is performed on the /proc/asistat file.
asistat is only an example in this case.
Are you asking the general question of “what happens to a resource manager
when ‘cat’ asks it for output” ?
cat basically does open()/read()/read()…/close()
So, your resource manager will get _IO_CONNECT (open()) message, followed
by
_IO_READ (read()) messages, followed by a close message.
you will therefore need to set up a handler for the _IO_READ message.
Check out > www.parse.com/books/download.html > for some sample code from the
QNX/Neutrino 2 book…
Cheers,
-RK
–
Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at > www.parse.com> .
Email my initials at parse dot com.