> -----Original Message----- > From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On > Behalf Of Rob van der Heij > Sent: Tuesday, October 11, 2005 1:50 PM > To: [email protected] > Subject: Re: 2005-10-04 Recommended Linux on zSeries code > drop to developerWorks > > > On 10/11/05, Adam Thornton <[EMAIL PROTECTED]> wrote: > > > cat /sys/devices/diagnose/8/status > > My worries with each of these non-atomic implementations is that by > the time I get to inspect the return code, something else may have > issued a CP command after mine. So my return code would have been > lost, and I would see the return code of that other command without > knowing better. > When the interface requires the process to establish some kind of > binding, that kind of problems is avoided. And isn't that what the > ioctl( ) approach does? > > Rob > --
Rob, This is likely a foolish question, but could the /sys/devices/diagnose be set up like the /dev/fd ? E.g. for pid 12345, there exists an entire tree /sys/devices/diagnose/12345. Then have "self" as a symlink to the current pid so that for any particular pid, it could reference /sys/devices/diagnose/self/... It might even be possible to "interlock" on /sys/devices/diagnose/self/8/command so that you could not cat to it a second time until you had read /sys/devices/diagnose/self/8/status or maybe even 'echo "1">/sys/devices/diagnose/self/8/active' where that pseudo-file gets changed to "0" when ../command is written to you cannot again write a line to ../command until you write a "1" to ../active (or something to that effect). Hope this makes sense. I'm not a kernel type person. -- John McKown Senior Systems Programmer UICI Insurance Center Information Technology This message (including any attachments) contains confidential information intended for a specific individual and purpose, and its' content is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this transmission, or taking any action based on it, is strictly prohibited. ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390
