xref: /illumos-gate/usr/src/test/util-tests/tests/du/du.kshlib (revision 43c208b5f450eb6cd6064cb062ac44d41549e785)
1*43c208b5SToomas Soome#! /usr/bin/ksh
2*43c208b5SToomas Soome#
3*43c208b5SToomas Soome# This file and its contents are supplied under the terms of the
4*43c208b5SToomas Soome# Common Development and Distribution License ("CDDL"), version 1.0.
5*43c208b5SToomas Soome# You may only use this file in accordance with the terms of version
6*43c208b5SToomas Soome# 1.0 of the CDDL.
7*43c208b5SToomas Soome#
8*43c208b5SToomas Soome# A full copy of the text of the CDDL should have accompanied this
9*43c208b5SToomas Soome# source.  A copy of the CDDL is also available via the Internet at
10*43c208b5SToomas Soome# http://www.illumos.org/license/CDDL.
11*43c208b5SToomas Soome#
12*43c208b5SToomas Soome
13*43c208b5SToomas Soome#
14*43c208b5SToomas Soome# Copyright 2025 Edgecast Cloud LLC
15*43c208b5SToomas Soome#
16*43c208b5SToomas Soome
17*43c208b5SToomas Soomeexport LC_ALL=C.UTF-8
18*43c208b5SToomas Soome
19*43c208b5SToomas Soometest_dir="/var/tmp/du_dir"
20*43c208b5SToomas Soometypeset -i fail=0
21*43c208b5SToomas Soome
22*43c208b5SToomas Soomefunction require_sparse_file_support
23*43c208b5SToomas Soome{
24*43c208b5SToomas Soome	typeset MIN_HOLE_SIZE=$(getconf MIN_HOLE_SIZE $test_dir)
25*43c208b5SToomas Soome
26*43c208b5SToomas Soome	if [[ $MIN_HOLE_SIZE == "undefined" ]]; then
27*43c208b5SToomas Soome		echo "getconf MIN_HOLE_SIZE $test_dir failed; sparse files" \
28*43c208b5SToomas Soome		    "probably not supported by file system"
29*43c208b5SToomas Soome		((fail++))
30*43c208b5SToomas Soome	fi
31*43c208b5SToomas Soome}
32