blob: 01414cf9b9068f588218052193972ab634e76e87 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# z/OS: the tag, alloc and free builtins.
# VERIFY: not yet run. Expected output written from the design.
printf 'x\n' >f
tag -t -c IBM-1047 f && tag f | awk '{ print $1, $2, $3, $4 }'
tag -m -c ISO8859-1 f && tag -p f | awk '{ print $1, $2, $3 }'
tag -b f && tag f | awk '{ print $1, $2, $3 }'
tag -r f && tag f | awk '{ print $1, $2, $3 }'
tag -t -c NO-SUCH-CODESET f 2>/dev/null; echo "unknown code set: $?"
tag nosuchfile 2>/dev/null; echo "missing file: $?"
# agrees with chtag
tag -t -c ISO8859-1 f
chtag -p f | awk '{ print $1, $2 }'
# BPXWDYN is a system load module; without it alloc and free have no way
# to build the SVC 99 request. That is the system's business, not the
# shell's, so the rest is skipped rather than recorded as a failure.
alloc 'dd(zashcheck)' "da('sys1.maclib(getmain)')" shr 'msg(2)' 2>&1 |
grep -q 'cannot load BPXWDYN' && exit 77
free 'dd(zashcheck)' >/dev/null 2>&1
# alloc and free (the DD lives in the shell's address space)
alloc 'dd(zashin)' "da('sys1.maclib(getmain)')" shr 'msg(2)'; echo "alloc: $?"
free 'dd(zashin)'; echo "free: $?"
free 'dd(zashin)' 2>/dev/null; echo "free again: $?"
|