]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/pjdfstest/tests/link/03.t
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / pjdfstest / tests / link / 03.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 desc="link returns ENAMETOOLONG if an entire length of either path name exceeded {PATH_MAX} characters"
5
6 dir=`dirname $0`
7 . ${dir}/../misc.sh
8
9 echo "1..13"
10
11 n0=`namegen`
12 nx=`dirgen_max`
13 nxx="${nx}x"
14
15 mkdir -p "${nx%/*}"
16
17 expect 0 create ${nx} 0644
18 expect 0 link ${nx} ${n0}
19 expect 2 stat ${n0} nlink
20 expect 2 stat ${nx} nlink
21 expect 0 unlink ${nx}
22 expect 0 link ${n0} ${nx}
23 expect 2 stat ${n0} nlink
24 expect 2 stat ${nx} nlink
25 expect 0 unlink ${nx}
26 expect ENAMETOOLONG link ${n0} ${nxx}
27 expect 1 stat ${n0} nlink
28 expect 0 unlink ${n0}
29 expect ENAMETOOLONG link ${nxx} ${n0}
30
31 rm -rf "${nx%%/*}"