daemon-fd-test 500 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /bin/sh

if [ -z "$srcdir" ] ; then
  srcdir=`pwd`
fi

. $srcdir/functions.sh

[ -d /proc/self/fd ] || test_skip

# Open a spurios fd
exec 17>&2

# Ignore fd 3, since it's used by the ls program to get to read the
# directory. On linux, fd 3 should be a link to the appropriate
# "/proc/<pid>/fd" directory, while on Solaris, it for some reason is
# a link to "/".

spawn_lshd && exec_lsh ls /proc/self/fd | grep -v '^3$'> test.out1
cat >test.out2 <<EOF
0
1
2
EOF

compare_output "daemon-fd-test"