summaryrefslogtreecommitdiff
path: root/tests/misc/head-c.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/head-c.sh')
-rwxr-xr-xtests/misc/head-c.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/misc/head-c.sh b/tests/misc/head-c.sh
index d6433d0dd..807e96544 100755
--- a/tests/misc/head-c.sh
+++ b/tests/misc/head-c.sh
@@ -42,4 +42,16 @@ esac
# based on the value passed to -c
(ulimit -v 20000; head --bytes=-$SSIZE_MAX < /dev/null) || fail=1
+# Make sure it works on funny files in /proc and /sys.
+
+for file in /proc/cpuinfo /sys/kernel/profiling; do
+ if test -r $file; then
+ cp -f $file copy &&
+ head -c -1 copy > exp1 || framework_failure_
+
+ head -c -1 $file > out1 || fail=1
+ compare exp1 out1 || fail=1
+ fi
+done
+
Exit $fail