blob: 8a00133448773273c8cc1a34ef526da07ae61fec [file] [log] [blame]
Dmitry V. Levin68d64242014-09-10 00:07:32 +00001BEGIN {
Dmitry V. Levin226bf1c2015-03-18 19:14:02 +00002 i = "[0-9]+"
3 len = "[1-9]" i
Dmitry V. Levin68d64242014-09-10 00:07:32 +00004
Dmitry V. Levin226bf1c2015-03-18 19:14:02 +00005 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. Levin68d64242014-09-10 00:07:32 +000014
Dmitry V. Levin226bf1c2015-03-18 19:14:02 +000015 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. Levin68d64242014-09-10 00:07:32 +000018
Dmitry V. Levin226bf1c2015-03-18 19:14:02 +000019 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. Levin68d64242014-09-10 00:07:32 +000022
Dmitry V. Levin226bf1c2015-03-18 19:14:02 +000023 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. Levinc9297712015-01-25 00:04:20 +000029
Dmitry V. Levin226bf1c2015-03-18 19:14:02 +000030 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. Levind07056f2015-02-08 01:34:08 +000036
Dmitry V. Levin226bf1c2015-03-18 19:14:02 +000037 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. Levind07056f2015-02-08 01:34:08 +000039
Dmitry V. Levin226bf1c2015-03-18 19:14:02 +000040 getdents = "getdents\\(" i ", " dents ", " len "\\)"
41 getdents64 = "getdents64\\(" i ", " dents64 ", " len "\\)"
Dmitry V. Levinc9297712015-01-25 00:04:20 +000042
Dmitry V. Levin226bf1c2015-03-18 19:14:02 +000043 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. Levin68d64242014-09-10 00:07:32 +000049}
50
Dmitry V. Levin226bf1c2015-03-18 19:14:02 +000051@include "match.awk"