VirtualBox

source: kBuild/vendor/grep/current/tests/long-line-vs-2GiB-read@ 3630

Last change on this file since 3630 was 3529, checked in by bird, 3 years ago

Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.

  • Property svn:executable set to *
File size: 670 bytes
Line 
1#!/bin/sh
2# Ensure that grep can handle lines 2GiB long.
3# Before grep-2.16, a line of length 2^31 or greater would provoke
4# an "Invalid argument" (EINVAL) failure from the read syscall on
5# systems like OS/X 10.8.5.
6
7. "${srcdir=.}/init.sh"; path_prepend_ ../src
8
9# Searching 2GiB takes a while.
10expensive_
11
12echo big > exp || framework_failure_
13
14MiB=1048576
15dd bs=$MiB seek=2048 of=big < /dev/null || framework_failure_
16echo x >> big || framework_failure_
17grep -l x big > out 2> err || fail=1
18
19# Not everyone has 2GB of memory free.
20grep '^grep: memory exhausted$' err && skip_ 'memory exhausted'
21
22compare exp out || fail=1
23compare /dev/null err || fail=1
24
25Exit $fail
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette