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