xref: /freebsd/contrib/pjdfstest/tests/truncate/11.t (revision 4436b51dff5736e74da464946049ea6899a88938)
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