# Determine basic amount of memory needed for 'cp -al'.
touch f || framework_failure_
vm=$(get_min_ulimit_v_ cp -al f f2) \
- || skip_ "this shell lacks ulimit support"
+ || skip_ 'shell lacks ulimit, or ASAN enabled'
rm f f2 || framework_failure_
a=$(printf %031d 0)
# Determine basic amount of memory needed.
{ echo y; echo n; } > f || framework_failure_
vm=$(get_min_ulimit_v_ csplit -z f %n%1) \
- || skip_ "this shell lacks ulimit support"
+ || skip_ 'shell lacks ulimit, or ASAN enabled'
(
ulimit -v $(($vm + 4000)) \
getlimits_
vm=$(get_min_ulimit_v_ returns_ 0 cut -b1 /dev/null) \
- || skip_ "this shell lacks ulimit support"
+ || skip_ 'shell lacks ulimit, or ASAN enabled'
# Ensure we can cut up to our sentinel value.
# Don't use expr to subtract one,
# Determine basic amount of memory needed.
echo . > f || framework_failure_
vm=$(get_min_ulimit_v_ timeout 10 dd if=f of=f2 status=none) \
- || skip_ "this shell lacks ulimit support"
+ || skip_ 'shell lacks ulimit, or ASAN enabled'
rm f f2 || framework_failure_
# count and skip are zero, we don't need to allocate memory
print_ver_ head
getlimits_
-vm=$(get_min_ulimit_v_ head -c1 /dev/null) \
- || skip_ "this shell lacks ulimit support"
-
# exercise the fix of 2001-08-18, based on test case from Ian Bruce
echo abc > in || framework_failure_
(head -c1; head -c1) < in > out || fail=1
# Only allocate memory as needed.
# Coreutils <= 8.21 would allocate memory up front
# based on the value passed to -c
-(ulimit -v $(($vm+8000)) && head --bytes=-$SSIZE_MAX < /dev/null) || fail=1
+vm=$(get_min_ulimit_v_ head -c1 /dev/null) && {
+ (ulimit -v $(($vm+8000)) && head --bytes=-$SSIZE_MAX < /dev/null) || fail=1
+}
# Make sure it works on funny files in /proc and /sys.
print_ver_ printf
vm=$(get_min_ulimit_v_ env $prog %20f 0) \
- || skip_ "this shell lacks ulimit support"
+ || skip_ 'shell lacks ulimit, or ASAN enabled'
# Up to coreutils-6.9, "printf %.Nf 0" would encounter an ENOMEM internal
# error from glibc's printf(3) function whenever N was large relative to
# Restrict memory. Each of these coreutils-8.12 programs would fail
# with a diagnostic like "rm: fts_read failed: Cannot allocate memory".
vm=$(get_min_ulimit_v_ du -sh d2) \
- || skip_ "this shell lacks ulimit support"
+ || skip_ 'shell lacks ulimit, or ASAN enabled'
# With many files in a single directory...
mkdir d || framework_failure_
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
-vm=$(get_min_ulimit_v_ split -C 'K' /dev/null) \
- || skip_ "this shell lacks ulimit support"
-
# Ensure memory is not allocated up front
-(ulimit -v $vm && split -C 'G' /dev/null) || fail=1
+
+vm=$(get_min_ulimit_v_ split -C 'K' /dev/null) && {
+ (ulimit -v $vm && split -C 'G' /dev/null) || fail=1
+}
# Ensure correct operation with various split and buffer size combinations