1 |
#!/bin/sh |
2 |
# $FreeBSD: head/tools/regression/pjdfstest/tests/truncate/12.t 211352 2010-08-15 21:24:17Z pjd $ |
3 |
|
4 |
desc="truncate returns EFBIG or EINVAL if the length argument was greater than the maximum file size" |
5 |
|
6 |
dir=`dirname $0` |
7 |
. ${dir}/../misc.sh |
8 |
|
9 |
echo "1..3" |
10 |
|
11 |
n0=`namegen` |
12 |
|
13 |
expect 0 create ${n0} 0644 |
14 |
r=`${fstest} truncate ${n0} 999999999999999 2>/dev/null` |
15 |
case "${r}" in |
16 |
EFBIG|EINVAL) |
17 |
expect 0 stat ${n0} size |
18 |
;; |
19 |
0) |
20 |
expect 999999999999999 stat ${n0} size |
21 |
;; |
22 |
*) |
23 |
echo "not ok ${ntest}" |
24 |
ntest=`expr ${ntest} + 1` |
25 |
;; |
26 |
esac |
27 |
expect 0 unlink ${n0} |