xref: /freebsd/contrib/pjdfstest/tests/truncate/11.t (revision f4b37ed0f8b307b1f3f0f630ca725d68f1dff30d)
1#!/bin/sh
2# $FreeBSD: head/tools/regression/pjdfstest/tests/truncate/11.t 211352 2010-08-15 21:24:17Z pjd $
3
4desc="truncate returns ETXTBSY the file is a pure procedure (shared text) file that is being executed"
5
6dir=`dirname $0`
7. ${dir}/../misc.sh
8
9[ "${os}" = "FreeBSD" ] || quick_exit
10
11echo "1..2"
12
13n0=`namegen`
14
15cp -pf `which sleep` ${n0}
16./${n0} 3 &
17while ! pkill -0 -f ./${n0}; do
18	sleep 0.1
19done
20expect ETXTBSY truncate ${n0} 123
21pkill -9 -f ./${n0}
22expect 0 unlink ${n0}
23