[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_CHECK_FILES on /dev/stdin
From: |
Keith MARSHALL |
Subject: |
Re: AC_CHECK_FILES on /dev/stdin |
Date: |
Thu, 30 Mar 2006 10:02:36 +0100 |
Hi David,
David Fang wrote:
> I naively tried to use AC_CHECK_FILE(S) on /dev/stdin /dev/stdout
> and /dev/stderr to detect their presence, but the test result is
> 'no' for these 'files'.
These are not real devices. You may find entries in /dev, which
suggest otherwise, but look closely: if they exist at all, they
will be symbolic links to fd entities in the /proc pseudo-file
system; i.e. they aren't connected to real files or devices, but
exist as virtual properties of processes.
> The result is 'yes', however, for /dev/null.
This, OTOH, is a real device, in the sense that the kernel manages
it with a device driver which simply returns EOF on read, or discards
all data written.
> Is there a more appropriate test for the presence of these special
> files? or do I need to roll my own macro-test using something like
> "test -f"? (Or am I checking for something that should/need not be
> checked?) Suggestions?
You don't need to check for them. Unless you explicitly force it to
be otherwise, *every* process is *guaranteed* to have stdin, stdout
and stderr streams; you must be doing something very esoteric, if
you find a need to refer to /dev/stdin, /dev/stdout or /dev/stderr.
HTH,
Keith.
Re: AC_CHECK_FILES on /dev/stdin, J.T. Conklin, 2006/03/30