On Tue, 17 Sep 2013 21:14:38 +0200 Lionel Cons wrote:
> On 17 September 2013 20:49, Glenn Fowler <[email protected]> wrote:
> >
> > from ksh did you try
> >
> >         getconf name ~{fd}
> >         getconf name /dev/fd/${fd}

> Forwarding the feedback from a coworker:
> It may work for AST but it is not legal: ~{fd} expands to /proc, which
> is a filesystem, and /dev/fd is a filesystem on Solaris too. What
> happens if I want to find the pathconf properties of /proc or /dev/fd
> in a POSIX conforming way?

if you want to do fpathconf(2) from the command line in a posix conforming way 
then you can't
posix has neither /proc nor /dev/fd

now for a useful answer
using ~{fd} or /dev/fd will only work for builtins or on systems that support 
/proc/<pid>/fd/<fd>
right now the ksh93 getconf builtin defers to /usr/bin/getconf for most 
path_var operands
those would have to be instead handled by the builtin to handle fds

until then something like this should work on most modern unix (with 
/dev/fd/<fd> support)

        getconf path_var /dev/fd/0 < ~{fd}

_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to