Dmitry V. Levin | 68d6424 | 2014-09-10 00:07:32 +0000 | [diff] [blame] | 1 | BEGIN { |
Dmitry V. Levin | 226bf1c | 2015-03-18 19:14:02 +0000 | [diff] [blame^] | 2 | i = "[0-9]+" |
| 3 | len = "[1-9]" i |
Dmitry V. Levin | 68d6424 | 2014-09-10 00:07:32 +0000 | [diff] [blame] | 4 | |
Dmitry V. Levin | 226bf1c | 2015-03-18 19:14:02 +0000 | [diff] [blame^] | 5 | d_ino = "d_ino=" i |
| 6 | d_off = "d_off=" i |
| 7 | d_reclen = "d_reclen=" len |
| 8 | d_name_1 = "d_name=\"\\.\"" |
| 9 | d_name_2 = "d_name=\"\\.\\.\"" |
| 10 | d_name_3 = "d_name=\"(A\\\\n){127}Z\"" |
| 11 | # Some older systems might not pass back d_type at all like Alpha. |
| 12 | d_type_dir = "d_type=DT_(DIR|UNKNOWN)" |
| 13 | d_type_reg = "d_type=DT_(REG|UNKNOWN)" |
Dmitry V. Levin | 68d6424 | 2014-09-10 00:07:32 +0000 | [diff] [blame] | 14 | |
Dmitry V. Levin | 226bf1c | 2015-03-18 19:14:02 +0000 | [diff] [blame^] | 15 | dirent_1 = "\\{" d_ino ", " d_off ", " d_reclen ", " d_name_1 ", " d_type_dir "\\}" |
| 16 | dirent_2 = "\\{" d_ino ", " d_off ", " d_reclen ", " d_name_2 ", " d_type_dir "\\}" |
| 17 | dirent_3 = "\\{" d_ino ", " d_off ", " d_reclen ", " d_name_3 ", " d_type_reg "\\}" |
Dmitry V. Levin | 68d6424 | 2014-09-10 00:07:32 +0000 | [diff] [blame] | 18 | |
Dmitry V. Levin | 226bf1c | 2015-03-18 19:14:02 +0000 | [diff] [blame^] | 19 | dirent64_1 = "\\{" d_ino ", " d_off ", " d_reclen ", " d_type_dir ", " d_name_1 "\\}" |
| 20 | dirent64_2 = "\\{" d_ino ", " d_off ", " d_reclen ", " d_type_dir ", " d_name_2 "\\}" |
| 21 | dirent64_3 = "\\{" d_ino ", " d_off ", " d_reclen ", " d_type_reg ", " d_name_3 "\\}" |
Dmitry V. Levin | 68d6424 | 2014-09-10 00:07:32 +0000 | [diff] [blame] | 22 | |
Dmitry V. Levin | 226bf1c | 2015-03-18 19:14:02 +0000 | [diff] [blame^] | 23 | d_123 = dirent_1 " " dirent_2 " " dirent_3 |
| 24 | d_213 = dirent_2 " " dirent_1 " " dirent_3 |
| 25 | d_132 = dirent_1 " " dirent_3 " " dirent_2 |
| 26 | d_321 = dirent_3 " " dirent_2 " " dirent_1 |
| 27 | d_231 = dirent_2 " " dirent_3 " " dirent_1 |
| 28 | d_312 = dirent_3 " " dirent_1 " " dirent_2 |
Dmitry V. Levin | c929771 | 2015-01-25 00:04:20 +0000 | [diff] [blame] | 29 | |
Dmitry V. Levin | 226bf1c | 2015-03-18 19:14:02 +0000 | [diff] [blame^] | 30 | d64_123 = dirent64_1 " " dirent64_2 " " dirent64_3 |
| 31 | d64_213 = dirent64_2 " " dirent64_1 " " dirent64_3 |
| 32 | d64_132 = dirent64_1 " " dirent64_3 " " dirent64_2 |
| 33 | d64_321 = dirent64_3 " " dirent64_2 " " dirent64_1 |
| 34 | d64_231 = dirent64_2 " " dirent64_3 " " dirent64_1 |
| 35 | d64_312 = dirent64_3 " " dirent64_1 " " dirent64_2 |
Dmitry V. Levin | d07056f | 2015-02-08 01:34:08 +0000 | [diff] [blame] | 36 | |
Dmitry V. Levin | 226bf1c | 2015-03-18 19:14:02 +0000 | [diff] [blame^] | 37 | dents = "\\{(" d_123 "|" d_213 "|" d_132 "|" d_321 "|" d_231 "|" d_312 ")\\}" |
| 38 | dents64 = "\\{(" d64_123 "|" d64_213 "|" d64_132 "|" d64_321 "|" d64_231 "|" d64_312 ")\\}" |
Dmitry V. Levin | d07056f | 2015-02-08 01:34:08 +0000 | [diff] [blame] | 39 | |
Dmitry V. Levin | 226bf1c | 2015-03-18 19:14:02 +0000 | [diff] [blame^] | 40 | getdents = "getdents\\(" i ", " dents ", " len "\\)" |
| 41 | getdents64 = "getdents64\\(" i ", " dents64 ", " len "\\)" |
Dmitry V. Levin | c929771 | 2015-01-25 00:04:20 +0000 | [diff] [blame] | 42 | |
Dmitry V. Levin | 226bf1c | 2015-03-18 19:14:02 +0000 | [diff] [blame^] | 43 | r[1] = "^(" getdents "|" getdents64 ") += " len "$" |
| 44 | r[2] = "^getdents(64)?\\([0-9]+, \\{\\}, [1-9][0-9]+\\) += 0$" |
| 45 | s[3] = "+++ exited with 0 +++" |
| 46 | |
| 47 | lines = 3 |
| 48 | fail = 0 |
Dmitry V. Levin | 68d6424 | 2014-09-10 00:07:32 +0000 | [diff] [blame] | 49 | } |
| 50 | |
Dmitry V. Levin | 226bf1c | 2015-03-18 19:14:02 +0000 | [diff] [blame^] | 51 | @include "match.awk" |