[argyllcms] Re: Running dispcal stops usb card reader

On 16-02-2012 01:29, Graeme Gill wrote:
Ridouan Agarad wrote:

/proc to exclude ports already open by other processes.
Can you be more specific ?

First of all, this is specific to Linux, *BSD also has a similar procfs, but I don't have a BSD box on hand right now, so can't check... As for solaris, etc., that's way more limited anyway... Having said that and also that I do not the specifics of the VDR/softcam application, /proc has a list of open filehandles per process (/proc/<pid>/fd/<id>), where <id> is a symlink to the underlying device node (usually /dev/*). Knowing that and knowing you're about to open /dev/ttyXYZ, you could check if there's any process having an open handle to that same device node. If so, don't bother and continue....


As far as I can tell /proc/tty/ is Linux only, and
/proc/tty/driver is not accessible in user mode anyway.

Another option would be I guess is to allow (optional) specification
of either a device path in a conf file (bypassing the need to scan for
ports),
That's very user unfriendly though - I could expect anyone trying to
use a serial instrument to then have to ask how to do it.

Well, looking a bit closer at the documentation, I don't have argyllcms running (on Linux) and can't check, I guess using the '-c' parameter for e.g. dispcal would already allow one to achieve this, wouldn't it?


In earlier versions I simply limited the number to about 4. Maybe
that's all I can do again.


Isn't /proc/devices maybe usable as an 'automatic' filter (if the file is available, that is) to filter out devices for which no driver is currently loaded (and thus not usable anyway)?



Other related posts: