mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-31 04:45:39 +01:00
Compare commits
1510
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0d351b26b | ||
|
|
fcc0587080 | ||
|
|
8935d79733 | ||
|
|
06187df476 | ||
|
|
b3f6e5e9f1 | ||
|
|
214e0c9020 | ||
|
|
cacb7e6814 | ||
|
|
270fd87cbb | ||
|
|
188d6589ff | ||
|
|
0e8064dff4 | ||
|
|
442c3b7577 | ||
|
|
7877839a22 | ||
|
|
a53a472ff4 | ||
|
|
fae3d6e480 | ||
|
|
e8e1bc02c0 | ||
|
|
dab7f20af9 | ||
|
|
bd0ed0fef9 | ||
|
|
6a15d061c8 | ||
|
|
c8e5bc75de | ||
|
|
3a32adb8f5 | ||
|
|
17cea34886 | ||
|
|
f533df855d | ||
|
|
9b56baa39f | ||
|
|
80be3bf6bd | ||
|
|
ebd954b83d | ||
|
|
5bd7156a38 | ||
|
|
1fac13be5b | ||
|
|
8719ea484d | ||
|
|
5a537073db | ||
|
|
1a1dd3927c | ||
|
|
60e815c4f0 | ||
|
|
52bb8d914e | ||
|
|
4216d60d32 | ||
|
|
f69cb5c9a0 | ||
|
|
2969e2ae42 | ||
|
|
88624191ca | ||
|
|
073ac28a4e | ||
|
|
a96d1e75b7 | ||
|
|
e31f41339e | ||
|
|
19ae55f383 | ||
|
|
211afe2cd0 | ||
|
|
a604799d09 | ||
|
|
5337d7a2a5 | ||
|
|
7fa52a6ce5 | ||
|
|
af738435af | ||
|
|
a5fb94c9f9 | ||
|
|
2d0ae92a99 | ||
|
|
ec6ceacea2 | ||
|
|
0509eb8c40 | ||
|
|
5708147189 | ||
|
|
084f6a26f3 | ||
|
|
e2708d8dab | ||
|
|
4e66f8c158 | ||
|
|
439e13cd0d | ||
|
|
49f41c222b | ||
|
|
a2cd26dd26 | ||
|
|
111698cd41 | ||
|
|
31f3e70ec1 | ||
|
|
2d390ebe39 | ||
|
|
c6d822bd7e | ||
|
|
7227eaef88 | ||
|
|
1bc6dd3cb1 | ||
|
|
6151498945 | ||
|
|
e28f66ee9c | ||
|
|
ccd4f86e06 | ||
|
|
d092a4ec45 | ||
|
|
13b226b3a7 | ||
|
|
45d935933c | ||
|
|
91f457d5d9 | ||
|
|
f1b2470e25 | ||
|
|
a8029cb9a2 | ||
|
|
e194d8cb90 | ||
|
|
05a025dddb | ||
|
|
789eb1f255 | ||
|
|
221b4dcfb8 | ||
|
|
a6cdc48471 | ||
|
|
8e9239893a | ||
|
|
fdef63144f | ||
|
|
0e0be1b309 | ||
|
|
fadc189a5b | ||
|
|
0a51b1ff1f | ||
|
|
1ac6f2d09a | ||
|
|
aea12503a4 | ||
|
|
f6d39af95e | ||
|
|
114cd4e652 | ||
|
|
30343e0985 | ||
|
|
0921567ffe | ||
|
|
bc7110d7e3 | ||
|
|
4d8d2df850 | ||
|
|
c7d8b0e516 | ||
|
|
76275a6104 | ||
|
|
4dd24a5a6c | ||
|
|
ad2126e920 | ||
|
|
70b2c8e405 | ||
|
|
eda11af7c7 | ||
|
|
af8bf61211 | ||
|
|
f49fbf7d98 | ||
|
|
12ec7eeec5 | ||
|
|
9f05ed9b32 | ||
|
|
226ec65268 | ||
|
|
df2b319ff2 | ||
|
|
47c9256192 | ||
|
|
3555f7305a | ||
|
|
2649070a45 | ||
|
|
8508495309 | ||
|
|
f5d0795a1e | ||
|
|
3f9969c610 | ||
|
|
655820bbe0 | ||
|
|
18bf0ef63c | ||
|
|
af9d21a285 | ||
|
|
d3aa551242 | ||
|
|
7586373a05 | ||
|
|
14c6b9ff03 | ||
|
|
ebfce84390 | ||
|
|
49673092dc | ||
|
|
b52c5b8a0f | ||
|
|
7621d88604 | ||
|
|
066914d08c | ||
|
|
f6a94edde0 | ||
|
|
84862e63a7 | ||
|
|
ebb640e37b | ||
|
|
8b8e9060b1 | ||
|
|
274d5fa01e | ||
|
|
26c25ec91e | ||
|
|
bbed0325d9 | ||
|
|
b30249d957 | ||
|
|
83a04e4fb0 | ||
|
|
b67946a431 | ||
|
|
31b5435674 | ||
|
|
6d26efa8ef | ||
|
|
9537a8b04d | ||
|
|
e2b601e6c3 | ||
|
|
6b5bc93a28 | ||
|
|
46c6c6d2e1 | ||
|
|
151c42b44e | ||
|
|
0fa58b56ec | ||
|
|
435c642891 | ||
|
|
4414763f4d | ||
|
|
db5c241aba | ||
|
|
016d972ea2 | ||
|
|
9e0a20e6bd | ||
|
|
5d8ff3922a | ||
|
|
8ba175812b | ||
|
|
a13546d7e7 | ||
|
|
98bbf54ffa | ||
|
|
d55382bcbc | ||
|
|
eeee68fd82 | ||
|
|
16bc8f3c7b | ||
|
|
d11af0bfda | ||
|
|
0bd0bd9c82 | ||
|
|
2ce04713fe | ||
|
|
f05c7cc1e6 | ||
|
|
26daf24714 | ||
|
|
b4f05001f3 | ||
|
|
eea7c212a5 | ||
|
|
8f55fa3b8b | ||
|
|
e6874927ec | ||
|
|
c109bf1446 | ||
|
|
1cbbbc10fc | ||
|
|
f85c49b786 | ||
|
|
b9bdf5b8cb | ||
|
|
b749b3bb3e | ||
|
|
b57e894043 | ||
|
|
971d1e6fff | ||
|
|
3d337f13fc | ||
|
|
2412cdd3e9 | ||
|
|
61b481c7f4 | ||
|
|
9230146b39 | ||
|
|
82f4e70650 | ||
|
|
aba290e1d7 | ||
|
|
3d76eec03d | ||
|
|
4c3d4253f3 | ||
|
|
57133a9ade | ||
|
|
c9335a049c | ||
|
|
53b1134004 | ||
|
|
7bbdef777c | ||
|
|
c1364f7838 | ||
|
|
13e2fc0a0f | ||
|
|
a76e875480 | ||
|
|
96537300fa | ||
|
|
c80009a4e9 | ||
|
|
198bfce040 | ||
|
|
1031171ee4 | ||
|
|
03081c7928 | ||
|
|
d3d6a8fb1d | ||
|
|
b9bcff08c0 | ||
|
|
b1df7f9a19 | ||
|
|
08fe4eb387 | ||
|
|
2b7895902e | ||
|
|
024b62e1bb | ||
|
|
3e0dd5e7df | ||
|
|
13abd41167 | ||
|
|
cd252574b1 | ||
|
|
1b4569257b | ||
|
|
6440f26160 | ||
|
|
3192c775e6 | ||
|
|
6f63b1f2b2 | ||
|
|
ccba9c3f37 | ||
|
|
caf9e52f18 | ||
|
|
29bd2e6e45 | ||
|
|
c37590dda2 | ||
|
|
6d3e1e88a4 | ||
|
|
dc6d5fe517 | ||
|
|
a94b094efb | ||
|
|
3d8fed90ed | ||
|
|
9b542d5380 | ||
|
|
deeacf7682 | ||
|
|
f932f046b2 | ||
|
|
c2efd23f3a | ||
|
|
4e4245448f | ||
|
|
2e8ac4e109 | ||
|
|
e7668b2043 | ||
|
|
e39e17dfa0 | ||
|
|
c0e6bef5c9 | ||
|
|
055d577dc9 | ||
|
|
e07824536f | ||
|
|
c063e3aedc | ||
|
|
1f199dffd0 | ||
|
|
65892ed949 | ||
|
|
77f9139893 | ||
|
|
67a61d68a0 | ||
|
|
ad8f99bb3a | ||
|
|
9c89b851c9 | ||
|
|
65d9ba4eb1 | ||
|
|
a29bf0ab58 | ||
|
|
86f23c4237 | ||
|
|
7aca2d6d19 | ||
|
|
bf2db90612 | ||
|
|
fee7bfeffb | ||
|
|
ecd64598ee | ||
|
|
11adaa2b2e | ||
|
|
8a1209f238 | ||
|
|
67068fe3e8 | ||
|
|
ddb6133958 | ||
|
|
647edf6222 | ||
|
|
7fe4d17490 | ||
|
|
4ef5cab369 | ||
|
|
9c8744932e | ||
|
|
09bc20bed2 | ||
|
|
8771f74895 | ||
|
|
c99311c81d | ||
|
|
1b698c4f58 | ||
|
|
54e3ff158e | ||
|
|
98f6d1b8ba | ||
|
|
24ad92549c | ||
|
|
3a75219a88 | ||
|
|
6698fe083f | ||
|
|
8dfac1c97b | ||
|
|
9d7c73393b | ||
|
|
a007f2ea7a | ||
|
|
faa363b6ef | ||
|
|
2f4dff0ed1 | ||
|
|
0f2f502705 | ||
|
|
dd15aae6d7 | ||
|
|
20bba48b3d | ||
|
|
d8bd056aaa | ||
|
|
cabf9e56a5 | ||
|
|
8d75a27388 | ||
|
|
4706824e3f | ||
|
|
ced2724a6c | ||
|
|
d86aa8b7c9 | ||
|
|
463d56f4bc | ||
|
|
4bc69d1149 | ||
|
|
363b506043 | ||
|
|
d01342629b | ||
|
|
282fd6c84c | ||
|
|
614317b095 | ||
|
|
5397377bf1 | ||
|
|
00699bdaa9 | ||
|
|
ce106a445f | ||
|
|
1900e82b71 | ||
|
|
a86ad81a8d | ||
|
|
f82d4db913 | ||
|
|
09eee860d0 | ||
|
|
04c18344d2 | ||
|
|
3e08d472d4 | ||
|
|
2a7fbb663d | ||
|
|
c794cd4b81 | ||
|
|
a22a955450 | ||
|
|
7118179c50 | ||
|
|
c56029c1c2 | ||
|
|
dad1e4d981 | ||
|
|
b8490f0625 | ||
|
|
49d9611cc7 | ||
|
|
536e33d9f6 | ||
|
|
769b3c79bc | ||
|
|
fc43f514d9 | ||
|
|
612ca3f7dd | ||
|
|
822dd9e1e0 | ||
|
|
8f04263f3f | ||
|
|
b3d6b19930 | ||
|
|
555ce93ce3 | ||
|
|
6bd66a6bd6 | ||
|
|
d9ac39faed | ||
|
|
1ccb288333 | ||
|
|
2359546b66 | ||
|
|
78567912f2 | ||
|
|
c28702b61b | ||
|
|
97786e63d0 | ||
|
|
9ccd6e6efd | ||
|
|
668b5184c8 | ||
|
|
1e7f63411c | ||
|
|
835b56e5ba | ||
|
|
c8fc6b7a38 | ||
|
|
3bda9cc428 | ||
|
|
6f97fa6e1d | ||
|
|
ca77442146 | ||
|
|
3e40cfcf3b | ||
|
|
7416bd11b9 | ||
|
|
61b25a7e99 | ||
|
|
9ba3240efc | ||
|
|
7887637757 | ||
|
|
7351afe798 | ||
|
|
3736df61ba | ||
|
|
be48bcdb2d | ||
|
|
5aaa15bf31 | ||
|
|
48663a646e | ||
|
|
53e5d3057b | ||
|
|
8d1dd37cea | ||
|
|
7e88e4033e | ||
|
|
b745c9dd21 | ||
|
|
4545e9f856 | ||
|
|
49136cd513 | ||
|
|
16ace871f3 | ||
|
|
4dde74dae8 | ||
|
|
0d81c0a8c7 | ||
|
|
61a870c842 | ||
|
|
396eacd821 | ||
|
|
ca3216c9ae | ||
|
|
92c252206b | ||
|
|
accba27143 | ||
|
|
040cdff758 | ||
|
|
bcab5a28a5 | ||
|
|
cd765480f2 | ||
|
|
50192c3ed7 | ||
|
|
d35f3ae11f | ||
|
|
bd37be6edd | ||
|
|
fd7be8bc8f | ||
|
|
4e59b4292c | ||
|
|
57dec3a67d | ||
|
|
ed1e041772 | ||
|
|
58da3cfa14 | ||
|
|
fd8889c85b | ||
|
|
def236013c | ||
|
|
1dbef5b79f | ||
|
|
f63018e9b5 | ||
|
|
49d27bdc83 | ||
|
|
33a35e056b | ||
|
|
7c2b54b21e | ||
|
|
d7487e5e4a | ||
|
|
a140d348a3 | ||
|
|
e8acfe1aff | ||
|
|
60feda37c7 | ||
|
|
93a18dff8f | ||
|
|
08c07cd420 | ||
|
|
08fbd37c67 | ||
|
|
51c616f6a8 | ||
|
|
10891800ac | ||
|
|
e53c87bc5d | ||
|
|
1e241f19a9 | ||
|
|
fd08c444e6 | ||
|
|
f9eba749d7 | ||
|
|
8a90f6c3ad | ||
|
|
61e660abb9 | ||
|
|
c35e478053 | ||
|
|
9d9e22bbbf | ||
|
|
371bf72731 | ||
|
|
b8a0e88098 | ||
|
|
dc35556033 | ||
|
|
2d69cd14a9 | ||
|
|
1575ff5b59 | ||
|
|
c7bcb06440 | ||
|
|
0f1b35f61b | ||
|
|
467194d9b6 | ||
|
|
365738c9e2 | ||
|
|
7753eed96f | ||
|
|
4937b79d09 | ||
|
|
c0eea35fcb | ||
|
|
a7efd265c0 | ||
|
|
e506051a5b | ||
|
|
d85926e0cf | ||
|
|
1c7bd47f2d | ||
|
|
a460193410 | ||
|
|
f8b9627ac5 | ||
|
|
2bd74093d6 | ||
|
|
9a9f7322bf | ||
|
|
f94d869a9b | ||
|
|
274b8bdee7 | ||
|
|
bd168eeaad | ||
|
|
f509c4c435 | ||
|
|
2d3b605d6f | ||
|
|
2825ff93f6 | ||
|
|
f07e5bc8ea | ||
|
|
4f3d99485b | ||
|
|
be153092d7 | ||
|
|
d29096165b | ||
|
|
a33296462b | ||
|
|
10349c7e01 | ||
|
|
d529d2b19c | ||
|
|
63d6cd97cb | ||
|
|
556bf008c9 | ||
|
|
f08e0f77bd | ||
|
|
c1e644e298 | ||
|
|
decd933ec9 | ||
|
|
6cc65521df | ||
|
|
b21a8f477d | ||
|
|
ec42787081 | ||
|
|
b9486dfe71 | ||
|
|
608cb943ff | ||
|
|
de653435c9 | ||
|
|
a47a52fd33 | ||
|
|
9173804e1f | ||
|
|
bcb1ab7077 | ||
|
|
641b3c3a27 | ||
|
|
70e16c24be | ||
|
|
2d950f8de6 | ||
|
|
8c4827362a | ||
|
|
ada88fa941 | ||
|
|
c6bb93ef85 | ||
|
|
70bb51efed | ||
|
|
159383909b | ||
|
|
a939b979e6 | ||
|
|
1aea294e0b | ||
|
|
785731e6ee | ||
|
|
4a29037187 | ||
|
|
bad3094753 | ||
|
|
c56e7e0d33 | ||
|
|
b270f2184a | ||
|
|
c9696ffda7 | ||
|
|
2d2c13fa44 | ||
|
|
59a43aeeb3 | ||
|
|
fe9924ea93 | ||
|
|
e6a450f7ed | ||
|
|
52fb1ea4d6 | ||
|
|
f5bffdc45d | ||
|
|
8d5ff86730 | ||
|
|
285135278e | ||
|
|
175bf9790f | ||
|
|
1e69c26406 | ||
|
|
ecad4f2956 | ||
|
|
4791321c6b | ||
|
|
d59831fba9 | ||
|
|
0259d93a5f | ||
|
|
ef9d30dc02 | ||
|
|
32d57bb4c9 | ||
|
|
2b61e1aeed | ||
|
|
86656d3255 | ||
|
|
3e9b5f9cb4 | ||
|
|
0a6b754d8d | ||
|
|
05ff977879 | ||
|
|
3f7e5cf977 | ||
|
|
8d16a7ecc8 | ||
|
|
b243620314 | ||
|
|
0979eb2d5b | ||
|
|
dc7f46c388 | ||
|
|
69262873f5 | ||
|
|
818f20ada7 | ||
|
|
d4ed5bacb5 | ||
|
|
e25f9792ba | ||
|
|
3acc35a3fc | ||
|
|
13501768c0 | ||
|
|
e1ad2787bf | ||
|
|
13adfb6d0e | ||
|
|
d47f9a7cbf | ||
|
|
9a109dc04d | ||
|
|
0baf3d70f0 | ||
|
|
d322f3e58d | ||
|
|
3c716c531d | ||
|
|
dd700cf503 | ||
|
|
3e31ac95cd | ||
|
|
67c5e4bd27 | ||
|
|
6b84ce2f40 | ||
|
|
cb0bae6ef8 | ||
|
|
92e864d54d | ||
|
|
de330f7d1a | ||
|
|
922dfe46d8 | ||
|
|
320253280e | ||
|
|
b00337aa84 | ||
|
|
ec8d8f8d52 | ||
|
|
9668f9bcc8 | ||
|
|
7b4e38e0a6 | ||
|
|
b6546c8a6a | ||
|
|
d206b50808 | ||
|
|
d6063caca2 | ||
|
|
a4ab3288cc | ||
|
|
be0a15870e | ||
|
|
ef3e1ddfdf | ||
|
|
06f5f562aa | ||
|
|
f1836b812a | ||
|
|
4a2aa32363 | ||
|
|
3a109e38e0 | ||
|
|
672eda858a | ||
|
|
291827ef18 | ||
|
|
bcf16a2550 | ||
|
|
d462bb102e | ||
|
|
e3d8f93fdd | ||
|
|
c6cae98b06 | ||
|
|
6ceab96a3b | ||
|
|
94f52bf536 | ||
|
|
71b0ec5043 | ||
|
|
6ef2311075 | ||
|
|
9c8e81767c | ||
|
|
7144d76f46 | ||
|
|
be568c1ee7 | ||
|
|
bd8cb93189 | ||
|
|
75fdc89614 | ||
|
|
ce16f788cf | ||
|
|
d00d48e97c | ||
|
|
7a924bc194 | ||
|
|
0195cf74be | ||
|
|
2c08ee2b9e | ||
|
|
062db0d664 | ||
|
|
1b6a4dc3b7 | ||
|
|
bc36e9dd0c | ||
|
|
7eb3fa8a45 | ||
|
|
7337d34dc1 | ||
|
|
16b906ec80 | ||
|
|
099426dba3 | ||
|
|
eaeae9c9f9 | ||
|
|
e3a1b47d04 | ||
|
|
0f1b409dfb | ||
|
|
4e91a6e488 | ||
|
|
8cf50cdd84 | ||
|
|
aa8916c463 | ||
|
|
3c996673c2 | ||
|
|
0299f215cc | ||
|
|
c019b24d18 | ||
|
|
4e3c4a518c | ||
|
|
a7f1456b9c | ||
|
|
c1f72c5bcd | ||
|
|
a5b108bc51 | ||
|
|
a7261a4ea8 | ||
|
|
8d64d78a5f | ||
|
|
5f391b7e81 | ||
|
|
c6864fc4fc | ||
|
|
ab1413285d | ||
|
|
598199b3a5 | ||
|
|
da600acca1 | ||
|
|
e2e226b38b | ||
|
|
8da1d91e69 | ||
|
|
19ffddc927 | ||
|
|
14134c617e | ||
|
|
e1d109ba5e | ||
|
|
b9f759ce33 | ||
|
|
c8d2ac2c6c | ||
|
|
424090734c | ||
|
|
5f98e8fe8e | ||
|
|
661c69b39b | ||
|
|
77553ccede | ||
|
|
476e9ce6a5 | ||
|
|
8081bf16e2 | ||
|
|
9f21280dee | ||
|
|
7ce1a53095 | ||
|
|
29025a4bb3 | ||
|
|
55fc7c214c | ||
|
|
bb92c09e2c | ||
|
|
087ab6aea2 | ||
|
|
97c31386d4 | ||
|
|
de6d2cb7e5 | ||
|
|
7e64a9cd0a | ||
|
|
7a7238f66d | ||
|
|
2b76afd7dc | ||
|
|
e054a15e04 | ||
|
|
d37fafaf19 | ||
|
|
113f6d8634 | ||
|
|
66b24d028d | ||
|
|
331f06654c | ||
|
|
513641e110 | ||
|
|
9bbc1e268e | ||
|
|
558655a970 | ||
|
|
4e5fe43329 | ||
|
|
ab8e448055 | ||
|
|
216a0aac23 | ||
|
|
85bcbd5f7a | ||
|
|
cf05d67b8c | ||
|
|
a64f983145 | ||
|
|
bfb12a9b40 | ||
|
|
d4ded98203 | ||
|
|
b4155293fd | ||
|
|
c4449cb256 | ||
|
|
d9893762d6 | ||
|
|
d6b9f0f39a | ||
|
|
3643b3db58 | ||
|
|
3371efedb4 | ||
|
|
7213b30c36 | ||
|
|
060ff5394c | ||
|
|
aeb0aaa71b | ||
|
|
9ec400a387 | ||
|
|
860319f79c | ||
|
|
8383e3914a | ||
|
|
28fb9d9eed | ||
|
|
af19acb140 | ||
|
|
c979e2cde7 | ||
|
|
ab510b97db | ||
|
|
21a48510e3 | ||
|
|
bde4810ce6 | ||
|
|
4004fff4e0 | ||
|
|
1b13c48dbc | ||
|
|
1298790f23 | ||
|
|
cf051f307b | ||
|
|
d7ef05ed1d | ||
|
|
41971a3e9a | ||
|
|
c67e8bf9ee | ||
|
|
70974df7db | ||
|
|
9f19a95bf2 | ||
|
|
c1194b5b47 | ||
|
|
cbe28762a4 | ||
|
|
0432e0f9ba | ||
|
|
4605357768 | ||
|
|
b11d2ed3b6 | ||
|
|
e924648f8c | ||
|
|
0dffd04e0e | ||
|
|
1ba87f5fbd | ||
|
|
58c1412c7b | ||
|
|
695d072d41 | ||
|
|
debaa35e88 | ||
|
|
6cb62f7dc6 | ||
|
|
37c2653dd1 | ||
|
|
8df56bf066 | ||
|
|
31ed8fb267 | ||
|
|
6bf2c9e247 | ||
|
|
722f0ff4e1 | ||
|
|
a59f490a9f | ||
|
|
15d1d9dd9c | ||
|
|
80df5a3374 | ||
|
|
e8115fb7f2 | ||
|
|
b343a69fdd | ||
|
|
d53055b7e8 | ||
|
|
e6864ce05b | ||
|
|
30255d6255 | ||
|
|
47b81c7f4d | ||
|
|
c2fd089d26 | ||
|
|
51c3452d11 | ||
|
|
9dffc61f80 | ||
|
|
feb04644ee | ||
|
|
05a2b453a6 | ||
|
|
a8a0474845 | ||
|
|
91322dd77a | ||
|
|
212c14bc97 | ||
|
|
910d59af8e | ||
|
|
18a219a4b2 | ||
|
|
44ee0824d1 | ||
|
|
dae2cd6398 | ||
|
|
516fea4749 | ||
|
|
746b3dd00b | ||
|
|
8919fc8de8 | ||
|
|
192d6d9064 | ||
|
|
6b48cb2e17 | ||
|
|
2919a5feb9 | ||
|
|
941faf963e | ||
|
|
231a1e21e9 | ||
|
|
329a83ad9f | ||
|
|
3590d16a9f | ||
|
|
34e50ed326 | ||
|
|
43d0d0e4ee | ||
|
|
aec04a773f | ||
|
|
b86e9f2ff2 | ||
|
|
3831584c2e | ||
|
|
f58cd85384 | ||
|
|
c9a97b033b | ||
|
|
905a1bafc7 | ||
|
|
a62b18d55f | ||
|
|
c332172e2c | ||
|
|
b5ba9b5b72 | ||
|
|
01ba62d67b | ||
|
|
cc95b0e8b1 | ||
|
|
f15f2c057c | ||
|
|
dac585682d | ||
|
|
5ab47bf0c0 | ||
|
|
cf9e07cfa0 | ||
|
|
1f9608ebc3 | ||
|
|
ed0ff6f519 | ||
|
|
e5ef9193c5 | ||
|
|
fbc7b0e509 | ||
|
|
4e7d561f99 | ||
|
|
3d17db0dcf | ||
|
|
dd99818c30 | ||
|
|
974c0777cc | ||
|
|
e5bb55672b | ||
|
|
6813038dde | ||
|
|
1b3d1898b6 | ||
|
|
c8dc0e1c0c | ||
|
|
86a15af733 | ||
|
|
f6109ac0ba | ||
|
|
637938f272 | ||
|
|
c3f1838328 | ||
|
|
6915509db8 | ||
|
|
cce50feb48 | ||
|
|
15468857a8 | ||
|
|
5f9fe6fb8a | ||
|
|
b0da4f99a3 | ||
|
|
fe8278e78f | ||
|
|
11c9b76503 | ||
|
|
81cb9671d5 | ||
|
|
761b159955 | ||
|
|
49a9d4f853 | ||
|
|
fff8b0e6e4 | ||
|
|
dc824c3006 | ||
|
|
d028ae87b8 | ||
|
|
9c554cd98b | ||
|
|
a2e146f240 | ||
|
|
e586c18cb5 | ||
|
|
214e44ba18 | ||
|
|
126ad52993 | ||
|
|
3dd3fa5fea | ||
|
|
0aeb8cb2ed | ||
|
|
289c42d817 | ||
|
|
1b036924a6 | ||
|
|
bcaf230c7a | ||
|
|
627b5340af | ||
|
|
e70b568c25 | ||
|
|
a527226685 | ||
|
|
a3854291d7 | ||
|
|
306386c0b9 | ||
|
|
80af0cab46 | ||
|
|
c2bba5201e | ||
|
|
65515dc44a | ||
|
|
63a4bcfeb5 | ||
|
|
e691d32024 | ||
|
|
2c09824abe | ||
|
|
57dbe911a3 | ||
|
|
331fe8330f | ||
|
|
b32ee09c8f | ||
|
|
9422a6d178 | ||
|
|
6582763782 | ||
|
|
df8e89cdb9 | ||
|
|
d7275460e4 | ||
|
|
b0f110daff | ||
|
|
df289582fc | ||
|
|
2855038af9 | ||
|
|
7eb46df189 | ||
|
|
c132df4a7b | ||
|
|
9d71d451b9 | ||
|
|
fab6f7b788 | ||
|
|
79011b4f90 | ||
|
|
d026de01dd | ||
|
|
a5f5026375 | ||
|
|
319ad1705e | ||
|
|
4b4336a91d | ||
|
|
7d79becfbd | ||
|
|
ea90c5aaa6 | ||
|
|
b675c197ce | ||
|
|
39a8a91c10 | ||
|
|
746a26eb74 | ||
|
|
2db9c7a614 | ||
|
|
e32f43c694 | ||
|
|
788ddff855 | ||
|
|
f451897ae7 | ||
|
|
4a99364b5c | ||
|
|
bec90bdd5c | ||
|
|
7df4319b3e | ||
|
|
a8500cf25d | ||
|
|
9fb6f4bc07 | ||
|
|
f9fc83ddba | ||
|
|
72ab9614f3 | ||
|
|
ca84108c43 | ||
|
|
196e927400 | ||
|
|
1287944895 | ||
|
|
0cc9e8a2d7 | ||
|
|
6e5da338ec | ||
|
|
296cc427f1 | ||
|
|
8cd5129a74 | ||
|
|
d830b1de0e | ||
|
|
cd2995a11b | ||
|
|
29dab0d8f3 | ||
|
|
35997c43cb | ||
|
|
971ab02ae2 | ||
|
|
a7d36b2a89 | ||
|
|
c4f3341e83 | ||
|
|
0745c2980d | ||
|
|
148dcd2c00 | ||
|
|
39b4b59298 | ||
|
|
5ed050e322 | ||
|
|
3f5bbac8b8 | ||
|
|
de965d524d | ||
|
|
c8d3cc14a8 | ||
|
|
20c114834b | ||
|
|
04ada11a89 | ||
|
|
31687f30cf | ||
|
|
6d10ebd1c9 | ||
|
|
c826bcdacb | ||
|
|
f3c10a6811 | ||
|
|
bdbc9b998e | ||
|
|
a13b63d54b | ||
|
|
7100359a84 | ||
|
|
251479d8f3 | ||
|
|
32a155b983 | ||
|
|
5cc842d4b3 | ||
|
|
8d171aab67 | ||
|
|
f0c81c7d74 | ||
|
|
a599a6544a | ||
|
|
c5205e865b | ||
|
|
972af13e36 | ||
|
|
0b0e2c09e5 | ||
|
|
54222cc0b9 | ||
|
|
f36f8e69e5 | ||
|
|
64c944dd10 | ||
|
|
ac84106d13 | ||
|
|
764e29ea40 | ||
|
|
788bd3dc89 | ||
|
|
ed29dd348e | ||
|
|
23949df397 | ||
|
|
36b1a75460 | ||
|
|
a19ccc06ec | ||
|
|
e6906093bd | ||
|
|
57180617c4 | ||
|
|
b8b3e79c89 | ||
|
|
5973a24e47 | ||
|
|
f0d11942ef | ||
|
|
3ed07c30b6 | ||
|
|
5b8b7a92ca | ||
|
|
9715f661f8 | ||
|
|
7ce550ea4b | ||
|
|
4a4fd54cf6 | ||
|
|
f034e62cbd | ||
|
|
4e98f30779 | ||
|
|
f849645ee2 | ||
|
|
f88e4783cf | ||
|
|
3c7741ac29 | ||
|
|
07fb93e9a2 | ||
|
|
1ce32669fa | ||
|
|
52d7038694 | ||
|
|
0dd7b60d43 | ||
|
|
397f220718 | ||
|
|
70ec6a1c15 | ||
|
|
bb8a3d7dca | ||
|
|
fecc0c61eb | ||
|
|
0773f3467b | ||
|
|
94cc32c946 | ||
|
|
06b7ab6997 | ||
|
|
c51e3ae17c | ||
|
|
f732ee7ed2 | ||
|
|
68c4e97c48 | ||
|
|
3dff96feaa | ||
|
|
9a2b8c3aa1 | ||
|
|
49dec39aa9 | ||
|
|
26c9d108dc | ||
|
|
c2dfa024ee | ||
|
|
3d9565db10 | ||
|
|
d5545015ef | ||
|
|
9c027e79d9 | ||
|
|
8191cddc17 | ||
|
|
95736afb74 | ||
|
|
a04ca26cbf | ||
|
|
18e7b43363 | ||
|
|
24f5e22778 | ||
|
|
8c96e7942d | ||
|
|
8ad09cf030 | ||
|
|
2f4d298701 | ||
|
|
6c75387d25 | ||
|
|
b45ea39946 | ||
|
|
da207089b6 | ||
|
|
77cc0a07e9 | ||
|
|
d1d7010e5c | ||
|
|
f1d1aa0b46 | ||
|
|
2cd42b9ff9 | ||
|
|
b8f0e2e3c7 | ||
|
|
d668fc5de5 | ||
|
|
472be89b7c | ||
|
|
6f5db6157a | ||
|
|
6d6b708d6d | ||
|
|
f64ca7742b | ||
|
|
33f0d2fc11 | ||
|
|
5f6195af04 | ||
|
|
883d8d0e9d | ||
|
|
fc88536775 | ||
|
|
241d2d762b | ||
|
|
66384342a9 | ||
|
|
70d202889b | ||
|
|
52b8f2c72b | ||
|
|
cc43410934 | ||
|
|
d925c163b6 | ||
|
|
5e149c858e | ||
|
|
02dc1b38dc | ||
|
|
c374a1f622 | ||
|
|
9a8ecff9c0 | ||
|
|
4038ce187a | ||
|
|
7eceaf6714 | ||
|
|
13e681f359 | ||
|
|
e3a85c2378 | ||
|
|
df761b7872 | ||
|
|
a8384ba264 | ||
|
|
3ecb22a80b | ||
|
|
cb20b66654 | ||
|
|
2c96b9b24c | ||
|
|
59ed9f9a48 | ||
|
|
f708c3addf | ||
|
|
8cb12e4158 | ||
|
|
54c0930bf7 | ||
|
|
cd2621e849 | ||
|
|
f7e6b011ab | ||
|
|
b0596a4a03 | ||
|
|
ead16f740d | ||
|
|
94b5898f8d | ||
|
|
a22ab7531b | ||
|
|
98abd65ab2 | ||
|
|
d471695aea | ||
|
|
eaa6f67a71 | ||
|
|
5e2ef6007b | ||
|
|
589b31cbeb | ||
|
|
eb148c60f5 | ||
|
|
b5a3c3e7fc | ||
|
|
2795d6e0e2 | ||
|
|
88c978ca37 | ||
|
|
9cbc895934 | ||
|
|
1b4463c060 | ||
|
|
23341251a4 | ||
|
|
3ff13177ef | ||
|
|
1cfaa777c5 | ||
|
|
b9f48c3707 | ||
|
|
b7f68923a3 | ||
|
|
4d250fe326 | ||
|
|
9bdc010363 | ||
|
|
7edc5cfbbe | ||
|
|
bd0cb3611b | ||
|
|
6801fcf5ea | ||
|
|
432cad44e2 | ||
|
|
d1c849bab3 | ||
|
|
6ca99aea7a | ||
|
|
27386147e5 | ||
|
|
ddb3f981e5 | ||
|
|
6b6d5f89f3 | ||
|
|
2bf15eb191 | ||
|
|
180023a2d7 | ||
|
|
8f4f036260 | ||
|
|
e8c76d4d79 | ||
|
|
75fd7b88d9 | ||
|
|
378fefac4f | ||
|
|
a362408f6b | ||
|
|
87a161ec5d | ||
|
|
4346598573 | ||
|
|
200f358489 | ||
|
|
6816d661e3 | ||
|
|
44da356598 | ||
|
|
a943dcb724 | ||
|
|
ef4608e82a | ||
|
|
b5c00e6e60 | ||
|
|
5693435cc2 | ||
|
|
29f9a22a0d | ||
|
|
ce6f3eb6e4 | ||
|
|
b3865af487 | ||
|
|
6541c2e8da | ||
|
|
94025afd98 | ||
|
|
f0b17814b2 | ||
|
|
150ba25539 | ||
|
|
f3f6dfe8d8 | ||
|
|
e57bbcf3b6 | ||
|
|
8e6865783d | ||
|
|
aeda4adfb0 | ||
|
|
30eeff9b56 | ||
|
|
e324519f9c | ||
|
|
75218277dd | ||
|
|
c4234a8c67 | ||
|
|
b57cf10195 | ||
|
|
c37c596aa3 | ||
|
|
cfe71dcfa5 | ||
|
|
5a2eb6a516 | ||
|
|
ba994902a5 | ||
|
|
93876b521a | ||
|
|
36ed0fef31 | ||
|
|
2963eaba88 | ||
|
|
974763d9b1 | ||
|
|
d470daecc3 | ||
|
|
0812916a8c | ||
|
|
a30424396e | ||
|
|
50e199358e | ||
|
|
54d4400365 | ||
|
|
c08597167b | ||
|
|
5f6eb1011e | ||
|
|
33d8f81e70 | ||
|
|
f96090af37 | ||
|
|
7336d9e0b5 | ||
|
|
28d18b3fe2 | ||
|
|
5c16f4c852 | ||
|
|
0c95cba4f1 | ||
|
|
9a83ffce5e | ||
|
|
59f767f587 | ||
|
|
0246071dc0 | ||
|
|
42165f24a1 | ||
|
|
05ec449cf0 | ||
|
|
d08a245552 | ||
|
|
8a4586b4f7 | ||
|
|
48efa2070b | ||
|
|
e0dde95954 | ||
|
|
0d434c76d3 | ||
|
|
4b20a12169 | ||
|
|
9ce30cea88 | ||
|
|
953e4e95fd | ||
|
|
07806cbe19 | ||
|
|
7716bdd089 | ||
|
|
aea254eca8 | ||
|
|
c0baec9032 | ||
|
|
f4ddc6009c | ||
|
|
e1b2d1f0b8 | ||
|
|
2c212bcf3c | ||
|
|
95459e3032 | ||
|
|
d29f638121 | ||
|
|
609f1afc83 | ||
|
|
af0719316a | ||
|
|
349a45442f | ||
|
|
22a63264ba | ||
|
|
5ec8eddb49 | ||
|
|
394e4817a9 | ||
|
|
f4dd6e9335 | ||
|
|
7150fcec2a | ||
|
|
37f318c694 | ||
|
|
561a4a3115 | ||
|
|
13fa038b31 | ||
|
|
bd56e1cac2 | ||
|
|
5ed4d4ff27 | ||
|
|
bacd92f6bd | ||
|
|
a18e956177 | ||
|
|
542f144a0b | ||
|
|
8984b3eb9f | ||
|
|
82948804fa | ||
|
|
4d68f8cff8 | ||
|
|
159634069a | ||
|
|
d024529317 | ||
|
|
5b8ca72619 | ||
|
|
62eb84fb2b | ||
|
|
dc5712fbc2 | ||
|
|
578a8776c7 | ||
|
|
61dfdc30ed | ||
|
|
cd39ec838a | ||
|
|
2cb0b70080 | ||
|
|
606b584c67 | ||
|
|
cd989fcb86 | ||
|
|
953048e352 | ||
|
|
a7dff83e9a | ||
|
|
9aef5b5c3c | ||
|
|
6af2152dde | ||
|
|
943b5ee50a | ||
|
|
5b8cb7bb4c | ||
|
|
38fce2654f | ||
|
|
7dd33c60bc | ||
|
|
634237a465 | ||
|
|
db156c4427 | ||
|
|
73d3688442 | ||
|
|
4c5d22195d | ||
|
|
b9e6b2024a | ||
|
|
4b9e037d02 | ||
|
|
13b4fb51ba | ||
|
|
ab1d6ce62a | ||
|
|
7062700ba4 | ||
|
|
71aa8f61b0 | ||
|
|
695756726e | ||
|
|
116a3e078e | ||
|
|
99144cad40 | ||
|
|
88ae6de546 | ||
|
|
58efa27338 | ||
|
|
5eb0eb940e | ||
|
|
844f16e692 | ||
|
|
8d84153a09 | ||
|
|
697b58ad00 | ||
|
|
11a58db513 | ||
|
|
e07d8383ef | ||
|
|
aec050dd2a | ||
|
|
3140a58b50 | ||
|
|
b0cf53ede5 | ||
|
|
ab5eb680ec | ||
|
|
c7f3ae3b92 | ||
|
|
eec2bf7d68 | ||
|
|
b9ab266923 | ||
|
|
c263d83522 | ||
|
|
d82f9fa210 | ||
|
|
979943e28c | ||
|
|
e68599c201 | ||
|
|
3e3413d2cb | ||
|
|
6a5706b5ab | ||
|
|
7ccbdf2b62 | ||
|
|
b1f8852f84 | ||
|
|
c7fd256104 | ||
|
|
25e2834400 | ||
|
|
7257d9ea3b | ||
|
|
d1ddff807e | ||
|
|
7047728be3 | ||
|
|
e780e210db | ||
|
|
8f0398b23f | ||
|
|
ddf26eb51e | ||
|
|
0aa9d5efd8 | ||
|
|
47b1da8f2c | ||
|
|
67ef4dfb9a | ||
|
|
c2665e8ab1 | ||
|
|
1e7cf1d995 | ||
|
|
95e773d574 | ||
|
|
6064ff51d3 | ||
|
|
46cdecc8f3 | ||
|
|
6607514e50 | ||
|
|
9845480ec7 | ||
|
|
8c503437a8 | ||
|
|
89ebd1bc49 | ||
|
|
ada021190f | ||
|
|
77cfd388b2 | ||
|
|
29b303100b | ||
|
|
695d72618d | ||
|
|
1fa5aafa53 | ||
|
|
e60a1ae5dd | ||
|
|
844e36350c | ||
|
|
6c389d217d | ||
|
|
d9ec28f982 | ||
|
|
bb40138019 | ||
|
|
34bf612540 | ||
|
|
ce09c14eb9 | ||
|
|
5d8c96c6c3 | ||
|
|
87d4c57515 | ||
|
|
ee81c82fec | ||
|
|
8f5ce86a9d | ||
|
|
78f34660c1 | ||
|
|
a7a5e2ff03 | ||
|
|
14c2e8fb7b | ||
|
|
741a5baf4d | ||
|
|
7eddd59e83 | ||
|
|
469644f0bf | ||
|
|
6306d1dc2f | ||
|
|
b9e8885465 | ||
|
|
769e8242e4 | ||
|
|
657f308675 | ||
|
|
18ab2258f2 | ||
|
|
496830aff2 | ||
|
|
3be071ece6 | ||
|
|
857ec2877f | ||
|
|
b6362673fd | ||
|
|
bc01087993 | ||
|
|
fefe0bb8a5 | ||
|
|
ccbc5de87d | ||
|
|
c695660a97 | ||
|
|
9a1148eda0 | ||
|
|
f3b8430a6c | ||
|
|
56d12bc8e0 | ||
|
|
1a5ffb430b | ||
|
|
cd300f685d | ||
|
|
9a448be597 | ||
|
|
59e6adf4a8 | ||
|
|
3f6d6d8487 | ||
|
|
c91d3fedc2 | ||
|
|
7b874305ea | ||
|
|
11f809b1ee | ||
|
|
ef7557a989 | ||
|
|
fffd976e09 | ||
|
|
5dda5c003d | ||
|
|
21089c9020 | ||
|
|
a4dcbe5762 | ||
|
|
1e6ba99b30 | ||
|
|
f1825b4272 | ||
|
|
84840809b7 | ||
|
|
2951b6480c | ||
|
|
e638b2b555 | ||
|
|
848077bb79 | ||
|
|
49a79574c8 | ||
|
|
b03fd3ad93 | ||
|
|
4f1edbefe8 | ||
|
|
04f88c6864 | ||
|
|
98879271af | ||
|
|
dcad4baeb2 | ||
|
|
0d4f1e61ad | ||
|
|
5a025b743a | ||
|
|
806f378fa2 | ||
|
|
85921a688f | ||
|
|
7fe6940156 | ||
|
|
bc552e377a | ||
|
|
1ae18b6ed0 | ||
|
|
f14e86f4e2 | ||
|
|
9323e8f562 | ||
|
|
7c6605ed8b | ||
|
|
bb641fdbaa | ||
|
|
f6324c7720 | ||
|
|
4075bea7ed | ||
|
|
ef00de5be9 | ||
|
|
6a38ef7676 | ||
|
|
c15e202a5b | ||
|
|
0fdb40467e | ||
|
|
e254454834 | ||
|
|
70257027f1 | ||
|
|
490c6897ca | ||
|
|
e0ceff1ee9 | ||
|
|
8295b2b6a6 | ||
|
|
84f5c83a10 | ||
|
|
fba82b9e7a | ||
|
|
9528d56cf3 | ||
|
|
719eb902bd | ||
|
|
06979aa7b7 | ||
|
|
510c2423d2 | ||
|
|
f216293217 | ||
|
|
5829140eff | ||
|
|
7635785c65 | ||
|
|
5a00ef4e01 | ||
|
|
08cfa6778d | ||
|
|
267f2ccd8a | ||
|
|
271c7565fa | ||
|
|
7dcc9e9d95 | ||
|
|
56bde78c23 | ||
|
|
60d598e641 | ||
|
|
a9b1d7e43b | ||
|
|
4213c47f70 | ||
|
|
ca80cc518a | ||
|
|
0a89823eef | ||
|
|
48fafb06a7 | ||
|
|
519bf94796 | ||
|
|
91823711a8 | ||
|
|
dc73e5cef6 | ||
|
|
ab3fde8480 | ||
|
|
9466d1ad0f | ||
|
|
95f3cfd06c | ||
|
|
e33ea312cf | ||
|
|
7043e4bae9 | ||
|
|
1b56107ab7 | ||
|
|
6eb5e8ec19 | ||
|
|
cdac2477b3 | ||
|
|
bff34fa53a | ||
|
|
799705e20d | ||
|
|
03e827f3c1 | ||
|
|
2fc7d538ec | ||
|
|
ff89164460 | ||
|
|
10cd5b4b04 | ||
|
|
d78a110902 | ||
|
|
a668d5a7b8 | ||
|
|
190dda712d | ||
|
|
5ef42f014e | ||
|
|
f12d340f1b | ||
|
|
350480d9d8 | ||
|
|
b868bfb31a | ||
|
|
60fea1acec | ||
|
|
9b04918f3b | ||
|
|
8192cecc4c | ||
|
|
51aa0fbfe3 | ||
|
|
195cd56e1a | ||
|
|
c5c14b6a39 | ||
|
|
21fbeb540e | ||
|
|
7f2ed5ccbe | ||
|
|
ce29a74cca | ||
|
|
1e818beb7b | ||
|
|
8cc1a336c1 | ||
|
|
1e4b25596c | ||
|
|
ac633b67ad | ||
|
|
3e076a19b7 | ||
|
|
d67bce6c2c | ||
|
|
ef0f098c83 | ||
|
|
8bdcd94e29 | ||
|
|
c0808fc268 | ||
|
|
cb566ccbd3 | ||
|
|
0a241f8499 | ||
|
|
55b59b472d | ||
|
|
369f28e650 | ||
|
|
2d21c22f9d | ||
|
|
848120aac4 | ||
|
|
feddc8e960 | ||
|
|
8919369190 | ||
|
|
8f1ab9ea75 | ||
|
|
52ce0e98ad | ||
|
|
dc03510277 | ||
|
|
26077d50d8 | ||
|
|
d4e935b63f | ||
|
|
caf2429980 | ||
|
|
2533321273 | ||
|
|
4df87281a9 | ||
|
|
9a7e03d399 | ||
|
|
5f6a8c30c5 | ||
|
|
7eafa1dd4c | ||
|
|
d6aae70445 | ||
|
|
347feb399c | ||
|
|
114067edf0 | ||
|
|
636d90ebac | ||
|
|
cd8e4119d2 | ||
|
|
e8c2e7ac64 | ||
|
|
0ca566d112 | ||
|
|
a59d796a6d | ||
|
|
8aeef2dacd | ||
|
|
c0276ffe11 | ||
|
|
395e9b6d91 | ||
|
|
06b0068a37 | ||
|
|
038377282f | ||
|
|
33317389ba | ||
|
|
8cfed4babe | ||
|
|
8cf9852d19 | ||
|
|
d102185c03 | ||
|
|
ca1ec5cff4 | ||
|
|
f6d5d2430b | ||
|
|
cc0bc1b4dc | ||
|
|
5be747a14d | ||
|
|
9af4dc78d2 | ||
|
|
78dc821756 | ||
|
|
2b55b6092c | ||
|
|
6e8049bcfd | ||
|
|
078b6507fe | ||
|
|
84890e0612 | ||
|
|
15ea322f05 | ||
|
|
2eb03efcdd | ||
|
|
62bb4104e0 | ||
|
|
29566ebf6d | ||
|
|
bde343ed7f | ||
|
|
fac24c27e3 | ||
|
|
6bb58cd48a | ||
|
|
89f1e2ea47 | ||
|
|
216dea5a61 | ||
|
|
f6dc336fdb | ||
|
|
aadcaa4ec1 | ||
|
|
d1ec3bf6e4 | ||
|
|
f95983b84c | ||
|
|
1122dc8b88 | ||
|
|
ce0ec49084 | ||
|
|
32664a7872 | ||
|
|
4c3ef1e2db | ||
|
|
855b9610a8 | ||
|
|
710f53404d | ||
|
|
99fb6017f4 | ||
|
|
3506b1e893 | ||
|
|
fd9e75afff | ||
|
|
9947fb2825 | ||
|
|
b5d4a968bf | ||
|
|
a90a687539 | ||
|
|
7aae518ae0 | ||
|
|
91e116b49f | ||
|
|
0925934a27 | ||
|
|
683d60d301 | ||
|
|
863d888fa8 | ||
|
|
452117852a | ||
|
|
13a9ed8dc4 | ||
|
|
808602d2d5 | ||
|
|
d0f4c70000 | ||
|
|
09b61f6e64 | ||
|
|
2796078a72 | ||
|
|
6614561c3d | ||
|
|
ab157260c5 | ||
|
|
03ae2d20fd | ||
|
|
be85758a53 | ||
|
|
2cb00a8f4a | ||
|
|
ae0f252d4c | ||
|
|
466e8541a5 | ||
|
|
be3d2f30aa | ||
|
|
9dca203f8e | ||
|
|
e1ced5ee97 | ||
|
|
cd90937335 | ||
|
|
45e057b331 | ||
|
|
e0320585b7 | ||
|
|
1ad635a7d6 | ||
|
|
aee9ddd759 | ||
|
|
7412592f9c | ||
|
|
efdc77ca2a | ||
|
|
c28cabbcc4 | ||
|
|
f94c70c905 | ||
|
|
861b05e390 | ||
|
|
9ff735d1ad | ||
|
|
7be67f38cf | ||
|
|
17d47d00ac | ||
|
|
93dfb3962d | ||
|
|
ea47cf9f3a | ||
|
|
4d347eff29 | ||
|
|
3581ef2de9 | ||
|
|
3460dd628d | ||
|
|
b48e760dfa | ||
|
|
ecc4cbacf2 | ||
|
|
c2d5daf530 | ||
|
|
8080b06dee | ||
|
|
1043d75814 | ||
|
|
a88ae1dd19 | ||
|
|
69a825ccf7 | ||
|
|
1d9df7afd1 | ||
|
|
d3ee664668 | ||
|
|
abab9471bd | ||
|
|
ce67681ee3 | ||
|
|
c0621c83c9 | ||
|
|
36faf98976 | ||
|
|
6dca99bf55 | ||
|
|
e8df6853f1 | ||
|
|
6b924af4b2 | ||
|
|
cab7562f08 | ||
|
|
75f7dd61e2 | ||
|
|
db03f0e3fc | ||
|
|
a23e671ff7 | ||
|
|
5a7c7ec0b6 | ||
|
|
88defe7480 | ||
|
|
00d9d07947 | ||
|
|
e1679b91ee | ||
|
|
4f390903d3 | ||
|
|
596640ff0a | ||
|
|
d68500f3f1 | ||
|
|
cd7f325fc4 | ||
|
|
37ba690bf1 | ||
|
|
f035d401ed | ||
|
|
73ae6fecac | ||
|
|
9d0a97d053 | ||
|
|
45e4924e18 | ||
|
|
e56cec74b4 | ||
|
|
4420bcc126 | ||
|
|
1c9966455e | ||
|
|
245110794e | ||
|
|
0a950567fc | ||
|
|
1c77154fa0 | ||
|
|
ba97584a87 | ||
|
|
9a4aea776f | ||
|
|
0c60a50211 | ||
|
|
71bfa3647d | ||
|
|
f1709b7eea | ||
|
|
d9f69d3a36 | ||
|
|
f72f5a58cc | ||
|
|
716ca698cf | ||
|
|
6da12f666a | ||
|
|
010de69620 | ||
|
|
ecffe94354 | ||
|
|
3814657f3e | ||
|
|
ed12016a9d | ||
|
|
3b020d9f64 | ||
|
|
8e6f97674c | ||
|
|
98890d6198 | ||
|
|
2dc2f43bb2 | ||
|
|
e327282419 | ||
|
|
a384ea263c | ||
|
|
c6431fb76a | ||
|
|
1f6094077f | ||
|
|
909b8efc13 | ||
|
|
6abe331786 | ||
|
|
838a0b30cb | ||
|
|
ed93b122dd | ||
|
|
149348ab9e | ||
|
|
7c0884065f | ||
|
|
eed1a21eae | ||
|
|
c49818001a | ||
|
|
42ff3e9e3a | ||
|
|
fc476a58e6 | ||
|
|
58dceb6fa6 | ||
|
|
ce7e86be94 | ||
|
|
fa07a91825 | ||
|
|
5dd007e4c0 | ||
|
|
2bcb06a690 | ||
|
|
e0b2d75e45 | ||
|
|
44e8268080 | ||
|
|
ba0f8ead95 | ||
|
|
55207c2d12 | ||
|
|
1ab306b335 | ||
|
|
a70a83f9d2 | ||
|
|
1697699b9a | ||
|
|
624c3e13e7 | ||
|
|
afd4757fab | ||
|
|
9ea6fa13e5 | ||
|
|
41c841ccec | ||
|
|
37dbbb898f | ||
|
|
805b7660a6 | ||
|
|
330c3f7085 | ||
|
|
b5f8fcfeba | ||
|
|
17adef6fc2 | ||
|
|
567e9f9540 | ||
|
|
2f4ed0f31b | ||
|
|
0d97ecc09a | ||
|
|
afec3c65ed | ||
|
|
17a55a6941 | ||
|
|
35ac24c699 | ||
|
|
ab74d3fb25 | ||
|
|
8b62f74164 | ||
|
|
fd61a027dd | ||
|
|
e654624bb8 | ||
|
|
223741ae0b | ||
|
|
2dc41d6bf5 | ||
|
|
03e783dbec | ||
|
|
452eae5de8 | ||
|
|
6b48679c13 | ||
|
|
ba2399849f | ||
|
|
22a0665099 | ||
|
|
ea5e30913d | ||
|
|
1bb386962c | ||
|
|
87e7c5616f | ||
|
|
6aa90e5e21 | ||
|
|
a816720e5b | ||
|
|
d30487f10f | ||
|
|
6e63ff8f7c | ||
|
|
ac6f1989ed | ||
|
|
6acb8030bb | ||
|
|
de5fe9e9af | ||
|
|
f85d01574b | ||
|
|
7f6109e927 | ||
|
|
e50b5f9464 | ||
|
|
3b64d1be73 | ||
|
|
17d3f4664f | ||
|
|
9048021e9b | ||
|
|
109c629653 | ||
|
|
af1a4a5973 | ||
|
|
514951087d | ||
|
|
b4d97e34a4 | ||
|
|
a628ec42ca | ||
|
|
e59bfaaada | ||
|
|
51a4e988b1 | ||
|
|
f1afedd412 | ||
|
|
7867148daf | ||
|
|
b687d11813 | ||
|
|
de424e8b2f | ||
|
|
a7bd1576fd | ||
|
|
230fede891 | ||
|
|
a13a7ffd28 | ||
|
|
79c8e4b873 | ||
|
|
e7a72d31ae | ||
|
|
714fb74c24 | ||
|
|
aaadd24076 | ||
|
|
2077e4e6a4 | ||
|
|
2f12b88ae7 | ||
|
|
80e0dad1c8 | ||
|
|
97fd70d685 | ||
|
|
baae2b6f3c | ||
|
|
5a0156c1fc | ||
|
|
a50e0de122 | ||
|
|
5bc589fc3f | ||
|
|
a1ec9373e1 | ||
|
|
c9a6465a45 | ||
|
|
94782a8b1f | ||
|
|
ddae0b00e5 | ||
|
|
385b5b1262 | ||
|
|
21df92fc11 | ||
|
|
40235fd9cb | ||
|
|
76da2e9a28 | ||
|
|
6372d68ce3 | ||
|
|
7796e18bc5 | ||
|
|
2fce0b4e66 |
No files matched your search
@@ -1,4 +1,3 @@
|
||||
# $FreeBSD$
|
||||
# @(#)COPYRIGHT 8.2 (Berkeley) 3/21/94
|
||||
|
||||
All of the documentation and software included in the 4.4BSD and 4.4BSD-Lite
|
||||
@@ -63,35 +62,3 @@ The views and conclusions contained in the software and documentation are
|
||||
those of the authors and should not be interpreted as representing official
|
||||
policies, either expressed or implied, of the Regents of the University
|
||||
of California.
|
||||
|
||||
|
||||
NOTE: The copyright of UC Berkeley's Berkeley Software Distribution ("BSD")
|
||||
source has been updated. The copyright addendum may be found at
|
||||
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change and is
|
||||
included below.
|
||||
|
||||
July 22, 1999
|
||||
|
||||
To All Licensees, Distributors of Any Version of BSD:
|
||||
|
||||
As you know, certain of the Berkeley Software Distribution ("BSD") source
|
||||
code files require that further distributions of products containing all or
|
||||
portions of the software, acknowledge within their advertising materials
|
||||
that such products contain software developed by UC Berkeley and its
|
||||
contributors.
|
||||
|
||||
Specifically, the provision reads:
|
||||
|
||||
" * 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors."
|
||||
|
||||
Effective immediately, licensees and distributors are no longer required to
|
||||
include the acknowledgement within advertising materials. Accordingly, the
|
||||
foregoing paragraph of those BSD Unix files containing it is hereby deleted
|
||||
in its entirety.
|
||||
|
||||
William Hoskins
|
||||
Director, Office of Technology Licensing
|
||||
University of California, Berkeley
|
||||
@@ -1,137 +1,518 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile,v 1.109.2.4 1997/05/13 16:09:59 jdp Exp $
|
||||
#
|
||||
# The user-driven targets are:
|
||||
# Make command line options:
|
||||
# -DCLOBBER will remove /usr/include
|
||||
# -DMAKE_LOCAL to add ./local to the SUBDIR list
|
||||
# -DMAKE_PORTS to add ./ports to the SUBDIR list
|
||||
# -DMAKE_EBONES to build eBones (KerberosIV)
|
||||
# -DALLLANG to build documentation for all languages
|
||||
# (where available -- see share/doc/Makefile)
|
||||
#
|
||||
# buildworld - Rebuild *everything*, including glue to help do
|
||||
# upgrades.
|
||||
# installworld - Install everything built by "buildworld".
|
||||
# world - buildworld + installworld.
|
||||
# update - Convenient way to update your source tree (cvs).
|
||||
# upgrade - Upgrade a.out (2.2.x/3.0) system to the new ELF way
|
||||
# most - Build user commands, no libraries or include files.
|
||||
# installmost - Install user commands, no libraries or include files.
|
||||
# aout-to-elf - Upgrade an system from a.out to elf format (see below).
|
||||
# aout-to-elf-build - Build everything required to upgrade a system from
|
||||
# a.out to elf format (see below).
|
||||
# aout-to-elf-install - Install everything built by aout-to-elf-build (see
|
||||
# below).
|
||||
# move-aout-libs - Move the a.out libraries into an aout sub-directory
|
||||
# of each elf library sub-directory.
|
||||
#
|
||||
# This makefile is simple by design. The FreeBSD make automatically reads
|
||||
# the /usr/share/mk/sys.mk unless the -m argument is specified on the
|
||||
# command line. By keeping this makefile simple, it doesn't matter too
|
||||
# much how different the installed mk files are from those in the source
|
||||
# tree. This makefile executes a child make process, forcing it to use
|
||||
# the mk files from the source tree which are supposed to DTRT.
|
||||
#
|
||||
# The user-driven targets (as listed above) are implemented in Makefile.inc0
|
||||
# and the private targets are in Makefile.inc1. These are kept separate
|
||||
# to help the bootstrap build from aout to elf format.
|
||||
#
|
||||
# For novices wanting to build from current sources, the simple instructions
|
||||
# are:
|
||||
#
|
||||
# 1. Ensure that your /usr/obj directory has at least 260 Mb of free space.
|
||||
# 2. `cd /usr/src' (or to the directory containing your source tree).
|
||||
# 3. `make world'
|
||||
#
|
||||
# Be warned, this will update your installed system, except for configuration
|
||||
# files in the /etc directory. You have to do those manually.
|
||||
#
|
||||
# If at first you're a little nervous about having a `make world' update
|
||||
# your system, a `make buildworld' will build everything in the /usr/obj
|
||||
# tree without touching your installed system. To be of any further use
|
||||
# though, a `make installworld' is required.
|
||||
#
|
||||
# The `make world' process always follows the installed object format.
|
||||
# This is set by creating /etc/objformat containing either OBJFORMAT=aout
|
||||
# or OBJFORMAT=elf. If this file does not exist, the object format defaults
|
||||
# to aout. This is expected to be changed to elf just prior to the release
|
||||
# or 3.0. If OBJFORMAT is set as an environment variable or in /etc/make.conf,
|
||||
# this overrides /etc/objformat.
|
||||
#
|
||||
# If -DWANT_AOUT is specified, a `make world' with OBJFORMAT=elf will
|
||||
# update the legacy support for aout. This includes all libraries, ld.so
|
||||
# and boot objects. This part of build should be regarded as
|
||||
# deprecated and you should _not_ expect to be able to do this past the
|
||||
# release of 3.1. You have exactly one major release to move entirely
|
||||
# to elf.
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
#
|
||||
# Upgrading an i386 system from a.out to elf format
|
||||
#
|
||||
#
|
||||
# The aout->elf transition build is performed by doing a `make upgrade' (or
|
||||
# `make aout-to-elf') or in two steps by a `make aout-to-elf-build' followed
|
||||
# by a `make aout-to-elf-install', depending on user preference.
|
||||
# You need to have at least 320 Mb of free space for the object tree.
|
||||
#
|
||||
# The upgrade process checks the installed release. If this is 3.0-CURRENT,
|
||||
# it is assumed that your kernel contains all the syscalls required by the
|
||||
# current sources.
|
||||
#
|
||||
# The upgrade procedure will stop and ask for confirmation to proceed
|
||||
# several times. On each occasion, you can type Ctrl-C to abort the
|
||||
# upgrade. Optionally, you can also start it with NOCONFIRM=yes and skip
|
||||
# the confirmation steps.
|
||||
#
|
||||
# At the end of the upgrade procedure, /etc/objformat is created or
|
||||
# updated to contain OBJFORMAT=elf. From then on, you're elf by default.
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
# Define the user-driven targets. These are listed here in alphabetical
|
||||
# order, but that's not important.
|
||||
#
|
||||
TGTS = afterdistribute all buildworld checkdpadd clean cleandepend cleandir \
|
||||
depend distribute everything hierarchy includes install installmost \
|
||||
installworld lint maninstall mk most obj objlink regress rerelease \
|
||||
tags update world
|
||||
# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
|
||||
# -DNOCLEAN do not clean at all
|
||||
# -DNOCRYPT will prevent building of crypt versions
|
||||
# -DNOLKM do not build loadable kernel modules
|
||||
# -DNOOBJDIR do not run ``${MAKE} obj''
|
||||
# -DNOPROFILE do not build profiled libraries
|
||||
# -DNOSECURE do not go into secure subdir
|
||||
# -DNOGAMES do not go into games subdir
|
||||
# -DNOSHARE do not go into share subdir
|
||||
# -DNOINFO do not make or install info files
|
||||
|
||||
#
|
||||
# Handle the user-driven targets, using the source relative mk files.
|
||||
# The intended user-driven targets are:
|
||||
# world - rebuild *everything*, including glue to help do upgrades.
|
||||
# reinstall - use an existing (eg: NFS mounted) build to do an update.
|
||||
# update - convenient way to update your source tree (eg: sup/cvs)
|
||||
# most - build user commands, no libraries or include files
|
||||
# installmost - install user commands, no libraries or include files
|
||||
#
|
||||
${TGTS} : upgrade_checks
|
||||
@cd ${.CURDIR}; \
|
||||
${MAKE} -f Makefile.inc0 -m ${.CURDIR}/share/mk ${.TARGET}
|
||||
# Standard targets (not defined here) are documented in the makefiles in
|
||||
# /usr/share/mk. These include:
|
||||
# obj depend all install clean cleandepend cleanobj
|
||||
|
||||
# Set a reasonable default
|
||||
.MAIN: all
|
||||
|
||||
# Put initial settings here.
|
||||
SUBDIR=
|
||||
|
||||
# We must do include and lib first so that the perl *.ph generation
|
||||
# works correctly as it uses the header files installed by this.
|
||||
.if exists(include)
|
||||
SUBDIR+= include
|
||||
.endif
|
||||
.if exists(lib)
|
||||
SUBDIR+= lib
|
||||
.endif
|
||||
|
||||
.if exists(bin)
|
||||
SUBDIR+= bin
|
||||
.endif
|
||||
.if exists(games) && !defined(NOGAMES)
|
||||
SUBDIR+= games
|
||||
.endif
|
||||
.if exists(gnu)
|
||||
SUBDIR+= gnu
|
||||
.endif
|
||||
.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
|
||||
SUBDIR+= eBones
|
||||
.endif
|
||||
.if exists(libexec)
|
||||
SUBDIR+= libexec
|
||||
.endif
|
||||
.if exists(sbin)
|
||||
SUBDIR+= sbin
|
||||
.endif
|
||||
.if exists(share) && !defined(NOSHARE)
|
||||
SUBDIR+= share
|
||||
.endif
|
||||
.if exists(sys)
|
||||
SUBDIR+= sys
|
||||
.endif
|
||||
.if exists(usr.bin)
|
||||
SUBDIR+= usr.bin
|
||||
.endif
|
||||
.if exists(usr.sbin)
|
||||
SUBDIR+= usr.sbin
|
||||
.endif
|
||||
.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
SUBDIR+= secure
|
||||
.endif
|
||||
.if exists(lkm) && !defined(NOLKM)
|
||||
SUBDIR+= lkm
|
||||
.endif
|
||||
|
||||
# etc must be last for "distribute" to work
|
||||
.if exists(etc) && make(distribute)
|
||||
SUBDIR+= etc
|
||||
.endif
|
||||
|
||||
# These are last, since it is nice to at least get the base system
|
||||
# rebuilt before you do them.
|
||||
.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
|
||||
SUBDIR+= local
|
||||
.endif
|
||||
.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
|
||||
SUBDIR+= ports
|
||||
.endif
|
||||
|
||||
# Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
|
||||
.if defined(NOOBJDIR)
|
||||
OBJDIR=
|
||||
.else
|
||||
OBJDIR= obj
|
||||
.endif
|
||||
|
||||
.if defined(NOCLEAN)
|
||||
CLEANDIR=
|
||||
.else
|
||||
.if defined(NOCLEANDIR)
|
||||
CLEANDIR= clean
|
||||
.else
|
||||
CLEANDIR= cleandir
|
||||
.endif
|
||||
.endif
|
||||
|
||||
SUP?= sup
|
||||
SUPFLAGS?= -v
|
||||
|
||||
#
|
||||
# Perform a few tests to determine if the installed tools are adequate
|
||||
# for building the world. These are for older systems (prior to 2.2.5).
|
||||
# While building tools for bootstrapping, we dont need to waste time on
|
||||
# profiled libraries or man pages. This speeds things up somewhat.
|
||||
#
|
||||
# From 2.2.5 onwards, the installed tools will pass these upgrade tests,
|
||||
# so the normal make world is capable of doing what is required to update
|
||||
# the system to current.
|
||||
#
|
||||
upgrade_checks :
|
||||
@cd ${.CURDIR}; if `make -m ${.CURDIR}/share/mk test > /dev/null 2>&1`; then ok=1; else ${MAKE} -f Makefile.upgrade make; fi;
|
||||
MK_FLAGS= -DNOINFO -DNOMAN -DNOPROFILE
|
||||
|
||||
#
|
||||
# A simple test target used as part of the test to see if make supports
|
||||
# the -m argument.
|
||||
# world
|
||||
#
|
||||
test :
|
||||
# Attempt to rebuild and reinstall *everything*, with reasonable chance of
|
||||
# success, regardless of how old your existing system is.
|
||||
#
|
||||
# >> Beware, it overwrites the local build environment! <<
|
||||
#
|
||||
world:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo "make world started on `LC_TIME=C date`"
|
||||
@echo "--------------------------------------------------------------"
|
||||
.if target(pre-world)
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Making 'pre-world' target"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} pre-world
|
||||
@echo
|
||||
.endif
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Making hierarchy"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} hierarchy
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding /usr/share/mk"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} mk
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Cleaning up the source tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
.if defined(NOCLEAN)
|
||||
@echo "Not cleaning anything! I sure hope you know what you are doing!"
|
||||
.else
|
||||
cd ${.CURDIR} && ${MAKE} ${CLEANDIR}
|
||||
.endif
|
||||
@echo
|
||||
.if !defined(NOOBJDIR)
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding the obj tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} obj
|
||||
@echo
|
||||
.endif
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding bootstrap tools"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} bootstrap
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding tools necessary to build the include files"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} include-tools
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding /usr/include"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} includes
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding tools needed to build the libraries"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} lib-tools
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding /usr/lib"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} libraries
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding sgml tools, symorder, groff and zic(8)"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} build-tools
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding dependencies"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} depend
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Building everything.."
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} all
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Installing everything.."
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} install
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding man page indexes"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/share/man && ${MAKE} makedb
|
||||
.if target(post-world)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Making 'post-world' target"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} post-world
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo "make world completed on `LC_TIME=C date`"
|
||||
@echo "--------------------------------------------------------------"
|
||||
|
||||
#
|
||||
# Define the upgrade targets. These are listed here in alphabetical
|
||||
# order, but that's not important.
|
||||
# reinstall
|
||||
#
|
||||
UPGRADE = aout-to-elf aout-to-elf-build aout-to-elf-install \
|
||||
move-aout-libs
|
||||
# If you have a build server, you can NFS mount the source and obj directories
|
||||
# and do a 'make reinstall' on the *client* to install new binaries from the
|
||||
# most recent server build.
|
||||
#
|
||||
reinstall:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Making hierarchy"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} hierarchy
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding /usr/share/mk"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} mk
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Installing everything.."
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} install
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding man page indexes"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/share/man && ${MAKE} makedb
|
||||
|
||||
|
||||
#
|
||||
# Handle the upgrade targets, using the source relative mk files.
|
||||
# update
|
||||
#
|
||||
# Update the source tree, by running sup and/or running cvs to update to the
|
||||
# latest copy.
|
||||
#
|
||||
update:
|
||||
.if defined(SUP_UPDATE)
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo "Running sup"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@${SUP} ${SUPFLAGS} ${SUPFILE}
|
||||
.if defined(SUPFILE1)
|
||||
@${SUP} ${SUPFLAGS} ${SUPFILE1}
|
||||
.endif
|
||||
.if defined(SUPFILE2)
|
||||
@${SUP} ${SUPFLAGS} ${SUPFILE2}
|
||||
.endif
|
||||
.endif
|
||||
.if defined(CVS_UPDATE)
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo "Updating /usr/src from cvs repository" ${CVSROOT}
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && cvs -q update -P -d
|
||||
.endif
|
||||
|
||||
|
||||
#
|
||||
# most
|
||||
#
|
||||
# Build most of the user binaries on the existing system libs and includes.
|
||||
#
|
||||
most:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Building programs only"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} all
|
||||
cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} all
|
||||
cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} all
|
||||
cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} all
|
||||
cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
|
||||
cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} all
|
||||
cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} all
|
||||
cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
|
||||
#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} most
|
||||
#.endif
|
||||
#.if !defined(NOSECURE) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} most
|
||||
#.endif
|
||||
|
||||
#
|
||||
# installmost
|
||||
#
|
||||
# Install the binaries built by the 'most' target. This does not include
|
||||
# libraries or include files.
|
||||
#
|
||||
installmost:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Installing programs only"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/bin && ${MAKE} ${.MAKEFLAGS} install
|
||||
cd ${.CURDIR}/sbin && ${MAKE} ${.MAKEFLAGS} install
|
||||
cd ${.CURDIR}/libexec && ${MAKE} ${.MAKEFLAGS} install
|
||||
cd ${.CURDIR}/usr.bin && ${MAKE} ${.MAKEFLAGS} install
|
||||
cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
|
||||
cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} install
|
||||
cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} install
|
||||
cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
|
||||
#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} installmost
|
||||
#.endif
|
||||
#.if !defined(NOSECURE) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} installmost
|
||||
#.endif
|
||||
|
||||
#
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# From here onwards are utility targets used by the 'make world' and
|
||||
# related targets. If your 'world' breaks, you may like to try to fix
|
||||
# the problem and manually run the following targets to attempt to
|
||||
# complete the build. Beware, this is *not* guaranteed to work, you
|
||||
# need to have a pretty good grip on the current state of the system
|
||||
# to attempt to manually finish it. If in doubt, 'make world' again.
|
||||
#
|
||||
|
||||
upgrade: aout-to-elf
|
||||
#
|
||||
# heirarchy - ensure that all the needed directories are present
|
||||
#
|
||||
hierarchy:
|
||||
cd ${.CURDIR}/etc && ${MAKE} distrib-dirs
|
||||
|
||||
${UPGRADE} : upgrade_checks
|
||||
@cd ${.CURDIR}; \
|
||||
${MAKE} -f Makefile.upgrade -m ${.CURDIR}/share/mk ${.TARGET}
|
||||
#
|
||||
# mk - update the /usr/share/mk makefiles.
|
||||
#
|
||||
mk:
|
||||
cd ${.CURDIR}/share/mk && ${MAKE} install
|
||||
|
||||
#
|
||||
# bootstrap - [re]build tools needed to run the actual build, this includes
|
||||
# tools needed by 'make depend', as some tools are needed to generate source
|
||||
# for the dependency information to be gathered from.
|
||||
#
|
||||
bootstrap:
|
||||
cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} -DNOLIB all install ${CLEANDIR} ${OBJDIR}
|
||||
|
||||
#
|
||||
# include-tools - generally the same as 'bootstrap', except that it's for
|
||||
# things that are specifically needed to generate include files.
|
||||
#
|
||||
# XXX should be merged with bootstrap, it's not worth keeeping them seperate
|
||||
#
|
||||
include-tools:
|
||||
cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
|
||||
#
|
||||
# includes - possibly generate and install the include files.
|
||||
#
|
||||
includes:
|
||||
.if defined(CLOBBER)
|
||||
rm -rf ${DESTDIR}/usr/include/*
|
||||
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
||||
-p ${DESTDIR}/usr/include
|
||||
.endif
|
||||
cd ${.CURDIR}/include/rpcsvc && ${MAKE} all
|
||||
cd ${.CURDIR}/include && ${MAKE} install
|
||||
cd ${.CURDIR}/gnu/include && ${MAKE} install
|
||||
cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libregex && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libstdc++ && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
|
||||
.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
|
||||
cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/eBones/lib/libkrb && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/eBones/lib/libkadm && ${MAKE} beforeinstall
|
||||
.endif
|
||||
cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libftpio && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall
|
||||
.if !defined(WANT_CSRG_LIBM)
|
||||
cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall
|
||||
.endif
|
||||
cd ${.CURDIR}/lib/libpcap && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libtcl && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libcom_err && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libss && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libscsi && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libutil && ${MAKE} beforeinstall
|
||||
|
||||
#
|
||||
# lib-tools - build tools to compile and install the libraries.
|
||||
#
|
||||
lib-tools:
|
||||
cd ${.CURDIR}/usr.bin/tsort && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/ld && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/as && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/ar && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/ranlib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/nm && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/compile_et && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} && \
|
||||
rm -f /usr/sbin/compile_et
|
||||
cd ${.CURDIR}/usr.bin/mk_cmds && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/bison && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/gperf && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/cc && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
|
||||
#
|
||||
# libraries - build and install the libraries
|
||||
#
|
||||
libraries:
|
||||
.if exists(lib/csu/i386)
|
||||
cd ${.CURDIR}/lib/csu/i386 && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(lib/libcompat)
|
||||
cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(lib/libncurses)
|
||||
cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(lib/libtermcap)
|
||||
cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(gnu)
|
||||
cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(lib)
|
||||
cd ${.CURDIR}/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(usr.bin/lex/lib)
|
||||
cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
|
||||
cd ${.CURDIR}/eBones/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(usr.sbin/pcvt/keycap)
|
||||
cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
|
||||
#
|
||||
# build-tools - build and install any other tools needed to complete the
|
||||
# compile and install.
|
||||
#
|
||||
build-tools:
|
||||
.for d in \
|
||||
share/info \
|
||||
gnu/usr.bin/texinfo \
|
||||
usr.bin/symorder \
|
||||
usr.bin/sgmls \
|
||||
usr.bin/sgmlfmt \
|
||||
share/sgml \
|
||||
usr.sbin/zic \
|
||||
gnu/usr.bin/awk \
|
||||
gnu/usr.bin/groff
|
||||
cd ${.CURDIR}/$d && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endfor
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
-124
@@ -1,124 +0,0 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# This makefile ensures that the object directory is set according to the
|
||||
# object format to avoid mixing aout and elf formatted files during the
|
||||
# transition period.
|
||||
#
|
||||
# >> Beware, this makefile overwrites the local build environment! <<
|
||||
#
|
||||
|
||||
#
|
||||
# Build things relative to the user's preferred object directory,
|
||||
# defaulting to /usr/obj if not defined.
|
||||
#
|
||||
MAKEOBJDIRPREFIX?=/usr/obj
|
||||
|
||||
#
|
||||
# Variables passed to make work better if they are set as environment
|
||||
# variables instead of command line options.
|
||||
#
|
||||
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "aout"
|
||||
MK_ENV= MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${OBJFORMAT}
|
||||
.endif
|
||||
|
||||
#
|
||||
# We should always use the current set of mk files, not the installed ones.
|
||||
# This makefile is a wrapper for the backend makefile (Makefile.inc1).
|
||||
#
|
||||
MAKE= make -m ${.CURDIR}/share/mk -f Makefile.inc1
|
||||
|
||||
#
|
||||
# These are the backend targets.
|
||||
#
|
||||
BKTGTS= all checkdpadd clean cleandepend cleandir \
|
||||
depend everything hierarchy includes install installmost \
|
||||
lint maninstall mk most obj objlink regress rerelease \
|
||||
tags update
|
||||
|
||||
#
|
||||
# A generic rule for the backend targets.
|
||||
#
|
||||
${BKTGTS} :
|
||||
@cd ${.CURDIR}; ${MAKE} ${.TARGET}
|
||||
|
||||
# These targets are used during a make release, which is done after a
|
||||
# make world, so they should use the same OBJDIRPREFIX that was used
|
||||
# during the make world.
|
||||
RELTGTS= afterdistribute distribute
|
||||
|
||||
${RELTGTS} :
|
||||
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} ${.TARGET}
|
||||
|
||||
#
|
||||
# Temporary path and environment for the legacy build.
|
||||
#
|
||||
ELFTMP= ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp
|
||||
ELFTMPPATH= ${ELFTMP}/sbin:${ELFTMP}/bin:${ELFTMP}/usr/sbin:${ELFTMP}/usr/bin:${ELFTMP}/usr/games
|
||||
LEGACY_ENV= PATH=${ELFTMPPATH} OBJFORMAT=aout NOTOOLS=1 TOOLROOT=${ELFTMP} \
|
||||
MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/aout
|
||||
XMAKE= ${ELFTMP}/usr/bin/${MAKE}
|
||||
|
||||
STARTTIME!= LC_TIME=C date
|
||||
#
|
||||
# world
|
||||
#
|
||||
# Attempt to rebuild and reinstall *everything*, with reasonable chance of
|
||||
# success, regardless of how old your existing system is. If building on
|
||||
# an i386/elf system, build the aout legacy cruft too.
|
||||
#
|
||||
world:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> ${OBJFORMAT} make world started on ${STARTTIME}"
|
||||
@echo "--------------------------------------------------------------"
|
||||
.if target(pre-world)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Making 'pre-world' target"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} pre-world
|
||||
.endif
|
||||
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
|
||||
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && defined(WANT_AOUT)
|
||||
@cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} legacy-build
|
||||
.endif
|
||||
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} -B installworld
|
||||
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && defined(WANT_AOUT)
|
||||
@cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} legacy-install
|
||||
.endif
|
||||
.if target(post-world)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Making 'post-world' target"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} post-world
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> ${OBJFORMAT} make world started on ${STARTTIME}"
|
||||
@echo ">>> ${OBJFORMAT} make world completed on `LC_TIME=C date`"
|
||||
@echo "--------------------------------------------------------------"
|
||||
|
||||
#
|
||||
# buildworld
|
||||
#
|
||||
# Build the world in the current object format, plus the legacy aout
|
||||
# support if the current object format is elf on i386.
|
||||
#
|
||||
buildworld :
|
||||
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
|
||||
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && defined(WANT_AOUT)
|
||||
@cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} legacy-build
|
||||
.endif
|
||||
|
||||
#
|
||||
# installworld
|
||||
#
|
||||
# Install the world in the current object format, plus the legacy aout
|
||||
# support if the current object format is elf on i386.
|
||||
#
|
||||
installworld :
|
||||
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} installworld
|
||||
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && defined(WANT_AOUT)
|
||||
@cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} -DNOMAN -DNOINFO legacy-install
|
||||
.endif
|
||||
-982
@@ -1,982 +0,0 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# Make command line options:
|
||||
# -DCLOBBER will remove /usr/include
|
||||
# -DMAKE_KERBEROS4 to build KerberosIV
|
||||
# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
|
||||
# -DNOCLEAN do not clean at all
|
||||
# -DNOTOOLS do not rebuild any tools first
|
||||
# -DNOCRYPT will prevent building of crypt versions
|
||||
# -DNOPROFILE do not build profiled libraries
|
||||
# -DNOSECURE do not go into secure subdir
|
||||
# -DNOGAMES do not go into games subdir
|
||||
# -DNOSHARE do not go into share subdir
|
||||
# -DNOINFO do not make or install info files
|
||||
# -DNOLIBC_R do not build libc_r.
|
||||
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
|
||||
|
||||
#
|
||||
# The intended user-driven targets are:
|
||||
# buildworld - rebuild *everything*, including glue to help do upgrades
|
||||
# installworld- install everything built by "buildworld"
|
||||
# update - convenient way to update your source tree (eg: sup/cvs)
|
||||
# most - build user commands, no libraries or include files
|
||||
# installmost - install user commands, no libraries or include files
|
||||
#
|
||||
# Standard targets (not defined here) are documented in the makefiles in
|
||||
# /usr/share/mk. These include:
|
||||
# obj depend all install clean cleandepend cleanobj
|
||||
|
||||
# Put initial settings here.
|
||||
SUBDIR=
|
||||
|
||||
# We must do share/info early so that installation of info `dir'
|
||||
# entries works correctly. Do it first since it is less likely to
|
||||
# grow dependencies on include and lib than vice versa.
|
||||
.if exists(share/info)
|
||||
SUBDIR+= share/info
|
||||
.endif
|
||||
|
||||
# We must do include and lib early so that the perl *.ph generation
|
||||
# works correctly as it uses the header files installed by this.
|
||||
.if exists(include)
|
||||
SUBDIR+= include
|
||||
.endif
|
||||
.if exists(lib)
|
||||
SUBDIR+= lib
|
||||
.endif
|
||||
|
||||
.if exists(bin)
|
||||
SUBDIR+= bin
|
||||
.endif
|
||||
.if exists(games) && !defined(NOGAMES)
|
||||
SUBDIR+= games
|
||||
.endif
|
||||
.if exists(gnu)
|
||||
SUBDIR+= gnu
|
||||
.endif
|
||||
.if exists(kerberosIV) && exists(crypto) && !defined(NOCRYPT) && \
|
||||
defined(MAKE_KERBEROS4)
|
||||
SUBDIR+= kerberosIV
|
||||
.endif
|
||||
.if exists(libexec)
|
||||
SUBDIR+= libexec
|
||||
.endif
|
||||
.if exists(sbin)
|
||||
SUBDIR+= sbin
|
||||
.endif
|
||||
.if exists(share) && !defined(NOSHARE)
|
||||
SUBDIR+= share
|
||||
.endif
|
||||
.if exists(sys)
|
||||
SUBDIR+= sys
|
||||
.endif
|
||||
.if exists(usr.bin)
|
||||
SUBDIR+= usr.bin
|
||||
.endif
|
||||
.if exists(usr.sbin)
|
||||
SUBDIR+= usr.sbin
|
||||
.endif
|
||||
.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
SUBDIR+= secure
|
||||
.endif
|
||||
|
||||
# etc must be last for "distribute" to work
|
||||
.if exists(etc)
|
||||
SUBDIR+= etc
|
||||
.endif
|
||||
|
||||
# These are last, since it is nice to at least get the base system
|
||||
# rebuilt before you do them.
|
||||
.if defined(LOCAL_DIRS)
|
||||
.for _DIR in ${LOCAL_DIRS}
|
||||
.if exists(${_DIR}) & exists(${_DIR}/Makefile)
|
||||
SUBDIR+= ${_DIR}
|
||||
.endif
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
OBJDIR= obj
|
||||
|
||||
.if defined(NOCLEAN)
|
||||
CLEANDIR=
|
||||
.else
|
||||
.if defined(NOCLEANDIR)
|
||||
CLEANDIR= clean cleandepend
|
||||
.else
|
||||
CLEANDIR= cleandir
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if !defined(NOCLEAN)
|
||||
_NODEPEND= true
|
||||
.endif
|
||||
.if defined(_NODEPEND)
|
||||
_DEPEND= cleandepend
|
||||
.else
|
||||
_DEPEND= depend
|
||||
.endif
|
||||
|
||||
SUP?= cvsup
|
||||
SUPFLAGS?= -g -L 2 -P -
|
||||
|
||||
#
|
||||
# While building tools for bootstrapping, we don't need to waste time on
|
||||
# shared or profiled libraries, shared linkage, or documentation, except
|
||||
# when the tools won't get cleaned we must use the defaults for shared
|
||||
# libraries and shared linkage (and this doesn't waste time).
|
||||
# XXX actually, we do need to waste time building shared libraries.
|
||||
#
|
||||
.if defined(NOCLEAN)
|
||||
MK_FLAGS= -DNOINFO -DNOMAN -DNOPROFILE
|
||||
.else
|
||||
MK_FLAGS= -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED
|
||||
.endif
|
||||
|
||||
#
|
||||
# Define the location of the temporary installation directory. Note that
|
||||
# MAKEOBJDIRPREFIX normally isn't defined so if the current directory is
|
||||
# /usr/src, then the world temporary directory is /usr/obj/usr/src/tmp.
|
||||
#
|
||||
# During the transition from aout to elf format on i386, MAKEOBJDIRPREFIX
|
||||
# is set by the parent makefile (Makefile.inc0) to be /usr/obj/${OBJFORMAT}
|
||||
# in order to keep aout and elf format files apart.
|
||||
#
|
||||
.if defined(MAKEOBJDIRPREFIX)
|
||||
WORLDTMP= ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp
|
||||
.else
|
||||
WORLDTMP= /usr/obj${.CURDIR}/tmp
|
||||
.endif
|
||||
|
||||
#
|
||||
# Define the PATH to the build tools.
|
||||
#
|
||||
# If not building tools, the PATH always points to the installed binaries.
|
||||
# The NOTOOLS option assumes that in installed tools are good enough and that
|
||||
# the user's PATH will locate to appropriate tools. This option is required
|
||||
# for a cross-compiled build environment.
|
||||
#
|
||||
# If building tools, then the PATH includes the world temporary directories
|
||||
# so that the bootstrapped tools are used as soon as they are built. The
|
||||
# strict path is for use after all tools are supposed to have been
|
||||
# bootstrapped. It doesn't allow any of the installed tools to be used.
|
||||
#
|
||||
.if defined(NOTOOLS)
|
||||
# Default root of the tool tree
|
||||
TOOLROOT?=
|
||||
# Choose the PATH relative to the root of the tool tree
|
||||
PATH= ${TOOLROOT}/sbin:${TOOLROOT}/bin:${TOOLROOT}/usr/sbin:${TOOLROOT}/usr/bin
|
||||
.else
|
||||
TOOLROOT= ${WORLDTMP}
|
||||
.endif
|
||||
STRICTTMPPATH= ${TOOLROOT}/sbin:${TOOLROOT}/usr/sbin:${TOOLROOT}/bin:${TOOLROOT}/usr/bin
|
||||
TMPPATH= ${STRICTTMPPATH}:${PATH}
|
||||
|
||||
# XXX COMPILER_PATH is needed for finding cc1, ld and as
|
||||
# XXX GCC_EXEC_PREFIX is for *crt.o. It is probably unnecessary now
|
||||
# that LIBRARY_PATH is set. We still can't use -nostdlib, since gcc
|
||||
# wouldn't link *crt.o or libgcc if it were used.
|
||||
# XXX LD_LIBRARY_PATH is for ld.so. It is also used by ld, although we don't
|
||||
# want that - all compile-time library paths should be resolved by gcc.
|
||||
# It fails for set[ug]id executables (are any used?).
|
||||
COMPILER_ENV= BISON_SIMPLE=${TOOLROOT}/usr/share/misc/bison.simple \
|
||||
COMPILER_PATH=${TOOLROOT}/usr/libexec:${TOOLROOT}/usr/bin \
|
||||
GCC_EXEC_PREFIX=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib/ \
|
||||
LD_LIBRARY_PATH=${TOOLROOT}${SHLIBDIR} \
|
||||
LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib
|
||||
|
||||
BMAKEENV= PATH=${TMPPATH} ${COMPILER_ENV} NOEXTRADEPEND=t \
|
||||
OBJFORMAT_PATH=${TOOLROOT}/usr/libexec:/usr/libexec
|
||||
XMAKEENV= PATH=${STRICTTMPPATH} ${COMPILER_ENV} \
|
||||
PERL5LIB=${DESTDIR}/usr/libdata/perl/5.00503 \
|
||||
OBJFORMAT_PATH=${TOOLROOT}/usr/libexec \
|
||||
CFLAGS="-nostdinc ${CFLAGS}" # XXX -nostdlib
|
||||
|
||||
# used to compile and install 'make' in temporary build tree
|
||||
MAKETMP= ${WORLDTMP}/make
|
||||
IBMAKE= ${BMAKEENV} MAKEOBJDIR=${MAKETMP} ${MAKE} DESTDIR=${WORLDTMP}
|
||||
|
||||
.if defined(NOTOOLS)
|
||||
# bootstrap make
|
||||
BMAKE= ${BMAKEENV} ${MAKE} DESTDIR=${WORLDTMP}
|
||||
# cross make used for compilation
|
||||
XMAKE= ${XMAKEENV} ${MAKE} DESTDIR=${WORLDTMP}
|
||||
# cross make used for final installation
|
||||
IXMAKE= ${XMAKEENV} ${MAKE}
|
||||
.else
|
||||
# bootstrap make
|
||||
BMAKE= ${BMAKEENV} ${WORLDTMP}/usr/bin/make DESTDIR=${WORLDTMP}
|
||||
# cross make used for compilation
|
||||
XMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/make DESTDIR=${WORLDTMP}
|
||||
# cross make used for final installation
|
||||
IXMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/make
|
||||
.endif
|
||||
|
||||
#
|
||||
# buildworld
|
||||
#
|
||||
# Attempt to rebuild the entire system, with reasonable chance of
|
||||
# success, regardless of how old your existing system is.
|
||||
#
|
||||
buildworld: check-objformat
|
||||
.if !defined(NOCLEAN)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Cleaning up the temporary ${OBJFORMAT} build tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
mkdir -p ${WORLDTMP}
|
||||
-chflags -R noschg ${WORLDTMP}/
|
||||
rm -rf ${WORLDTMP}
|
||||
.endif
|
||||
.if !defined(NOTOOLS)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Making make"
|
||||
@echo "--------------------------------------------------------------"
|
||||
mkdir -p ${WORLDTMP}/usr/bin ${MAKETMP}
|
||||
( \
|
||||
cd ${.CURDIR}/usr.bin/make; \
|
||||
MAKEOBJDIRPREFIX=""; unset MAKEOBJDIRPREFIX; \
|
||||
${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} all; \
|
||||
${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} install; \
|
||||
${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} clean \
|
||||
)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Making mtree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
mkdir -p ${WORLDTMP}/usr/sbin ${WORLDTMP}/mtree
|
||||
( \
|
||||
cd ${.CURDIR}/usr.sbin/mtree; \
|
||||
MAKEOBJDIRPREFIX=""; unset MAKEOBJDIRPREFIX; \
|
||||
export MAKEOBJDIR=${WORLDTMP}/mtree; \
|
||||
${BMAKE} ${MK_FLAGS} all; \
|
||||
${BMAKE} ${MK_FLAGS} -B install clean \
|
||||
)
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Making hierarchy"
|
||||
@echo "--------------------------------------------------------------"
|
||||
mkdir -p ${WORLDTMP}
|
||||
cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 hierarchy
|
||||
.if !defined(NOCLEAN)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Cleaning up the ${OBJFORMAT} obj tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/}
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Rebuilding the ${OBJFORMAT} obj tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 par-${OBJDIR}
|
||||
.if !defined(NOTOOLS)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Rebuilding ${OBJFORMAT} bootstrap tools"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 bootstrap
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Rebuilding tools necessary to build the include files"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 include-tools
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Rebuilding ${DESTDIR}/usr/include"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; SHARED=copies ${BMAKE} -f Makefile.inc1 includes
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Rebuilding bootstrap libraries"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 bootstrap-libraries
|
||||
.if !defined(NOTOOLS)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Rebuilding tools needed to build libraries"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 lib-tools
|
||||
.endif
|
||||
.if !defined(NOTOOLS)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Rebuilding all other tools needed to build the ${OBJFORMAT} world"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${BMAKE} -f Makefile.inc1 build-tools
|
||||
.endif
|
||||
.if !defined(_NODEPEND)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Rebuilding dependencies"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${XMAKE} -f Makefile.inc1 par-depend
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Building ${OBJFORMAT} libraries"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${XMAKE} -DNOINFO -DNOMAN -f Makefile.inc1 libraries
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Building everything.."
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${XMAKE} -f Makefile.inc1 all
|
||||
|
||||
everything:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Building everything.."
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${XMAKE} -f Makefile.inc1 all
|
||||
|
||||
#
|
||||
# installworld
|
||||
#
|
||||
# Installs everything compiled by a 'buildworld'.
|
||||
#
|
||||
installworld:
|
||||
cd ${.CURDIR}; ${IXMAKE} -f Makefile.inc1 reinstall
|
||||
|
||||
#
|
||||
# reinstall
|
||||
#
|
||||
# If you have a build server, you can NFS mount the source and obj directories
|
||||
# and do a 'make reinstall' on the *client* to install new binaries from the
|
||||
# most recent server build.
|
||||
#
|
||||
reinstall:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Making hierarchy"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Installing everything.."
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
|
||||
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "aout" && !defined(DESTDIR)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Re-scanning the shared libraries.."
|
||||
@echo "--------------------------------------------------------------"
|
||||
-cd ${.CURDIR}; /sbin/ldconfig -R
|
||||
.endif
|
||||
.if !defined(NOMAN)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Rebuilding man page indices"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/share/man; ${MAKE} makedb
|
||||
.endif
|
||||
|
||||
#
|
||||
# update
|
||||
#
|
||||
# Update the source tree, by running sup and/or running cvs to update to the
|
||||
# latest copy.
|
||||
#
|
||||
update:
|
||||
.if defined(SUP_UPDATE)
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Running ${SUP}"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@${SUP} ${SUPFLAGS} ${SUPFILE}
|
||||
.if defined(SUPFILE1)
|
||||
@${SUP} ${SUPFLAGS} ${SUPFILE1}
|
||||
.endif
|
||||
.if defined(SUPFILE2)
|
||||
@${SUP} ${SUPFLAGS} ${SUPFILE2}
|
||||
.endif
|
||||
.endif
|
||||
.if defined(CVS_UPDATE)
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Updating /usr/src from cvs repository" ${CVSROOT}
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; cvs -q update -P -d
|
||||
.endif
|
||||
|
||||
#
|
||||
# most
|
||||
#
|
||||
# Build most of the user binaries on the existing system libs and includes.
|
||||
#
|
||||
most:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Building programs only"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/bin; ${MAKE} all
|
||||
cd ${.CURDIR}/sbin; ${MAKE} all
|
||||
cd ${.CURDIR}/libexec; ${MAKE} all
|
||||
cd ${.CURDIR}/usr.bin; ${MAKE} all
|
||||
cd ${.CURDIR}/usr.sbin; ${MAKE} all
|
||||
cd ${.CURDIR}/gnu/libexec; ${MAKE} all
|
||||
cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all
|
||||
cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all
|
||||
#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/kerberosIV; ${MAKE} most
|
||||
#.endif
|
||||
#.if !defined(NOSECURE) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/secure; ${MAKE} most
|
||||
#.endif
|
||||
|
||||
#
|
||||
# installmost
|
||||
#
|
||||
# Install the binaries built by the 'most' target. This does not include
|
||||
# libraries or include files.
|
||||
#
|
||||
installmost:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Installing programs only"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/bin; ${MAKE} install
|
||||
cd ${.CURDIR}/sbin; ${MAKE} install
|
||||
cd ${.CURDIR}/libexec; ${MAKE} install
|
||||
cd ${.CURDIR}/usr.bin; ${MAKE} install
|
||||
cd ${.CURDIR}/usr.sbin; ${MAKE} install
|
||||
cd ${.CURDIR}/gnu/libexec; ${MAKE} install
|
||||
cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install
|
||||
cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install
|
||||
#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/kerberosIV; ${MAKE} installmost
|
||||
#.endif
|
||||
#.if !defined(NOSECURE) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/secure; ${MAKE} installmost
|
||||
#.endif
|
||||
|
||||
#
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# From here onwards are utility targets used by the 'make world' and
|
||||
# related targets. If your 'world' breaks, you may like to try to fix
|
||||
# the problem and manually run the following targets to attempt to
|
||||
# complete the build. Beware, this is *not* guaranteed to work, you
|
||||
# need to have a pretty good grip on the current state of the system
|
||||
# to attempt to manually finish it. If in doubt, 'make world' again.
|
||||
#
|
||||
|
||||
#
|
||||
# hierarchy - ensure that all the needed directories are present
|
||||
#
|
||||
hierarchy:
|
||||
cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
|
||||
|
||||
#
|
||||
# bootstrap - [re]build tools needed to run the actual build, this includes
|
||||
# tools needed by 'make depend', as some tools are needed to generate source
|
||||
# for the dependency information to be gathered from.
|
||||
#
|
||||
bootstrap:
|
||||
cd ${.CURDIR}/usr.bin/make; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
|
||||
${MAKE} ${MK_FLAGS} all; \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/xinstall; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
|
||||
${MAKE} ${MK_FLAGS} all; \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/yacc; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
|
||||
${MAKE} ${MK_FLAGS} all; \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/lex; ${MAKE} bootstrap; \
|
||||
${MAKE} ${MK_FLAGS} ${_DEPEND}; \
|
||||
${MAKE} ${MK_FLAGS} -DNOLIB all; \
|
||||
${MAKE} ${MK_FLAGS} -DNOLIB -B install ${CLEANDIR}
|
||||
cd ${.CURDIR}/usr.bin/lex; ${MAKE} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.sbin/mtree; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
|
||||
${MAKE} ${MK_FLAGS} all; \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
|
||||
#
|
||||
# include-tools - generally the same as 'bootstrap', except that it's for
|
||||
# things that are specifically needed to generate include files.
|
||||
#
|
||||
# XXX should be merged with bootstrap, it's not worth keeeping them separate.
|
||||
# Well, maybe it is now. We force 'cleandepend' here to avoid dependencies
|
||||
# on cleaned away headers in ${WORLDTMP}.
|
||||
#
|
||||
include-tools:
|
||||
.for d in usr.bin/compile_et usr.bin/rpcgen
|
||||
cd ${.CURDIR}/$d; ${MAKE} cleandepend; \
|
||||
${MAKE} ${MK_FLAGS} ${_DEPEND}; \
|
||||
${MAKE} ${MK_FLAGS} all; \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
.endfor
|
||||
|
||||
#
|
||||
# includes - possibly generate and install the include files.
|
||||
#
|
||||
includes:
|
||||
.if defined(CLOBBER)
|
||||
rm -rf ${DESTDIR}/usr/include/*
|
||||
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
||||
-p ${DESTDIR}/usr/include
|
||||
.endif
|
||||
cd ${.CURDIR}/include; ${MAKE} -B all install
|
||||
cd ${.CURDIR}/gnu/include; ${MAKE} install
|
||||
cd ${.CURDIR}/gnu/lib/libmp; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libreadline; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libg++; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libgmp; ${MAKE} beforeinstall
|
||||
.if exists(secure) && !defined(NOCRYPT)
|
||||
cd ${.CURDIR}/secure/lib/libdes; ${MAKE} beforeinstall
|
||||
.endif
|
||||
.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
|
||||
cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
|
||||
.else
|
||||
cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
|
||||
.endif
|
||||
.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
|
||||
cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall
|
||||
.endif
|
||||
cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libcurses; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libmytinfo; ${MAKE} beforeinstall
|
||||
.if !defined(WANT_CSRG_LIBM)
|
||||
cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
|
||||
.endif
|
||||
cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libskey; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libtermcap; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libss; ${MAKE} -B hdrs beforeinstall
|
||||
cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libwrap; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/usr.bin/f2c; ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall
|
||||
|
||||
#
|
||||
# Declare tools if they are not required on all architectures.
|
||||
#
|
||||
.if ${MACHINE_ARCH} == "i386"
|
||||
# aout tools:
|
||||
_aout_ar = usr.bin/ar
|
||||
_aout_as = gnu/usr.bin/as
|
||||
_aout_ld = gnu/usr.bin/ld
|
||||
_aout_nm = usr.bin/nm
|
||||
_aout_ranlib = usr.bin/ranlib
|
||||
_aout_size = usr.bin/size
|
||||
_aout_strip = usr.bin/strip
|
||||
# boot block/loader tools:
|
||||
_btxld = usr.sbin/btxld
|
||||
.endif
|
||||
|
||||
#
|
||||
# lib-tools - build tools to compile and install the libraries.
|
||||
#
|
||||
# XXX gperf is required for cc
|
||||
# XXX a new ld and tsort is required for cc
|
||||
lib-tools:
|
||||
.for d in \
|
||||
gnu/usr.bin/gperf \
|
||||
${_aout_ld} \
|
||||
usr.bin/tsort \
|
||||
${_aout_as} \
|
||||
gnu/usr.bin/bison \
|
||||
gnu/usr.bin/cc \
|
||||
${_aout_ar} \
|
||||
usr.bin/env \
|
||||
usr.bin/lex/lib \
|
||||
usr.bin/mk_cmds \
|
||||
${_aout_nm} \
|
||||
${_aout_ranlib} \
|
||||
${_aout_strip} \
|
||||
gnu/usr.bin/binutils \
|
||||
usr.bin/uudecode \
|
||||
usr.bin/objformat
|
||||
cd ${.CURDIR}/$d; ${MAKE} ${MK_FLAGS} ${_DEPEND}; \
|
||||
${MAKE} ${MK_FLAGS} all; \
|
||||
${MAKE} ${MK_FLAGS} -B install; \
|
||||
${MAKE} ${MK_FLAGS:S/-DNOPIC//} -B ${CLEANDIR} ${OBJDIR}
|
||||
.endfor
|
||||
|
||||
#
|
||||
# We have to know too much about ordering and subdirs in the lib trees:
|
||||
#
|
||||
# To satisfy shared library linkage when only the libraries being built
|
||||
# are visible:
|
||||
#
|
||||
# csu must be built before all shared libaries for ELF.
|
||||
# libcom_err must be built before libss.
|
||||
# libcrypt must be built before libskey and libkrb.
|
||||
# libdes must be built before libpam.
|
||||
# libkrb must be built before libpam.
|
||||
# libm must be built before libf2c, libg++ and libstdc++.
|
||||
# libmd must be built before libatm, libopie, libradius, libskey,
|
||||
# and libtacplus.
|
||||
# libmytinfo must be built before libdialog and libncurses.
|
||||
# libncurses must be built before libdialog.
|
||||
# libradius must be built before libpam.
|
||||
# libskey must be built before libpam.
|
||||
# libtacplus must be built before libpam.
|
||||
# libtermcap must be built before libcurses, libedit and libreadline.
|
||||
#
|
||||
# Some libraries are built conditionally and/or are in inconsistently
|
||||
# named directories:
|
||||
#
|
||||
.if exists(lib/csu/${MACHINE_ARCH}.pcc)
|
||||
_csu=lib/csu/${MACHINE_ARCH}.pcc
|
||||
.elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf"
|
||||
_csu=lib/csu/i386-elf
|
||||
.else
|
||||
_csu=lib/csu/${MACHINE_ARCH}
|
||||
.endif
|
||||
|
||||
.if !defined(NOSECURE) && !defined(NOCRYPT)
|
||||
_libcrypt= secure/lib/libcrypt lib/libcrypt
|
||||
_secure_lib= secure/lib
|
||||
.else
|
||||
_libcrypt= lib/libcrypt
|
||||
.endif
|
||||
|
||||
.if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
|
||||
_kerberosIV_lib=kerberosIV/lib
|
||||
.endif
|
||||
|
||||
.if defined(WANT_CSRG_LIBM)
|
||||
_libm= lib/libm
|
||||
.else
|
||||
_libm= lib/msun
|
||||
.endif
|
||||
|
||||
.if !defined(NOPERL)
|
||||
_libperl= gnu/usr.bin/perl/libperl
|
||||
.endif
|
||||
|
||||
#
|
||||
# bootstrap-libraries - build just enough libraries for the bootstrap
|
||||
# tools, and install them under ${WORLDTMP}.
|
||||
#
|
||||
# Build csu and libgcc early so that some tools get linked to the new
|
||||
# versions (too late for the main tools, however). Then build the
|
||||
# necessary prerequisite libraries (libtermcap just needs to be before
|
||||
# libcurses, and this only matters for the NOCLEAN case when NOPIC is
|
||||
# not set).
|
||||
#
|
||||
# This is mostly wrong. The build tools must run on the host system,
|
||||
# so they should use host libraries. We depend on the target being
|
||||
# similar enough to the host for new target libraries to work on the
|
||||
# host.
|
||||
#
|
||||
bootstrap-libraries:
|
||||
.for _lib in ${_csu} gnu/usr.bin/cc/libgcc lib/libtermcap \
|
||||
gnu/lib/libregex gnu/lib/libreadline lib/libc \
|
||||
${_libcrypt} lib/libcurses lib/libedit ${_libm} \
|
||||
lib/libmd lib/libutil lib/libz usr.bin/lex/lib \
|
||||
${_libperl}
|
||||
.if exists(${.CURDIR}/${_lib})
|
||||
cd ${.CURDIR}/${_lib}; \
|
||||
${MAKE} ${MK_FLAGS} ${_DEPEND}; \
|
||||
${MAKE} ${MK_FLAGS} all; \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
#
|
||||
# libraries - build all libraries, and install them under ${DESTDIR}.
|
||||
#
|
||||
# The ordering is not as special as for bootstrap-libraries. Build
|
||||
# the prerequisites first, then build almost everything else in
|
||||
# alphabetical order.
|
||||
#
|
||||
libraries:
|
||||
.for _lib in ${_csu} lib/libcom_err ${_libcrypt} ${_libm} lib/libmd \
|
||||
lib/libmytinfo lib/libncurses lib/libtermcap \
|
||||
lib/libradius lib/libskey lib/libtacplus \
|
||||
${_secure_lib} ${_kerberosIV_lib} \
|
||||
gnu/lib gnu/usr.bin/cc/libgcc ${_libperl} lib usr.bin/lex/lib \
|
||||
usr.sbin/pcvt/keycap
|
||||
.if exists(${.CURDIR}/${_lib})
|
||||
cd ${.CURDIR}/${_lib}; ${MAKE} all; ${MAKE} -B install
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
#
|
||||
# Exclude unused tools from build-tools.
|
||||
#
|
||||
.if !defined(NOGAMES) && exists(${.CURDIR}/games)
|
||||
_adventure= games/adventure
|
||||
_caesar= games/caesar
|
||||
_hack= games/hack
|
||||
_phantasia= games/phantasia
|
||||
_strfile= games/fortune/strfile
|
||||
.endif
|
||||
.if !defined(NOPERL)
|
||||
_perl= gnu/usr.bin/perl/miniperl
|
||||
.endif
|
||||
.if !defined(NOSHARE) && exists(${.CURDIR}/share)
|
||||
_scrnmaps= share/syscons/scrnmaps
|
||||
.endif
|
||||
.if ${MACHINE_ARCH} == i386
|
||||
_kldlinux= sys/modules/linux
|
||||
.endif
|
||||
.if ${OBJFORMAT} == "aout"
|
||||
_netboot= sys/${MACHINE}/boot/netboot
|
||||
.endif
|
||||
|
||||
BTMAKEFLAGS= ${MK_FLAGS} -D_BUILD_TOOLS
|
||||
|
||||
#
|
||||
# build-tools - build and install any other tools needed to complete the
|
||||
# compile and install.
|
||||
# ifdef stale
|
||||
# bc and cpp are required to build groff. Otherwise, the order here is
|
||||
# mostly historical, i.e., bogus.
|
||||
# chmod is used to build gcc's tmpmultilib[2] at obscure times.
|
||||
# endif stale
|
||||
# XXX uname is a bug - the target should not depend on the host.
|
||||
#
|
||||
build-tools:
|
||||
.for d in \
|
||||
bin/cat \
|
||||
bin/chmod \
|
||||
bin/cp \
|
||||
bin/date \
|
||||
bin/dd \
|
||||
bin/echo \
|
||||
bin/expr \
|
||||
bin/hostname \
|
||||
bin/ln \
|
||||
bin/ls \
|
||||
bin/mkdir \
|
||||
bin/mv \
|
||||
bin/rm \
|
||||
bin/test \
|
||||
${_caesar} \
|
||||
${_strfile} \
|
||||
gnu/usr.bin/awk \
|
||||
gnu/usr.bin/bc \
|
||||
gnu/usr.bin/grep \
|
||||
gnu/usr.bin/groff \
|
||||
gnu/usr.bin/gzip \
|
||||
gnu/usr.bin/man/makewhatis \
|
||||
gnu/usr.bin/patch \
|
||||
${_perl} \
|
||||
gnu/usr.bin/sort \
|
||||
gnu/usr.bin/texinfo \
|
||||
usr.bin/basename \
|
||||
usr.bin/cap_mkdb \
|
||||
usr.bin/chflags \
|
||||
usr.bin/cmp \
|
||||
usr.bin/col \
|
||||
usr.bin/colldef \
|
||||
usr.bin/cpp \
|
||||
usr.bin/expand \
|
||||
usr.bin/file2c \
|
||||
usr.bin/find \
|
||||
usr.bin/gencat \
|
||||
usr.bin/gensetdefs \
|
||||
usr.bin/id \
|
||||
usr.bin/join \
|
||||
usr.bin/lorder \
|
||||
usr.bin/m4 \
|
||||
usr.bin/mkdep \
|
||||
usr.bin/mklocale \
|
||||
usr.bin/paste \
|
||||
usr.bin/printf \
|
||||
usr.bin/sed \
|
||||
${_aout_size} \
|
||||
usr.bin/soelim \
|
||||
usr.bin/symorder \
|
||||
usr.bin/touch \
|
||||
usr.bin/tr \
|
||||
usr.bin/true \
|
||||
usr.bin/uname \
|
||||
usr.bin/uuencode \
|
||||
usr.bin/vgrind \
|
||||
usr.bin/vi \
|
||||
usr.bin/wc \
|
||||
usr.bin/xargs \
|
||||
usr.bin/yacc \
|
||||
${_btxld} \
|
||||
usr.sbin/chown \
|
||||
usr.sbin/mtree \
|
||||
usr.sbin/zic \
|
||||
bin/sh
|
||||
cd ${.CURDIR}/$d; ${MAKE} ${BTMAKEFLAGS} ${_DEPEND}; \
|
||||
${MAKE} ${BTMAKEFLAGS} all; \
|
||||
${MAKE} ${BTMAKEFLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
.endfor
|
||||
.if !defined(NOGAMES) && exists(${.CURDIR}/games)
|
||||
cd ${DESTDIR}/usr/games; cp -p caesar strfile ${DESTDIR}/usr/bin
|
||||
.endif
|
||||
.for d in \
|
||||
bin/sh \
|
||||
${_adventure} \
|
||||
${_hack} \
|
||||
${_phantasia} \
|
||||
gnu/usr.bin/cc/cc_tools \
|
||||
lib/libmytinfo \
|
||||
${_linux} \
|
||||
${_kldlinux} \
|
||||
${_scrnmaps} \
|
||||
${_netboot}
|
||||
cd ${.CURDIR}/$d; ${MAKE} ${BTMAKEFLAGS} build-tools
|
||||
.endfor
|
||||
cd ${.CURDIR}/usr.bin/tn3270/tools; ${MAKE} ${BTMAKEFLAGS} all
|
||||
|
||||
#
|
||||
# Build aout versions of things that provide legacy support when all the
|
||||
# rest of the world is elf.
|
||||
#
|
||||
legacy-build:
|
||||
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "aout"
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Making hierarchy"
|
||||
@echo "--------------------------------------------------------------"
|
||||
mkdir -p ${WORLDTMP}
|
||||
cd ${.CURDIR}; ${XMAKE} -f Makefile.inc1 hierarchy
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Rebuilding the ${OBJFORMAT} obj tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; ${XMAKE} -f Makefile.inc1 par-${OBJDIR}
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Rebuilding ${DESTDIR}/usr/include"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; SHARED=copies ${XMAKE} -f Makefile.inc1 includes
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Building legacy libraries"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}; \
|
||||
${XMAKE} -DNOINFO -DNOMAN -f Makefile.inc1 bootstrap-libraries
|
||||
cd ${.CURDIR}; \
|
||||
${XMAKE} -DNOINFO -DNOMAN -f Makefile.inc1 libraries
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Building legacy rtld"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/libexec/rtld-aout; \
|
||||
${XMAKE} -DNOMAN depend; ${XMAKE} -DNOMAN all;
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Building legacy boot"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/sys/${MACHINE}/boot && \
|
||||
${XMAKE} -DNOMAN -B obj depend; ${XMAKE} -DNOMAN all;
|
||||
.endif
|
||||
|
||||
#
|
||||
# Install aout versions of things that provide legacy support when all the
|
||||
# rest of the world is elf.
|
||||
#
|
||||
legacy-install:
|
||||
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "aout"
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Installing legacy libraries"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/lib; ${MAKE} -B -DNOMAN -DNOINFO install
|
||||
cd ${.CURDIR}/gnu/lib; ${MAKE} -B -DNOMAN -DNOINFO install
|
||||
cd ${.CURDIR}/gnu/usr.bin/cc/libgcc; \
|
||||
${MAKE} -B -DNOMAN -DNOINFO install
|
||||
cd ${.CURDIR}/usr.bin/lex/lib; \
|
||||
${MAKE} -B -DNOMAN -DNOINFO install
|
||||
cd ${.CURDIR}/usr.sbin/pcvt/keycap; \
|
||||
${MAKE} -B -DNOMAN -DNOINFO install
|
||||
.if exists(${.CURDIR}/secure/lib) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
cd ${.CURDIR}/secure/lib; ${MAKE} -B -DNOMAN -DNOINFO install
|
||||
.endif
|
||||
.if exists(${.CURDIR}/kerberosIV/lib) && !defined(NOCRYPT) && \
|
||||
defined(MAKE_KERBEROS4)
|
||||
cd ${.CURDIR}/kerberosIV/lib; ${MAKE} -B -DNOMAN -DNOINFO install
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Installing legacy rtld"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/libexec/rtld-aout; ${MAKE} -DNOMAN install
|
||||
@echo
|
||||
.if ${MACHINE_ARCH} != "alpha"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> Installing legacy boot"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/sys/${MACHINE}/boot && ${MAKE} -DNOMAN install
|
||||
.endif
|
||||
.endif
|
||||
|
||||
|
||||
# Get the object format that the tools see.
|
||||
#
|
||||
#
|
||||
.if exists(/usr/bin/objformat)
|
||||
__OBJFORMAT!= objformat
|
||||
.else
|
||||
__OBJFORMAT= ${OBJFORMAT}
|
||||
.endif
|
||||
|
||||
#
|
||||
# Check if the local /etc/make.conf or /etc/make.conf.local have attempted
|
||||
# to override the OBJFORMAT without updating the environment for the tools
|
||||
# to see.
|
||||
#
|
||||
check-objformat :
|
||||
.if ${__OBJFORMAT} != ${OBJFORMAT}
|
||||
@/bin/sh -c "echo \"It looks like you set OBJFORMAT=${OBJFORMAT} in /etc/make.conf. Don't do that!\" "
|
||||
@/bin/sh -c "echo \"If you want to override the installed object format, you must set OBJFORMAT\" "
|
||||
@/bin/sh -c "echo \"in your environment.\" "
|
||||
@exit 1
|
||||
.endif
|
||||
.if !defined(REALLY_WANT_DEPRECIATED_AOUT) && ${OBJFORMAT} == "aout"
|
||||
@echo "==== NOTICE: a.out buildworld is depreciated and disabled! ====="
|
||||
@echo "Read: http://www.freebsd.org/~peter/elfday.html for information."
|
||||
@echo "You need to complete a 'make aout-to-elf' to bring your system"
|
||||
@echo "up to date with ELF tools. This requires a fair amount of disk"
|
||||
@echo "space to complete. Alternatively, you can do a binary upgrade"
|
||||
@echo "using the 3.0-RELEASE binaries from CD or ftp.freebsd.org in"
|
||||
@echo "/pub/FreeBSD/3.0-RELEASE/bin/ to convert your userland to ELF."
|
||||
@exit 1
|
||||
.endif
|
||||
|
||||
|
||||
.for __target in clean cleandepend cleandir depend obj
|
||||
.for entry in ${SUBDIR}
|
||||
${entry}.${__target}__D: .PHONY
|
||||
@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
|
||||
${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
|
||||
edir=${entry}.${MACHINE_ARCH}; \
|
||||
cd ${.CURDIR}/$${edir}; \
|
||||
else \
|
||||
${ECHODIR} "===> ${DIRPRFX}${entry}"; \
|
||||
edir=${entry}; \
|
||||
cd ${.CURDIR}/$${edir}; \
|
||||
fi; \
|
||||
${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
|
||||
.endfor
|
||||
par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
|
||||
.endfor
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
@@ -1,255 +0,0 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# This makefile contains rules for preforming upgrades that are outside
|
||||
# the scope of the normal build world process.
|
||||
#
|
||||
|
||||
#
|
||||
# Make sure the PATH is set correctly
|
||||
#
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
#
|
||||
# Build things relative to the user's preferred object directory,
|
||||
# defaulting to /usr/obj if not defined.
|
||||
#
|
||||
MAKEOBJDIRPREFIX?=/usr/obj
|
||||
|
||||
#
|
||||
# The installed operating system release gives us the hint as to whether
|
||||
# we need to build a kernel too.
|
||||
#
|
||||
INSTALLEDVERSION!=sh ${.CURDIR}/tools/tools/upgrade/getosreldate.sh
|
||||
INSTALLEDNAME!=uname -r
|
||||
|
||||
#
|
||||
# Upgrade the installed make to the current version using the installed
|
||||
# headers, libraries and build tools. This is required on installed versions
|
||||
# prior to 2.2.5 in which the installed make doesn't support the -m argument.
|
||||
#
|
||||
make :
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Upgrading the installed make"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@cd ${.CURDIR}/usr.bin/make; \
|
||||
make obj && make depend && make all && make install
|
||||
|
||||
#
|
||||
# Upgrade from aout to elf, doing an aout build first to ensure that there
|
||||
# are up-to-date tools before building the initial elf world. The aout
|
||||
# tools just built into the object directory tree and executed from there
|
||||
# during the elf build. Then install the aout tools, build an aout kernel
|
||||
# with them (in case the installed kernel is an older version), then
|
||||
# install the elf world.
|
||||
#
|
||||
aout-to-elf aout-to-elf-install : /var/db/update.cfg \
|
||||
${MAKEOBJDIRPREFIX}/do_aout_buildworld \
|
||||
${MAKEOBJDIRPREFIX}/do_elf_buildworld \
|
||||
${MAKEOBJDIRPREFIX}/do_move_aout_libs \
|
||||
${MAKEOBJDIRPREFIX}/do_aout_installworld \
|
||||
${MAKEOBJDIRPREFIX}/do_elf_installworld \
|
||||
${MAKEOBJDIRPREFIX}/do_elf_kernel \
|
||||
${MAKEOBJDIRPREFIX}/do_set_objformat \
|
||||
${MAKEOBJDIRPREFIX}/do_reboot
|
||||
|
||||
# front-load all the information we're going to need.
|
||||
/var/db/update.cfg:
|
||||
@if [ -f ${.CURDIR}/tools/tools/upgrade/doupgrade.sh ]; then \
|
||||
env MACHINE=${MACHINE} CURDIR=${.CURDIR} sh ${.CURDIR}/tools/tools/upgrade/doupgrade.sh 1 /var/db/update.cfg; \
|
||||
else \
|
||||
echo "Your source tree must not be fully populated; unable to find upgrade script"; echo "in ${.CURDIR}/tools/tools/upgrade/doupgrade.sh."; exit 1; \
|
||||
fi
|
||||
|
||||
#
|
||||
# Just do the build parts of the transition build.
|
||||
#
|
||||
aout-to-elf-build : \
|
||||
${MAKEOBJDIRPREFIX}/do_aout_buildworld \
|
||||
${MAKEOBJDIRPREFIX}/do_elf_buildworld
|
||||
|
||||
#
|
||||
# The installed system may not have tools capable of building an elf
|
||||
# aware world, so a complete aout buildworld is required to get a known
|
||||
# set of tools.
|
||||
#
|
||||
${MAKEOBJDIRPREFIX}/do_aout_buildworld :
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Doing an aout buildworld to get an up-to-date set of tools"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@cd ${.CURDIR}; MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/aout \
|
||||
OBJFORMAT=aout REALLY_WANT_DEPRECIATED_AOUT=yes \
|
||||
${MAKE} -f Makefile.inc1 -m ${.CURDIR}/share/mk buildworld
|
||||
@touch ${MAKEOBJDIRPREFIX}/do_aout_buildworld
|
||||
|
||||
#
|
||||
# Temporary path for initial elf build.
|
||||
#
|
||||
AOUTTMPPATH= ${MAKEOBJDIRPREFIX}/aout${.CURDIR}/tmp/sbin:${MAKEOBJDIRPREFIX}/aout${.CURDIR}/tmp/bin:${MAKEOBJDIRPREFIX}/aout${.CURDIR}/tmp/usr/sbin:${MAKEOBJDIRPREFIX}/aout${.CURDIR}/tmp/usr/bin:${MAKEOBJDIRPREFIX}/aout${.CURDIR}/tmp/usr/games
|
||||
|
||||
#
|
||||
# Use the aout tools from the aout buildworld to do an elf buildworld.
|
||||
#
|
||||
${MAKEOBJDIRPREFIX}/do_elf_buildworld :
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Doing an elf buildworld using the aout tools in the aout"
|
||||
@echo " obj tree."
|
||||
@echo "--------------------------------------------------------------"
|
||||
@cd ${.CURDIR}; MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/elf \
|
||||
PATH=${AOUTTMPPATH} OBJFORMAT=elf NOTOOLS=1 \
|
||||
TOOLROOT=${MAKEOBJDIRPREFIX}/aout${.CURDIR}/tmp \
|
||||
X11BASE=/nonexistent \
|
||||
${MAKE} -f Makefile.inc1 -m ${.CURDIR}/share/mk buildworld
|
||||
@touch ${MAKEOBJDIRPREFIX}/do_elf_buildworld
|
||||
|
||||
#
|
||||
# ldconfig should list the directories that the system is currently using.
|
||||
#
|
||||
CUSTOM_LIBDIRS!=ldconfig -r | grep search | sed "s/search directories: //" | sed "s/:/ /g"
|
||||
|
||||
#
|
||||
# These are the standard library directories that should end up containing
|
||||
# just elf libraries.
|
||||
#
|
||||
LIBDIRS=/usr/lib /usr/lib/compat /usr/local/lib /usr/X11R6/lib
|
||||
|
||||
#
|
||||
# Go through the list of library directories from ldconfig and add any
|
||||
# directory that doesn't contain an aout path component to the list of
|
||||
# library directories to search.
|
||||
#
|
||||
.for _lib in ${CUSTOM_LIBDIRS}
|
||||
_lib1=${_lib:S/\/aout//}
|
||||
.if ${_lib1} == ${_lib}
|
||||
.if ${LIBDIRS:R:M${_lib:R}} == ""
|
||||
LIBDIRS+=${_lib}
|
||||
.endif
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
#
|
||||
# Go through the list of library directories and prepare a list of
|
||||
# aout directories.
|
||||
#
|
||||
AOUTLIBDIRS=
|
||||
.for _lib in ${LIBDIRS}
|
||||
AOUTLIBDIRS+=${_lib}/aout
|
||||
.endfor
|
||||
|
||||
#
|
||||
# Move the aout libraries into an aout sub-directory of each elf library
|
||||
# directory.
|
||||
#
|
||||
${MAKEOBJDIRPREFIX}/do_move_aout_libs move-aout-libs :
|
||||
.if !defined(NOCONFIRM)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " You are about to move all the installed a.out libraries into"
|
||||
@echo " an aout sub-directory of each elf library directory. You can"
|
||||
@echo " type Ctrl-C to abort now or press return to start the moving"
|
||||
@echo " the libraries."
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo Directories to search: ${LIBDIRS}
|
||||
@/bin/sh -c "read -p \"Return to continue or Ctrl-C to abort: \" _e"
|
||||
@sh ${.CURDIR}/tools/tools/upgrade/move_aout_libs.sh ${LIBDIRS}
|
||||
.else
|
||||
@NOCONFIRM=1 sh ${.CURDIR}/tools/tools/upgrade/move_aout_libs.sh ${LIBDIRS}
|
||||
.endif
|
||||
@ldconfig ${AOUTLIBDIRS}
|
||||
@touch ${MAKEOBJDIRPREFIX}/do_move_aout_libs
|
||||
|
||||
#
|
||||
# Before installing the aout world, allow for the possibility that the
|
||||
# world about to be installed has some different syscalls to the installed
|
||||
# kernel which will make shutting the system down problematic. We set aside
|
||||
# copies of certain programs which match the running kernel.
|
||||
#
|
||||
# Install the aout world so that anything that isn't replaced by the
|
||||
# elf world will be updated.
|
||||
#
|
||||
${MAKEOBJDIRPREFIX}/do_aout_installworld :
|
||||
.if ${INSTALLEDVERSION} < 300003
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Saving a copy of programs required to shut the system down"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@cp /bin/sh ${MAKEOBJDIRPREFIX}
|
||||
@cp /sbin/reboot ${MAKEOBJDIRPREFIX}
|
||||
.endif
|
||||
@touch ${MAKEOBJDIRPREFIX}/do_aout_installworld
|
||||
|
||||
#
|
||||
# Build and install a new kernel, as well as the boot blocks necessary to
|
||||
# boot it.
|
||||
#
|
||||
${MAKEOBJDIRPREFIX}/do_elf_kernel :
|
||||
@if [ -f /var/db/update.cfg -a -f ${.CURDIR}/tools/tools/upgrade/doupgrade.sh ]; then \
|
||||
env MACHINE=${MACHINE} CURDIR=${.CURDIR} sh ${.CURDIR}/tools/tools/upgrade/doupgrade.sh 2 /var/db/update.cfg; \
|
||||
fi
|
||||
@touch ${MAKEOBJDIRPREFIX}/do_elf_kernel
|
||||
@rm -f /var/db/update.cfg
|
||||
|
||||
#
|
||||
# Install the elf world overwriting just about all the previously installed
|
||||
# aout world. Any aout things that need to be kept have already been
|
||||
# installed in different places (typically in aout subdirectories).
|
||||
#
|
||||
${MAKEOBJDIRPREFIX}/do_elf_installworld :
|
||||
.if !defined(NOCONFIRM)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " You are about to update the installed system (or the system"
|
||||
@echo " that your DESTDIR points to) with the elf versions of"
|
||||
@echo " everything, replacing the aout versions. You can type Ctrl-C"
|
||||
@echo " to abort now, leaving just the aout world installed, or"
|
||||
@echo " press return to start the second phase of the update."
|
||||
@echo "--------------------------------------------------------------"
|
||||
@/bin/sh -c "read -p \"Return to continue or Ctrl-C to abort: \" _e"
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Doing an elf installworld using the aout tools in the aout"
|
||||
@echo " obj tree."
|
||||
@echo "--------------------------------------------------------------"
|
||||
@cd ${.CURDIR}; MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/elf \
|
||||
PATH=${AOUTTMPPATH} OBJFORMAT=elf NOTOOLS=1 \
|
||||
TOOLROOT=${MAKEOBJDIRPREFIX}/aout${.CURDIR}/tmp \
|
||||
${MAKE} -f Makefile.inc1 -m ${.CURDIR}/share/mk installworld
|
||||
@if [ ! -f /etc/pam.conf ]; then cp ${.CURDIR}/etc/pam.conf /etc; fi
|
||||
@if [ ! -f /etc/auth.conf ]; then cp ${.CURDIR}/etc/auth.conf /etc; fi
|
||||
@if [ ! -f /etc/login.conf ]; then cp ${.CURDIR}/etc/login.conf /etc; fi
|
||||
@touch ${MAKEOBJDIRPREFIX}/do_elf_installworld
|
||||
|
||||
#
|
||||
# Now that the elf world has been installed, we can set the default
|
||||
# object format to elf.
|
||||
#
|
||||
${MAKEOBJDIRPREFIX}/do_set_objformat :
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Setting the default object format to elf"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo "OBJFORMAT=elf" > ${DESTDIR}/etc/objformat
|
||||
@touch ${MAKEOBJDIRPREFIX}/do_set_objformat
|
||||
|
||||
#
|
||||
# Time to reboot!
|
||||
${MAKEOBJDIRPREFIX}/do_reboot :
|
||||
.if !defined(NOCONFIRM)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Your system has now been fully updated to elf!"
|
||||
@echo
|
||||
@echo " It's now time to reboot from your new ELF kernel."
|
||||
@echo " You can type Ctrl-C to abort this (at your own risk)"
|
||||
@echo " or press return to reboot the system."
|
||||
@echo "--------------------------------------------------------------"
|
||||
@${MAKEOBJDIRPREFIX}/sh -c "read -p \"Return to continue or Ctrl-C to abort: \" _e"
|
||||
.endif
|
||||
@echo " Rebooting......."
|
||||
@echo "--------------------------------------------------------------"
|
||||
@touch ${MAKEOBJDIRPREFIX}/do_reboot
|
||||
@-${MAKEOBJDIRPREFIX}/reboot
|
||||
@@ -1,6 +1,5 @@
|
||||
This is the top level of the FreeBSD source directory. This file
|
||||
was last revised on:
|
||||
$FreeBSD$
|
||||
was last revised on: $Id: README,v 1.7 1997/01/01 14:06:29 jkh Exp $
|
||||
|
||||
For copyright information, please see the file COPYRIGHT in this
|
||||
directory (additional copyright information also exists for some
|
||||
@@ -11,14 +10,13 @@ The Makefile in this directory supports a number of targets for
|
||||
building components (or all) of the FreeBSD source tree, the most
|
||||
commonly used one being ``world'', which rebuilds and installs
|
||||
everything in the FreeBSD system from the source tree except the
|
||||
kernel and the contents of /etc. Please see the top of the Makefile
|
||||
in this directory for more information on the standard build targets
|
||||
and compile-time flags.
|
||||
kernel. Please see the top of the Makefile for more information on
|
||||
the standard build targets and compile-time flags.
|
||||
|
||||
Building a kernel with config(8) is a somewhat more involved process,
|
||||
Building a kernel with config(1) is a somewhat more involved process,
|
||||
documentation for which can be found at:
|
||||
http://www.freebsd.org/handbook/kernelconfig.html
|
||||
And in the config(8) man page.
|
||||
And in the config(1) man page.
|
||||
|
||||
The sample kernel configuration files reside in the sys/i386/conf
|
||||
sub-directory (assuming that you've installed the kernel sources), the
|
||||
@@ -35,7 +33,7 @@ bin System/User commands.
|
||||
|
||||
contrib Packages contributed by 3rd parties.
|
||||
|
||||
crypto Export controlled stuff (see crypto/README).
|
||||
eBones Kerberos package - NOT FOR EXPORT!
|
||||
|
||||
etc Template files for /etc
|
||||
|
||||
@@ -46,12 +44,12 @@ gnu Various commands and libraries under the GNU Public License.
|
||||
|
||||
include System include files.
|
||||
|
||||
kerberosIV Kerberos package.
|
||||
|
||||
lib System libraries.
|
||||
|
||||
libexec System daemons.
|
||||
|
||||
lkm Loadable Kernel Modules.
|
||||
|
||||
release Release building Makefile & associated tools.
|
||||
|
||||
sbin System commands.
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
Updating Information for FreeBSD current users
|
||||
|
||||
This file is maintained by [email protected]. Please send new entries
|
||||
directly to him. See end of file for further details.
|
||||
|
||||
19990510:
|
||||
Previously, one would define "NOAOUT" to keep from building
|
||||
the legacy a.out bits. Now one would define "WANT_AOUT" to
|
||||
build them.
|
||||
|
||||
19990507:
|
||||
New devstat API requires recompilation of libdevstat, systat,
|
||||
iostat, vmstat and rpc.rstatd. A new kernel is also required.
|
||||
make world + building a kernel should do all of this. Any
|
||||
ports that use devstat need to be recompiled as well.
|
||||
|
||||
19990424:
|
||||
The 'nlpt' driver has changed names to become the 'lpt' driver.
|
||||
See ppbus(4) or http://www.freebsd.org/~nsouch/ppbus.html
|
||||
for proper configuration details.
|
||||
|
||||
19990209:
|
||||
New devstat API requires recompilation of libdevstat, systat,
|
||||
iostat, vmstat and rpc.rstatd. A new kernel is also required.
|
||||
make world + building a kernel should do all of this. Any
|
||||
ports that use devstat need to be recompiled as well.
|
||||
|
||||
19990125:
|
||||
Linux threads options has gone away (they are now standard in
|
||||
the FreeBSD kernel). A recompile of all libkvm using programs
|
||||
is in order (or better yet a make world).
|
||||
|
||||
19990122:
|
||||
On or about this date there was a small window when the boot
|
||||
blocks had some minor problems which seemed to force one to
|
||||
edit /etc/fstab. This has been corrected, if you are seeing this
|
||||
problem, please rebuild and reinstall your boot blocks.
|
||||
|
||||
19990121:
|
||||
Vinum has changed. The "vinum read" command has changed. For
|
||||
updates, please see
|
||||
|
||||
http://www.freebsd.org/cgi/getmsg.cgi?fetch=800363+0+current/freebsd-current
|
||||
|
||||
for details.
|
||||
|
||||
19990120:
|
||||
Stable branch created. You might want to consider using this
|
||||
branch. It is tagged with RELENG_3.
|
||||
|
||||
19990119:
|
||||
More work on the syscons driver has been committed. Since
|
||||
files moved around, you will need to reconfigure your kernel,
|
||||
and make clean; make depend before rebuilding the kernel. No
|
||||
config file changes are needed.
|
||||
|
||||
19990111:
|
||||
New keyboard and video card drivers are introduced as the first
|
||||
stage of console driver reorganization. You are required to
|
||||
update the kernel configuration file and rebuild the kernel.
|
||||
kbdcontrol, vidcontrol, and screen savers also need recompilation.
|
||||
The instruction can be found in
|
||||
|
||||
http://www.freebsd.org/~yokota/sc_update.txt
|
||||
|
||||
It has notes on splash screen too.
|
||||
|
||||
19990106:
|
||||
Robert Nordier was kind enough to make this page to enable people to
|
||||
install the new bootblocks:
|
||||
|
||||
http://www.freebsd.org/~rnordier/boot.txt
|
||||
|
||||
When updating to ELF, make sure that you have updated your
|
||||
/etc/rc files which have different ldconfig invocations for
|
||||
elf and aout. Otherwise things like X will stop working with
|
||||
messages about being unable to find library files. The
|
||||
mergemaster utility in ports/sysutils/mergemaster helps to
|
||||
keep critical files like this in sync, and its use is
|
||||
recommended.
|
||||
|
||||
19990104:
|
||||
Information about ELF day (see 19981230) can be found in
|
||||
|
||||
http://www.freebsd.org/~peter/elfday.html
|
||||
|
||||
about the upcoming change, its motivations and instructions
|
||||
for doing the upgrade.
|
||||
|
||||
19981230:
|
||||
You should install new bootblocks now. The ELF kernel will
|
||||
become default soon. In addition, you'll need to upgrade
|
||||
your userland programs to ELF before then as well. Use
|
||||
make aout-to-elf to upgrade your userland programs (old
|
||||
a.out programs in, for example, /usr/local/bin will
|
||||
continue to work, even after the upgrade). See src/Makefile
|
||||
for more details.
|
||||
|
||||
19981224:
|
||||
The old wcd driver has been deleted from the kernel. The
|
||||
driver that replaces it is named acd. You'll need to change
|
||||
this in your configuration files.
|
||||
|
||||
Failure to do this will result in "ATAPI CD-ROMs not
|
||||
configured" at boot time.
|
||||
|
||||
The floppy tape driver (ft) has been removed from the kernel,
|
||||
with no replacement driver.
|
||||
|
||||
19981202:
|
||||
New groups from 19981201 commented out of mtree, so they
|
||||
aren't strictly needed, but still a good idea to have.
|
||||
|
||||
19981201:
|
||||
New user/group added: bind. From src/etc/master.passwd and
|
||||
src/etc/group:
|
||||
% grep <newstuff> /usr/src/etc/group
|
||||
bind:*:53:
|
||||
% grep <newstuff> /usr/src/etc/master.passwd
|
||||
tty:*:4:65533::0:0:Tty Sandbox:/:/sbin/nologin
|
||||
kmem:*:5:65533::0:0:KMem Sandbox:/:/sbin/nologin
|
||||
bind:*:53:53::0:0:Bind Sandbox:/:/sbin/nologin
|
||||
|
||||
19981118:
|
||||
PAM integrated into the tree. Requires new /etc/pam.conf file
|
||||
to silence warnings from authentication programs (login, etc).
|
||||
See src/etc/pam.conf for a sample.
|
||||
|
||||
This file contains a list, in reverse chronologocal order, of major
|
||||
breakages in tracking -stable. Not all things will be listed here,
|
||||
and it only starts on Novemeber 18, 1998. If you have an earlier
|
||||
version of FreeBSD, you are on your own to get to November 18, 1998.
|
||||
|
||||
Please filter your entries through Warner ([email protected]) so that
|
||||
the style, formatting, etc of this file can be maintained.
|
||||
|
||||
$FreeBSD$
|
||||
+4
-34
@@ -1,38 +1,8 @@
|
||||
# From: @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile,v 1.4.2.1 1997/03/07 09:39:06 joerg Exp $
|
||||
|
||||
SUBDIR= cat \
|
||||
chio \
|
||||
chmod \
|
||||
cp \
|
||||
csh \
|
||||
date \
|
||||
dd \
|
||||
df \
|
||||
domainname \
|
||||
echo \
|
||||
ed \
|
||||
expr \
|
||||
hostname \
|
||||
kill \
|
||||
ln \
|
||||
ls \
|
||||
mkdir \
|
||||
mv \
|
||||
pax \
|
||||
ps \
|
||||
pwd \
|
||||
rcp \
|
||||
rm \
|
||||
rmdir \
|
||||
sh \
|
||||
sleep \
|
||||
stty \
|
||||
sync \
|
||||
test
|
||||
|
||||
.if !defined(NO_SENDMAIL)
|
||||
SUBDIR+=rmail
|
||||
.endif
|
||||
SUBDIR= cat chio chmod cp csh date dd df domainname echo ed expr hostname \
|
||||
kill ln ls mkdir mv pax ps pwd rcp rm rmail rmdir sh sleep \
|
||||
stty sync test
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
# @(#)Makefile.inc 8.1 (Berkeley) 5/31/93
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile.inc,v 1.7 1996/09/22 21:51:04 wosch Exp $
|
||||
|
||||
BINDIR?= /bin
|
||||
CFLAGS+= -Wall -Wformat
|
||||
NOSHARED?= YES
|
||||
|
||||
.if exists (${.CURDIR}/../../secure)
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile,v 1.2 1994/09/24 02:53:25 davidg Exp $
|
||||
|
||||
PROG= cat
|
||||
|
||||
|
||||
+19
-17
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)cat.1 8.3 (Berkeley) 5/2/95
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: cat.1,v 1.3.2.1 1997/02/28 07:54:20 mpp Exp $
|
||||
.\"
|
||||
.Dd May 2, 1995
|
||||
.Dt CAT 1
|
||||
@@ -48,7 +48,7 @@
|
||||
.Op Ar
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm cat
|
||||
utility reads files sequentially, writing them to the standard output.
|
||||
The
|
||||
.Ar file
|
||||
@@ -56,44 +56,47 @@ operands are processed in command line order.
|
||||
A single dash represents the standard input.
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width indent
|
||||
.Bl -tag -width Ds
|
||||
.It Fl b
|
||||
Number the non-blank output lines, starting at 1.
|
||||
Implies the
|
||||
.Fl n
|
||||
option but doesn't number blank lines.
|
||||
.It Fl e
|
||||
Display non-printing characters (see the
|
||||
Implies the
|
||||
.Fl v
|
||||
option), and display a dollar sign
|
||||
option, and displays a dollar sign
|
||||
.Pq Ql \&$
|
||||
at the end of each line.
|
||||
at the end of each line
|
||||
as well.
|
||||
.It Fl n
|
||||
Number the output lines, starting at 1.
|
||||
.It Fl s
|
||||
Squeeze multiple adjacent empty lines, causing the output to be
|
||||
single spaced.
|
||||
.It Fl t
|
||||
Display non-printing characters (see the
|
||||
Implies the
|
||||
.Fl v
|
||||
option), and display tab characters as
|
||||
.Ql ^I .
|
||||
option, and displays tab characters as
|
||||
.Ql ^I
|
||||
as well.
|
||||
.It Fl u
|
||||
The
|
||||
.Fl u
|
||||
option guarantees that the output is unbuffered.
|
||||
.It Fl v
|
||||
Display non-printing characters so they are visible.
|
||||
Displays non-printing characters so they are visible.
|
||||
Control characters print as
|
||||
.Ql ^X
|
||||
for control-X; the delete
|
||||
character (octal 0177) prints as
|
||||
.Ql ^?
|
||||
.Pf Non- Tn ASCII
|
||||
characters (with the high bit set) are printed as
|
||||
Non-ascii characters (with the high bit set) are printed as
|
||||
.Ql M-
|
||||
(for meta) followed by the character for the low 7 bits.
|
||||
.El
|
||||
.Sh DIAGNOSTICS
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm cat
|
||||
utility exits 0 on success, and >0 if an error occurs.
|
||||
.Sh BUGS
|
||||
Because of the shell language mechanism used to perform output
|
||||
@@ -116,8 +119,7 @@ will cause the original data in file1 to be destroyed!
|
||||
A
|
||||
.Nm
|
||||
command appeared in Version 1 AT&T UNIX.
|
||||
.An Dennis Ritchie
|
||||
designed and wrote the first man page.
|
||||
Dennis Ritchie designed and wrote the first man page.
|
||||
It appears to have been
|
||||
.Xr cat 1 .
|
||||
|
||||
+12
-13
@@ -32,20 +32,18 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cat.c,v 1.5 1996/09/30 15:45:36 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char const copyright[] =
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1989, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -53,19 +51,20 @@ static const char rcsid[] =
|
||||
|
||||
#include <ctype.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <locale.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int bflag, eflag, nflag, sflag, tflag, vflag;
|
||||
int rval;
|
||||
const char *filename;
|
||||
char *filename;
|
||||
|
||||
void cook_args __P((char *argv[]));
|
||||
void cook_buf __P((FILE *));
|
||||
int main __P((int argc, char *argv[]));
|
||||
void raw_args __P((char *argv[]));
|
||||
void raw_cat __P((int));
|
||||
|
||||
@@ -74,11 +73,12 @@ main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
extern int optind;
|
||||
int ch;
|
||||
|
||||
setlocale(LC_CTYPE, "");
|
||||
|
||||
while ((ch = getopt(argc, argv, "benstuv")) != -1)
|
||||
while ((ch = getopt(argc, argv, "benstuv")) != EOF)
|
||||
switch (ch) {
|
||||
case 'b':
|
||||
bflag = nflag = 1; /* -b implies -n */
|
||||
@@ -237,9 +237,8 @@ void
|
||||
raw_cat(rfd)
|
||||
register int rfd;
|
||||
{
|
||||
register int off, wfd;
|
||||
ssize_t nr, nw;
|
||||
static size_t bsize;
|
||||
register int nr, nw, off, wfd;
|
||||
static int bsize;
|
||||
static char *buf;
|
||||
struct stat sbuf;
|
||||
|
||||
@@ -248,12 +247,12 @@ raw_cat(rfd)
|
||||
if (fstat(wfd, &sbuf))
|
||||
err(1, "%s", filename);
|
||||
bsize = MAX(sbuf.st_blksize, 1024);
|
||||
if ((buf = malloc(bsize)) == NULL)
|
||||
if ((buf = malloc((u_int)bsize)) == NULL)
|
||||
err(1, NULL);
|
||||
}
|
||||
while ((nr = read(rfd, buf, bsize)) > 0)
|
||||
for (off = 0; nr; nr -= nw, off += nw)
|
||||
if ((nw = write(wfd, buf + off, (size_t)nr)) < 0)
|
||||
if ((nw = write(wfd, buf + off, nr)) < 0)
|
||||
err(1, "stdout");
|
||||
if (nr < 0) {
|
||||
warn("%s", filename);
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile,v 1.1.1.1 1997/03/06 15:30:06 joerg Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/6/93
|
||||
|
||||
CFLAGS+=-I${.CURDIR}/../../sys
|
||||
|
||||
PROG= chio
|
||||
SRCS= chio.c
|
||||
BINOWN= root
|
||||
BINMODE=4555
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+57
-123
@@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: chio.1,v 1.4 1997/10/02 00:41:25 hubertf Exp $
|
||||
.\" $NetBSD: $
|
||||
.\"
|
||||
.\" Copyright (c) 1996 Jason R. Thorpe <[email protected]>
|
||||
.\" All rights reserved.
|
||||
@@ -30,19 +30,16 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd May 14, 1998
|
||||
.Dd April 2, 1996
|
||||
.Dt CHIO 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm chio
|
||||
.Nd medium changer control utility
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Nm chio
|
||||
.Op Fl f Ar changer
|
||||
.Ar command
|
||||
.Op Fl <flags>
|
||||
.Ar arg1
|
||||
.Ar arg2
|
||||
.Oo
|
||||
@@ -50,7 +47,7 @@
|
||||
.Oc
|
||||
.Oc
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
.Nm Chio
|
||||
is used to control the operation of medium changers, such as those found
|
||||
in tape and optical disk jukeboxes.
|
||||
.Pp
|
||||
@@ -64,53 +61,49 @@ rather than the default device
|
||||
.El
|
||||
.Pp
|
||||
The default changer may be overridden by setting the environment variable
|
||||
.Ev CHANGER
|
||||
.Nm CHANGER
|
||||
to the desired changer device.
|
||||
.Pp
|
||||
A medium changer apparatus is made up of
|
||||
.Em elements .
|
||||
.Pa elements .
|
||||
There are four element types:
|
||||
.Em picker
|
||||
.Pa picker
|
||||
(medium transport),
|
||||
.Em slot
|
||||
.Pa slot
|
||||
(storage),
|
||||
.Em portal
|
||||
.Pa portal
|
||||
(import/export), and
|
||||
.Em drive
|
||||
.Pa drive
|
||||
(data transfer). In this command description, the shorthand
|
||||
.Em ET
|
||||
.Nm ET
|
||||
will be used to represent an element type, and
|
||||
.Em EU
|
||||
.Nm EU
|
||||
will be used to represent an element unit. For example, to represent
|
||||
the first robotic arm in the changer, the
|
||||
.Em ET
|
||||
would be
|
||||
the first robotic arm in the changer, the ET would be
|
||||
.Dq picker
|
||||
and the
|
||||
.Em EU
|
||||
would be
|
||||
and the EU would be
|
||||
.Dq 0 .
|
||||
.Pp
|
||||
.Sh SUPPORTED COMMANDS
|
||||
.Bl -tag -width indent
|
||||
.It Xo Nm move
|
||||
.Nm chio move
|
||||
.Ar <from ET> <from EU> <to ET> <to EU>
|
||||
.Op Ar inv
|
||||
.Xc
|
||||
Move the media unit from
|
||||
.Pp
|
||||
Moves the media unit from
|
||||
.Pa <from ET/EU>
|
||||
to
|
||||
.Pa <to ET/EU> .
|
||||
If the optional modifier
|
||||
.Pa inv
|
||||
is specified, the media unit will be inverted before insertion.
|
||||
.It Xo Nm exchange
|
||||
.Pp
|
||||
.Nm chio exchange
|
||||
.Ar <src ET> <src EU> <dst1 ET> <dst1 EU>
|
||||
.Op Ar <dst2 ET> <dst2 ET>
|
||||
.Op Ar inv1
|
||||
.Op Ar inv2
|
||||
.Xc
|
||||
Perform a media unit exchange operation. The media unit in
|
||||
.Pp
|
||||
Performs a media unit exchange operation. The media unit in
|
||||
.Pa <src ET/EU>
|
||||
is moved to
|
||||
.Pa <dst1 ET/EU>
|
||||
@@ -131,16 +124,17 @@ specify whether the media units are to be inverted before insertion into
|
||||
.Pa <dst1 ET/EU>
|
||||
and
|
||||
.Pa <dst2 ET/EU>
|
||||
respectively.
|
||||
respecitively.
|
||||
.Pp
|
||||
Note that not all medium changers support the
|
||||
.Ic exchange
|
||||
operation; the changer must have multiple free pickers or emulate
|
||||
.Nm exchange
|
||||
operation; The changer must have multiple free pickers or emulate
|
||||
multiple free pickers with transient storage.
|
||||
.It Xo Nm position
|
||||
.Pp
|
||||
.Nm chio position
|
||||
.Ar <to ET> <to EU>
|
||||
.Op Ar inv
|
||||
.Xc
|
||||
.Pp
|
||||
Position the picker in front of the element described by
|
||||
.Pa <to ET/EU> .
|
||||
If the optional modifier
|
||||
@@ -148,121 +142,61 @@ If the optional modifier
|
||||
is specified, the media unit will be inverted before insertion.
|
||||
.Pp
|
||||
Note that not all changers behave as expected when issued this command.
|
||||
.It Nm params
|
||||
.Pp
|
||||
.Nm chio params
|
||||
.Pp
|
||||
Report the number of slots, drives, pickers, and portals in the changer,
|
||||
and which picker unit the changer is currently configured to use.
|
||||
.It Nm getpicker
|
||||
.Pp
|
||||
.Nm chio getpicker
|
||||
.Pp
|
||||
Report which picker unit the changer is currently configured to use.
|
||||
.It Xo Nm setpicker
|
||||
.Pp
|
||||
.Nm chio setpicker
|
||||
.Ar <unit>
|
||||
.Xc
|
||||
.Pp
|
||||
Configure the changer to use picker
|
||||
.Pa <unit> .
|
||||
.Pp
|
||||
.It Xo Nm ielem
|
||||
.Op Pa <timeout>
|
||||
.Xc
|
||||
Perform an \fBINITIALIZE ELEMENT STATUS\fR
|
||||
operation on the changer. The optional
|
||||
.Pa <timeout>
|
||||
parameter may be given to specify a timeout in seconds for the
|
||||
operations. This may be used if the operation takes unusually long
|
||||
because of buggy firmware or the like.
|
||||
.It Xo Nm voltag
|
||||
.Op Fl fca
|
||||
.Ar <ET>
|
||||
.Ar <EU>
|
||||
.Op Ar <label>
|
||||
.Op Ar <serial>
|
||||
.Xc
|
||||
Change volume tag for an element in the media changer. This command
|
||||
is only supported by few media changers. If it is not supported by a
|
||||
device, using this command will usually result in a "Invalid Field in
|
||||
CDB" error message on the console.
|
||||
.Pp
|
||||
If the
|
||||
.Fl c
|
||||
flag is specified, the volume tag of the specified element is
|
||||
cleared. If the
|
||||
.Fl f
|
||||
flag is specified, the volume tag is superseded with the specified
|
||||
volume tag even if a volume tag is already defined for the element.
|
||||
It is an error to not specify the
|
||||
.Fl f
|
||||
flag when trying to set a label for an element which already has
|
||||
volume tag information defined.
|
||||
.Pp
|
||||
The command works with the primary volume tag or, if the
|
||||
.Fl a
|
||||
flag is given, with the alternate volume tag.
|
||||
.It Xo Nm status
|
||||
.Op Fl vVsSbIa
|
||||
.Nm chio status
|
||||
.Op Ar <type>
|
||||
.Xc
|
||||
.Pp
|
||||
Report the status of all elements in the changer. If
|
||||
.Pa <type>
|
||||
is specified, report the status of all elements of type
|
||||
.Pa <type> .
|
||||
.It Fl v
|
||||
Print the primary volume tag for each loaded medium, if any. The volume
|
||||
tag is printed as \fB<LABEL:SERIAL>\fR.
|
||||
.It Fl V
|
||||
Print the alternate volume tag for each loaded medium, if any.
|
||||
.It Fl s
|
||||
Print the additional sense code and additional sense code qualifier for
|
||||
each element.
|
||||
.It Fl S
|
||||
Print the element source address for each element.
|
||||
.It Fl b
|
||||
Print SCSI bus information for each element. Note that this information
|
||||
is valid only for drives.
|
||||
.It Fl I
|
||||
Print the internal element addresses for each element. The internal
|
||||
element address is not normally used with this driver. It is reported
|
||||
for diagnostic purposes only.
|
||||
.It Fl a
|
||||
Print all additional information (as in
|
||||
.Fl vVsSba
|
||||
).
|
||||
.El
|
||||
.Pp
|
||||
The status bits are defined as follows:
|
||||
.Bl -tag -width indent
|
||||
.It FULL
|
||||
.It Nm FULL
|
||||
Element contains a media unit.
|
||||
.It IMPEXP
|
||||
.It Nm IMPEXP
|
||||
Media was deposited into element by an outside human operator.
|
||||
.It EXCEPT
|
||||
.It Nm EXCEPT
|
||||
Element is in an abnormal state.
|
||||
.It ACCESS
|
||||
.It Nm ACCESS
|
||||
Media in this element is accessible by a picker.
|
||||
.It EXENAB
|
||||
Element supports passing media (exporting) to an outside human operator.
|
||||
.It INENAB
|
||||
.It Nm EXENAB
|
||||
Element supports passing media (exporting) to an outsite human operator.
|
||||
.It Nm INENAB
|
||||
Element supports receiving media (importing) from an outside human operator.
|
||||
.El
|
||||
.Pp
|
||||
.Sh EXAMPLES
|
||||
.Bl -tag -width indent
|
||||
.It Nm chio move slot 3 drive 0
|
||||
Move the media in slot 3 (fourth slot) to drive 0 (first drive).
|
||||
.It Nm chio setpicker 2
|
||||
Configure the changer to use picker 2 (third picker) for operations.
|
||||
.El
|
||||
.Nm chio move slot 3 drive 0
|
||||
.Pp
|
||||
Moves the media in slot 3 (fourth slot) to drive 0 (first drive).
|
||||
.Pp
|
||||
.Nm chio setpicker 2
|
||||
Configures the changer to use picker 2 (third picker) for operations.
|
||||
.Pp
|
||||
.Sh FILES
|
||||
.Bl -tag -width /dev/ch0 -compact
|
||||
.It Pa /dev/ch0
|
||||
default changer device
|
||||
.El
|
||||
/dev/ch0 - default changer device
|
||||
.Sh SEE ALSO
|
||||
.Xr mt 1 ,
|
||||
.Xr mount 8 .
|
||||
.Sh AUTHORS
|
||||
.Sh AUTHOR
|
||||
The
|
||||
.Nm
|
||||
program and SCSI changer driver were written by
|
||||
.An Jason R. Thorpe Aq [email protected]
|
||||
for And Communications, http://www.and.com/.
|
||||
.br
|
||||
Additional work by
|
||||
.An Hans Huebner Aq [email protected]
|
||||
.Nm chio
|
||||
program and SCSI changer driver were written by Jason R. Thorpe
|
||||
<[email protected]> for And Communications, http://www.and.com/
|
||||
+73
-362
@@ -1,4 +1,5 @@
|
||||
/* $NetBSD: chio.c,v 1.6 1998/01/04 23:53:58 thorpej Exp $ */
|
||||
/* $Id: chio.c,v 1.1.1.1 1997/03/06 15:30:06 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Jason R. Thorpe <[email protected]>
|
||||
* All rights reserved.
|
||||
@@ -30,21 +31,14 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
* Additional Copyright (c) 1997, by Matthew Jacob, for NASA/Ames Research Ctr.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char copyright[] =
|
||||
"@(#) Copyright (c) 1996 Jason R. Thorpe. All rights reserved.";
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/chio.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -54,16 +48,14 @@ static const char rcsid[] =
|
||||
#include "pathnames.h"
|
||||
|
||||
extern char *__progname; /* from crt0.o */
|
||||
extern int optreset; /* from getopt.o */
|
||||
|
||||
static void usage __P((void));
|
||||
static void cleanup __P((void));
|
||||
static int parse_element_type __P((char *));
|
||||
static int parse_element_unit __P((char *));
|
||||
static const char * element_type_name __P((int et));
|
||||
static int parse_special __P((char *));
|
||||
static int is_special __P((char *));
|
||||
static const char *bits_to_string __P((int, const char *));
|
||||
static char *bits_to_string __P((int, const char *));
|
||||
|
||||
static int do_move __P((char *, int, char **));
|
||||
static int do_exchange __P((char *, int, char **));
|
||||
@@ -72,29 +64,25 @@ static int do_params __P((char *, int, char **));
|
||||
static int do_getpicker __P((char *, int, char **));
|
||||
static int do_setpicker __P((char *, int, char **));
|
||||
static int do_status __P((char *, int, char **));
|
||||
static int do_ielem __P((char *, int, char **));
|
||||
static int do_voltag __P((char *, int, char **));
|
||||
|
||||
/* Valid changer element types. */
|
||||
const struct element_type elements[] = {
|
||||
{ "drive", CHET_DT },
|
||||
{ "picker", CHET_MT },
|
||||
{ "portal", CHET_IE },
|
||||
{ "slot", CHET_ST },
|
||||
{ "portal", CHET_IE },
|
||||
{ "drive", CHET_DT },
|
||||
{ NULL, 0 },
|
||||
};
|
||||
|
||||
/* Valid commands. */
|
||||
const struct changer_command commands[] = {
|
||||
{ "exchange", do_exchange },
|
||||
{ "getpicker", do_getpicker },
|
||||
{ "ielem", do_ielem },
|
||||
{ "move", do_move },
|
||||
{ "params", do_params },
|
||||
{ "exchange", do_exchange },
|
||||
{ "position", do_position },
|
||||
{ "params", do_params },
|
||||
{ "getpicker", do_getpicker },
|
||||
{ "setpicker", do_setpicker },
|
||||
{ "status", do_status },
|
||||
{ "voltag", do_voltag },
|
||||
{ NULL, 0 },
|
||||
};
|
||||
|
||||
@@ -107,7 +95,7 @@ const struct special_word specials[] = {
|
||||
};
|
||||
|
||||
static int changer_fd;
|
||||
static const char *changer_name;
|
||||
static char *changer_name;
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
@@ -115,6 +103,7 @@ main(argc, argv)
|
||||
char **argv;
|
||||
{
|
||||
int ch, i;
|
||||
char *cp;
|
||||
|
||||
while ((ch = getopt(argc, argv, "f:")) != -1) {
|
||||
switch (ch) {
|
||||
@@ -149,19 +138,12 @@ main(argc, argv)
|
||||
for (i = 0; commands[i].cc_name != NULL; ++i)
|
||||
if (strcmp(*argv, commands[i].cc_name) == 0)
|
||||
break;
|
||||
if (commands[i].cc_name == NULL) {
|
||||
/* look for abbreviation */
|
||||
for (i = 0; commands[i].cc_name != NULL; ++i)
|
||||
if (strncmp(*argv, commands[i].cc_name,
|
||||
strlen(*argv)) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (commands[i].cc_name == NULL)
|
||||
errx(1, "unknown command: %s", *argv);
|
||||
|
||||
/* Skip over the command name and call handler. */
|
||||
++argv; --argc;
|
||||
exit ((*commands[i].cc_handler)(commands[i].cc_name, argc, argv));
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -180,9 +162,6 @@ do_move(cname, argc, argv)
|
||||
*
|
||||
* where ET == element type and EU == element unit.
|
||||
*/
|
||||
|
||||
++argv; --argc;
|
||||
|
||||
if (argc < 4) {
|
||||
warnx("%s: too few arguments", cname);
|
||||
goto usage;
|
||||
@@ -190,7 +169,7 @@ do_move(cname, argc, argv)
|
||||
warnx("%s: too many arguments", cname);
|
||||
goto usage;
|
||||
}
|
||||
(void) memset(&cmd, 0, sizeof(cmd));
|
||||
bzero(&cmd, sizeof(cmd));
|
||||
|
||||
/* <from ET> */
|
||||
cmd.cm_fromtype = parse_element_type(*argv);
|
||||
@@ -224,13 +203,13 @@ do_move(cname, argc, argv)
|
||||
}
|
||||
|
||||
/* Send command to changer. */
|
||||
if (ioctl(changer_fd, CHIOMOVE, &cmd))
|
||||
if (ioctl(changer_fd, CHIOMOVE, (char *)&cmd))
|
||||
err(1, "%s: CHIOMOVE", changer_name);
|
||||
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
(void) fprintf(stderr, "usage: %s %s "
|
||||
fprintf(stderr, "usage: %s %s "
|
||||
"<from ET> <from EU> <to ET> <to EU> [inv]\n", __progname, cname);
|
||||
return (1);
|
||||
}
|
||||
@@ -251,9 +230,6 @@ do_exchange(cname, argc, argv)
|
||||
*
|
||||
* where ET == element type and EU == element unit.
|
||||
*/
|
||||
|
||||
++argv; --argc;
|
||||
|
||||
if (argc < 4) {
|
||||
warnx("%s: too few arguments", cname);
|
||||
goto usage;
|
||||
@@ -261,7 +237,7 @@ do_exchange(cname, argc, argv)
|
||||
warnx("%s: too many arguments", cname);
|
||||
goto usage;
|
||||
}
|
||||
(void) memset(&cmd, 0, sizeof(cmd));
|
||||
bzero(&cmd, sizeof(cmd));
|
||||
|
||||
/* <src ET> */
|
||||
cmd.ce_srctype = parse_element_type(*argv);
|
||||
@@ -320,14 +296,13 @@ do_exchange(cname, argc, argv)
|
||||
}
|
||||
|
||||
/* Send command to changer. */
|
||||
if (ioctl(changer_fd, CHIOEXCHANGE, &cmd))
|
||||
if (ioctl(changer_fd, CHIOEXCHANGE, (char *)&cmd))
|
||||
err(1, "%s: CHIOEXCHANGE", changer_name);
|
||||
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
(void) fprintf(stderr,
|
||||
"usage: %s %s <src ET> <src EU> <dst1 ET> <dst1 EU>\n"
|
||||
fprintf(stderr, "usage: %s %s <src ET> <src EU> <dst1 ET> <dst1 EU>\n"
|
||||
" [<dst2 ET> <dst2 EU>] [inv1] [inv2]\n",
|
||||
__progname, cname);
|
||||
return (1);
|
||||
@@ -349,9 +324,6 @@ do_position(cname, argc, argv)
|
||||
*
|
||||
* where ET == element type and EU == element unit.
|
||||
*/
|
||||
|
||||
++argv; --argc;
|
||||
|
||||
if (argc < 2) {
|
||||
warnx("%s: too few arguments", cname);
|
||||
goto usage;
|
||||
@@ -359,7 +331,7 @@ do_position(cname, argc, argv)
|
||||
warnx("%s: too many arguments", cname);
|
||||
goto usage;
|
||||
}
|
||||
(void) memset(&cmd, 0, sizeof(cmd));
|
||||
bzero(&cmd, sizeof(cmd));
|
||||
|
||||
/* <to ET> */
|
||||
cmd.cp_type = parse_element_type(*argv);
|
||||
@@ -385,18 +357,17 @@ do_position(cname, argc, argv)
|
||||
}
|
||||
|
||||
/* Send command to changer. */
|
||||
if (ioctl(changer_fd, CHIOPOSITION, &cmd))
|
||||
if (ioctl(changer_fd, CHIOPOSITION, (char *)&cmd))
|
||||
err(1, "%s: CHIOPOSITION", changer_name);
|
||||
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
(void) fprintf(stderr, "usage: %s %s <to ET> <to EU> [inv]\n",
|
||||
fprintf(stderr, "usage: %s %s <to ET> <to EU> [inv]\n",
|
||||
__progname, cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
do_params(cname, argc, argv)
|
||||
char *cname;
|
||||
@@ -404,45 +375,35 @@ do_params(cname, argc, argv)
|
||||
char **argv;
|
||||
{
|
||||
struct changer_params data;
|
||||
int picker;
|
||||
|
||||
/* No arguments to this command. */
|
||||
|
||||
++argv; --argc;
|
||||
|
||||
if (argc) {
|
||||
warnx("%s: no arguments expected", cname);
|
||||
warnx("%s: no arguements expected", cname);
|
||||
goto usage;
|
||||
}
|
||||
|
||||
/* Get params from changer and display them. */
|
||||
(void) memset(&data, 0, sizeof(data));
|
||||
if (ioctl(changer_fd, CHIOGPARAMS, &data))
|
||||
bzero(&data, sizeof(data));
|
||||
if (ioctl(changer_fd, CHIOGPARAMS, (char *)&data))
|
||||
err(1, "%s: CHIOGPARAMS", changer_name);
|
||||
|
||||
(void) printf("%s: %d slot%s, %d drive%s, %d picker%s",
|
||||
printf("%s: %d slot%s, %d drive%s, %d picker%s",
|
||||
changer_name,
|
||||
data.cp_nslots, (data.cp_nslots > 1) ? "s" : "",
|
||||
data.cp_ndrives, (data.cp_ndrives > 1) ? "s" : "",
|
||||
data.cp_npickers, (data.cp_npickers > 1) ? "s" : "");
|
||||
if (data.cp_nportals)
|
||||
(void) printf(", %d portal%s", data.cp_nportals,
|
||||
printf(", %d portal%s", data.cp_nportals,
|
||||
(data.cp_nportals > 1) ? "s" : "");
|
||||
|
||||
/* Get current picker from changer and display it. */
|
||||
if (ioctl(changer_fd, CHIOGPICKER, &picker))
|
||||
err(1, "%s: CHIOGPICKER", changer_name);
|
||||
|
||||
(void) printf("\n%s: current picker: %d\n", changer_name, picker);
|
||||
printf("\n%s: current picker: %d\n", changer_name, data.cp_curpicker);
|
||||
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
(void) fprintf(stderr, "usage: %s %s\n", __progname, cname);
|
||||
fprintf(stderr, "usage: %s %s\n", __progname, cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
do_getpicker(cname, argc, argv)
|
||||
char *cname;
|
||||
@@ -452,24 +413,21 @@ do_getpicker(cname, argc, argv)
|
||||
int picker;
|
||||
|
||||
/* No arguments to this command. */
|
||||
|
||||
++argv; --argc;
|
||||
|
||||
if (argc) {
|
||||
warnx("%s: no arguments expected", cname);
|
||||
goto usage;
|
||||
}
|
||||
|
||||
/* Get current picker from changer and display it. */
|
||||
if (ioctl(changer_fd, CHIOGPICKER, &picker))
|
||||
if (ioctl(changer_fd, CHIOGPICKER, (char *)&picker))
|
||||
err(1, "%s: CHIOGPICKER", changer_name);
|
||||
|
||||
(void) printf("%s: current picker: %d\n", changer_name, picker);
|
||||
printf("%s: current picker: %d\n", changer_name, picker);
|
||||
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
(void) fprintf(stderr, "usage: %s %s\n", __progname, cname);
|
||||
fprintf(stderr, "usage: %s %s\n", __progname, cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -481,8 +439,6 @@ do_setpicker(cname, argc, argv)
|
||||
{
|
||||
int picker;
|
||||
|
||||
++argv; --argc;
|
||||
|
||||
if (argc < 1) {
|
||||
warnx("%s: too few arguments", cname);
|
||||
goto usage;
|
||||
@@ -494,13 +450,13 @@ do_setpicker(cname, argc, argv)
|
||||
picker = parse_element_unit(*argv);
|
||||
|
||||
/* Set the changer picker. */
|
||||
if (ioctl(changer_fd, CHIOSPICKER, &picker))
|
||||
if (ioctl(changer_fd, CHIOSPICKER, (char *)&picker))
|
||||
err(1, "%s: CHIOSPICKER", changer_name);
|
||||
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
(void) fprintf(stderr, "usage: %s %s <picker>\n", __progname, cname);
|
||||
fprintf(stderr, "usage: %s %s <picker>\n", __progname, cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -510,67 +466,23 @@ do_status(cname, argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
struct changer_params cp;
|
||||
struct changer_element_status_request cesr;
|
||||
int i, count, base, chet, schet, echet;
|
||||
char *description;
|
||||
int pvoltag = 0;
|
||||
int avoltag = 0;
|
||||
int sense = 0;
|
||||
int scsi = 0;
|
||||
int source = 0;
|
||||
int intaddr = 0;
|
||||
int c;
|
||||
|
||||
count = 0;
|
||||
base = 0;
|
||||
description = NULL;
|
||||
|
||||
optind = optreset = 1;
|
||||
while ((c = getopt(argc, argv, "vVsSbaI")) != -1) {
|
||||
switch (c) {
|
||||
case 'v':
|
||||
pvoltag = 1;
|
||||
break;
|
||||
case 'V':
|
||||
avoltag = 1;
|
||||
break;
|
||||
case 's':
|
||||
sense = 1;
|
||||
break;
|
||||
case 'S':
|
||||
source = 1;
|
||||
break;
|
||||
case 'b':
|
||||
scsi = 1;
|
||||
break;
|
||||
case 'I':
|
||||
intaddr = 1;
|
||||
break;
|
||||
case 'a':
|
||||
pvoltag = avoltag = source = sense = scsi = intaddr = 1;
|
||||
break;
|
||||
default:
|
||||
warnx("%s: bad option", cname);
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
struct changer_element_status cmd;
|
||||
struct changer_params data;
|
||||
u_int8_t *statusp;
|
||||
int i, count, chet, schet, echet;
|
||||
char *cmdname, *description;
|
||||
|
||||
/*
|
||||
* On a status command, we expect the following:
|
||||
*
|
||||
* [<ET> [<start> [<end>] ] ]
|
||||
* [<ET>]
|
||||
*
|
||||
* where ET == element type, start == first element to report,
|
||||
* end == number of elements to report
|
||||
* where ET == element type.
|
||||
*
|
||||
* If we get no arguments, we get the status of all
|
||||
* known element types.
|
||||
*/
|
||||
if (argc > 3) {
|
||||
if (argc > 1) {
|
||||
warnx("%s: too many arguments", cname);
|
||||
goto usage;
|
||||
}
|
||||
@@ -579,63 +491,38 @@ do_status(cname, argc, argv)
|
||||
* Get params from changer. Specifically, we need the element
|
||||
* counts.
|
||||
*/
|
||||
if (ioctl(changer_fd, CHIOGPARAMS, (char *)&cp))
|
||||
bzero(&data, sizeof(data));
|
||||
if (ioctl(changer_fd, CHIOGPARAMS, (char *)&data))
|
||||
err(1, "%s: CHIOGPARAMS", changer_name);
|
||||
|
||||
if (argc > 0)
|
||||
schet = echet = parse_element_type(argv[0]);
|
||||
if (argc)
|
||||
schet = echet = parse_element_type(*argv);
|
||||
else {
|
||||
schet = CHET_MT;
|
||||
echet = CHET_DT;
|
||||
}
|
||||
if (argc > 1) {
|
||||
base = atol(argv[1]);
|
||||
count = 1;
|
||||
}
|
||||
if (argc > 2)
|
||||
count = atol(argv[2]) - base + 1;
|
||||
|
||||
if (base < 0 || count < 0)
|
||||
errx(1, "bad arguments");
|
||||
|
||||
for (chet = schet; chet <= echet; ++chet) {
|
||||
switch (chet) {
|
||||
case CHET_MT:
|
||||
if (count == 0)
|
||||
count = cp.cp_npickers;
|
||||
else if (count > cp.cp_npickers)
|
||||
errx(1, "not that many pickers in device");
|
||||
count = data.cp_npickers;
|
||||
description = "picker";
|
||||
break;
|
||||
|
||||
case CHET_ST:
|
||||
if (count == 0)
|
||||
count = cp.cp_nslots;
|
||||
else if (count > cp.cp_nslots)
|
||||
errx(1, "not that many slots in device");
|
||||
count = data.cp_nslots;
|
||||
description = "slot";
|
||||
break;
|
||||
|
||||
case CHET_IE:
|
||||
if (count == 0)
|
||||
count = cp.cp_nportals;
|
||||
else if (count > cp.cp_nportals)
|
||||
errx(1, "not that many portals in device");
|
||||
count = data.cp_nportals;
|
||||
description = "portal";
|
||||
break;
|
||||
|
||||
case CHET_DT:
|
||||
if (count == 0)
|
||||
count = cp.cp_ndrives;
|
||||
else if (count > cp.cp_ndrives)
|
||||
errx(1, "not that many drives in device");
|
||||
count = data.cp_ndrives;
|
||||
description = "drive";
|
||||
break;
|
||||
|
||||
default:
|
||||
/* To appease gcc -Wuninitialized. */
|
||||
count = 0;
|
||||
description = NULL;
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
@@ -648,198 +535,38 @@ do_status(cname, argc, argv)
|
||||
}
|
||||
}
|
||||
|
||||
bzero(&cesr, sizeof(cesr));
|
||||
cesr.cesr_element_type = chet;
|
||||
cesr.cesr_element_base = base;
|
||||
cesr.cesr_element_count = count;
|
||||
/* Allocate storage for the status structures. */
|
||||
cesr.cesr_element_status
|
||||
= (struct changer_element_status *)
|
||||
malloc(count * sizeof(struct changer_element_status));
|
||||
|
||||
if (!cesr.cesr_element_status)
|
||||
/* Allocate storage for the status bytes. */
|
||||
if ((statusp = (u_int8_t *)malloc(count)) == NULL)
|
||||
errx(1, "can't allocate status storage");
|
||||
|
||||
if (avoltag || pvoltag)
|
||||
cesr.cesr_flags |= CESR_VOLTAGS;
|
||||
bzero(statusp, count);
|
||||
bzero(&cmd, sizeof(cmd));
|
||||
|
||||
if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr)) {
|
||||
free(cesr.cesr_element_status);
|
||||
cmd.ces_type = chet;
|
||||
cmd.ces_data = statusp;
|
||||
|
||||
if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cmd)) {
|
||||
free(statusp);
|
||||
err(1, "%s: CHIOGSTATUS", changer_name);
|
||||
}
|
||||
|
||||
/* Dump the status for each reported element. */
|
||||
/* Dump the status for each element of this type. */
|
||||
for (i = 0; i < count; ++i) {
|
||||
struct changer_element_status *ces =
|
||||
&(cesr.cesr_element_status[i]);
|
||||
printf("%s %d: %s", description, ces->ces_addr,
|
||||
bits_to_string(ces->ces_flags,
|
||||
CESTATUS_BITS));
|
||||
if (sense)
|
||||
printf(" sense: <0x%02x/0x%02x>",
|
||||
ces->ces_sensecode,
|
||||
ces->ces_sensequal);
|
||||
if (pvoltag)
|
||||
printf(" voltag: <%s:%d>",
|
||||
ces->ces_pvoltag.cv_volid,
|
||||
ces->ces_pvoltag.cv_serial);
|
||||
if (avoltag)
|
||||
printf(" avoltag: <%s:%d>",
|
||||
ces->ces_avoltag.cv_volid,
|
||||
ces->ces_avoltag.cv_serial);
|
||||
if (source) {
|
||||
if (ces->ces_flags & CES_SOURCE_VALID)
|
||||
printf(" source: <%s %d>",
|
||||
element_type_name(
|
||||
ces->ces_source_type),
|
||||
ces->ces_source_addr);
|
||||
else
|
||||
printf(" source: <>");
|
||||
}
|
||||
if (intaddr)
|
||||
printf(" intaddr: <%d>", ces->ces_int_addr);
|
||||
if (scsi) {
|
||||
printf(" scsi: <");
|
||||
if (ces->ces_flags & CES_SCSIID_VALID)
|
||||
printf("%d", ces->ces_scsi_id);
|
||||
else
|
||||
putchar('?');
|
||||
putchar(':');
|
||||
if (ces->ces_flags & CES_LUN_VALID)
|
||||
printf("%d", ces->ces_scsi_lun);
|
||||
else
|
||||
putchar('?');
|
||||
putchar('>');
|
||||
}
|
||||
putchar('\n');
|
||||
printf("%s %d: %s\n", description, i,
|
||||
bits_to_string(statusp[i], CESTATUS_BITS));
|
||||
}
|
||||
|
||||
free(cesr.cesr_element_status);
|
||||
count = 0;
|
||||
free(statusp);
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
(void) fprintf(stderr, "usage: %s %s [-vVsSbaA] [<element type> [<start-addr> [<end-addr>] ] ]\n",
|
||||
__progname, cname);
|
||||
fprintf(stderr, "usage: %s %s [<element type>]\n", __progname,
|
||||
cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
static int
|
||||
do_ielem(cname, argc, argv)
|
||||
char *cname;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int timeout = 0;
|
||||
|
||||
if (argc == 2) {
|
||||
timeout = atol(argv[1]);
|
||||
} else if (argc > 1) {
|
||||
warnx("%s: too many arguments", cname);
|
||||
goto usage;
|
||||
}
|
||||
|
||||
if (ioctl(changer_fd, CHIOIELEM, &timeout))
|
||||
err(1, "%s: CHIOIELEM", changer_name);
|
||||
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
(void) fprintf(stderr, "usage: %s %s [<timeout>]\n",
|
||||
__progname, cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
static int
|
||||
do_voltag(cname, argc, argv)
|
||||
char *cname;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int force = 0;
|
||||
int clear = 0;
|
||||
int alternate = 0;
|
||||
int c;
|
||||
struct changer_set_voltag_request csvr;
|
||||
|
||||
bzero(&csvr, sizeof(csvr));
|
||||
|
||||
optind = optreset = 1;
|
||||
while ((c = getopt(argc, argv, "fca")) != -1) {
|
||||
switch (c) {
|
||||
case 'f':
|
||||
force = 1;
|
||||
break;
|
||||
case 'c':
|
||||
clear = 1;
|
||||
break;
|
||||
case 'a':
|
||||
alternate = 1;
|
||||
break;
|
||||
default:
|
||||
warnx("%s: bad option", cname);
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc < 2) {
|
||||
warnx("%s: missing element specification", cname);
|
||||
goto usage;
|
||||
}
|
||||
|
||||
csvr.csvr_type = parse_element_type(argv[0]);
|
||||
csvr.csvr_addr = atol(argv[1]);
|
||||
|
||||
if (!clear) {
|
||||
if (argc < 3 || argc > 4) {
|
||||
warnx("%s: missing argument", cname);
|
||||
goto usage;
|
||||
}
|
||||
|
||||
if (force)
|
||||
csvr.csvr_flags = CSVR_MODE_REPLACE;
|
||||
else
|
||||
csvr.csvr_flags = CSVR_MODE_SET;
|
||||
|
||||
if (strlen(argv[2]) > sizeof(csvr.csvr_voltag.cv_volid)) {
|
||||
warnx("%s: volume label too long", cname);
|
||||
goto usage;
|
||||
}
|
||||
|
||||
strncpy(csvr.csvr_voltag.cv_volid, argv[2],
|
||||
sizeof(csvr.csvr_voltag.cv_volid));
|
||||
|
||||
if (argc == 4) {
|
||||
csvr.csvr_voltag.cv_serial = atol(argv[3]);
|
||||
}
|
||||
} else {
|
||||
if (argc != 2) {
|
||||
warnx("%s: unexpected argument", cname);
|
||||
goto usage;
|
||||
}
|
||||
csvr.csvr_flags = CSVR_MODE_CLEAR;
|
||||
}
|
||||
|
||||
if (alternate) {
|
||||
csvr.csvr_flags |= CSVR_ALTERNATE;
|
||||
}
|
||||
|
||||
if (ioctl(changer_fd, CHIOSETVOLTAG, &csvr))
|
||||
err(1, "%s: CHIOSETVOLTAG", changer_name);
|
||||
|
||||
return 0;
|
||||
usage:
|
||||
(void) fprintf(stderr,
|
||||
"usage: %s %s [-fca] <element> [<voltag> [<vsn>] ]\n",
|
||||
__progname, cname);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
parse_element_type(cp)
|
||||
char *cp;
|
||||
@@ -851,20 +578,6 @@ parse_element_type(cp)
|
||||
return (elements[i].et_type);
|
||||
|
||||
errx(1, "invalid element type `%s'", cp);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
static const char *
|
||||
element_type_name(et)
|
||||
int et;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; elements[i].et_name != NULL; i++)
|
||||
if (elements[i].et_type == et)
|
||||
return elements[i].et_name;
|
||||
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -892,7 +605,6 @@ parse_special(cp)
|
||||
return (val);
|
||||
|
||||
errx(1, "invalid modifier `%s'", cp);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -908,7 +620,7 @@ is_special(cp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static const char *
|
||||
static char *
|
||||
bits_to_string(v, cp)
|
||||
int v;
|
||||
const char *cp;
|
||||
@@ -918,16 +630,14 @@ bits_to_string(v, cp)
|
||||
static char buf[128];
|
||||
|
||||
bp = buf;
|
||||
(void) memset(buf, 0, sizeof(buf));
|
||||
bzero(buf, sizeof(buf));
|
||||
|
||||
for (sep = '<'; (f = *cp++) != 0; cp = np) {
|
||||
for (np = cp; *np >= ' ';)
|
||||
np++;
|
||||
if ((v & (1 << (f - 1))) == 0)
|
||||
continue;
|
||||
(void) snprintf(bp, sizeof(buf) - (bp - &buf[0]),
|
||||
"%c%.*s", sep, (int)(long)(np - cp), cp);
|
||||
bp += strlen(bp);
|
||||
bp += sprintf(bp, "%c%.*s", sep, np - cp, cp);
|
||||
sep = ',';
|
||||
}
|
||||
if (sep != '<')
|
||||
@@ -939,6 +649,7 @@ bits_to_string(v, cp)
|
||||
static void
|
||||
cleanup()
|
||||
{
|
||||
|
||||
/* Simple enough... */
|
||||
(void)close(changer_fd);
|
||||
}
|
||||
@@ -946,7 +657,7 @@ cleanup()
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
(void) fprintf(stderr, "usage: %s [-f changer] command [-<flags>] "
|
||||
"arg1 arg2 [arg3 [...]]\n", __progname);
|
||||
|
||||
fprintf(stderr, "usage: %s command arg1 arg2 ...\n", __progname);
|
||||
exit(1);
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $Id: defs.h,v 1.1.1.1 1997/03/06 15:30:06 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Jason R. Thorpe <[email protected]>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $Id: pathnames.h,v 1.1.1.1 1997/03/06 15:30:06 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Jason R. Thorpe <[email protected]>
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile,v 1.2 1994/09/24 02:53:36 davidg Exp $
|
||||
|
||||
PROG= chmod
|
||||
|
||||
|
||||
+22
-58
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)chmod.1 8.4 (Berkeley) 3/31/94
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: chmod.1,v 1.4.2.1 1997/02/28 07:54:25 mpp Exp $
|
||||
.\"
|
||||
.Dd March 31, 1994
|
||||
.Dt CHMOD 1
|
||||
@@ -44,7 +44,6 @@
|
||||
.Sh SYNOPSIS
|
||||
.Nm chmod
|
||||
.Oo
|
||||
.Fl f
|
||||
.Fl R
|
||||
.Op Fl H | Fl L | Fl P
|
||||
.Oc
|
||||
@@ -52,7 +51,7 @@
|
||||
.Ar file ...
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm chmod
|
||||
utility modifies the file mode bits of the listed files
|
||||
as specified by the
|
||||
.Ar mode
|
||||
@@ -76,11 +75,6 @@ option is specified, no symbolic links are followed.
|
||||
.It Fl R
|
||||
Change the modes of the file hierarchies rooted in the files
|
||||
instead of just the files themselves.
|
||||
.It Fl f
|
||||
Do not display a diagnostic message if
|
||||
.Nm
|
||||
could not modify the mode for
|
||||
.Va file .
|
||||
.El
|
||||
.Pp
|
||||
Symbolic links do not have modes, so unless the
|
||||
@@ -88,7 +82,7 @@ Symbolic links do not have modes, so unless the
|
||||
or
|
||||
.Fl L
|
||||
option is set,
|
||||
.Nm
|
||||
.Nm chmod
|
||||
on a symbolic link always succeeds and has no effect.
|
||||
The
|
||||
.Fl H ,
|
||||
@@ -103,65 +97,37 @@ command's actions are determined by the last one specified.
|
||||
.Pp
|
||||
Only the owner of a file or the super-user is permitted to change
|
||||
the mode of a file.
|
||||
.Sh DIAGNOSTICS
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm chmod
|
||||
utility exits 0 on success, and >0 if an error occurs.
|
||||
.Sh MODES
|
||||
Modes may be absolute or symbolic.
|
||||
An absolute mode is an octal number constructed from the sum of
|
||||
one or more of the following values:
|
||||
An absolute mode is an octal number constructed by
|
||||
.Ar or-ing
|
||||
the following values:
|
||||
.Pp
|
||||
.Bl -tag -width 6n -compact -offset indent
|
||||
.It Li 4000
|
||||
(the set-user-ID-on-execution bit) Executable files with this bit set
|
||||
will run with effective uid set to the uid of the file owner.
|
||||
Directories with the set-user-id bit set will force all files and
|
||||
sub-directories created in them to be owned by the directory owner
|
||||
and not by the uid of the creating process, if the underlying file
|
||||
system supports this feature: see
|
||||
.Xr chmod 2
|
||||
and the
|
||||
.Ar suiddir
|
||||
option to
|
||||
.Xr mount 8 .
|
||||
set-user-ID-on-execution
|
||||
.It Li 2000
|
||||
(the set-group-ID-on-execution bit) Executable files with this bit set
|
||||
will run with effective gid set to the gid of the file owner.
|
||||
set-group-ID-on-execution
|
||||
.It Li 1000
|
||||
(the sticky bit)
|
||||
When set on a directory, unprivileged users can delete and rename
|
||||
only those files in the directory that are owned by them, regardless of
|
||||
the permissions on the directory. Under FreeBSD, the sticky bit is
|
||||
ignored for executable files and may only be set for directories (see
|
||||
.Xr sticky 8 ).
|
||||
sticky bit, see chmod(2)
|
||||
.It Li 0400
|
||||
Allow read by owner.
|
||||
read by owner
|
||||
.It Li 0200
|
||||
Allow write by owner.
|
||||
write by owner
|
||||
.It Li 0100
|
||||
For files, allow execution by owner. For directories, allow the owner to
|
||||
search in the directory.
|
||||
.It Li 0040
|
||||
Allow read by group members.
|
||||
.It Li 0020
|
||||
Allow write by group members.
|
||||
.It Li 0010
|
||||
For files, allow execution by group members. For directories, allow
|
||||
group members to search in the directory.
|
||||
.It Li 0004
|
||||
Allow read by others.
|
||||
.It Li 0002
|
||||
Allow write by others.
|
||||
.It Li 0001
|
||||
For files, allow execution by others. For directories allow others to
|
||||
search in the directory.
|
||||
execute (or search for directories) by owner
|
||||
.It Li 0070
|
||||
read, write, execute/search by group
|
||||
.It Li 0007
|
||||
read, write, execute/search by others
|
||||
.El
|
||||
.Pp
|
||||
For example, the absolute mode that permits read, write and execute by
|
||||
the owner, read and execute by group members, read and execute by
|
||||
others, and no set-uid or set-gid behaviour is 755
|
||||
(400+200+100+040+010+004+001).
|
||||
The read, write, and execute/search values for group and others
|
||||
are encoded as described for owner.
|
||||
.Pp
|
||||
The symbolic mode is described by the following grammar:
|
||||
.Bd -literal -offset indent
|
||||
@@ -316,12 +282,10 @@ option for the naughty bits.
|
||||
.Xr fts 3 ,
|
||||
.Xr setmode 3 ,
|
||||
.Xr symlink 7 ,
|
||||
.Xr chown 8 ,
|
||||
.Xr mount 8 ,
|
||||
.Xr sticky 8
|
||||
.Xr chown 8
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm chmod
|
||||
utility is expected to be
|
||||
.St -p1003.2
|
||||
compatible with the exception of the
|
||||
|
||||
+6
-9
@@ -29,20 +29,18 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: chmod.c,v 1.5 1996/08/10 15:05:26 adam Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char const copyright[] =
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1989, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)chmod.c 8.8 (Berkeley) 4/1/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -75,7 +73,7 @@ main(argc, argv)
|
||||
set = NULL;
|
||||
omode = 0;
|
||||
Hflag = Lflag = Pflag = Rflag = fflag = hflag = 0;
|
||||
while ((ch = getopt(argc, argv, "HLPRXfgorstuwx")) != -1)
|
||||
while ((ch = getopt(argc, argv, "HLPRXfgorstuwx")) != EOF)
|
||||
switch (ch) {
|
||||
case 'H':
|
||||
Hflag = 1;
|
||||
@@ -92,7 +90,7 @@ main(argc, argv)
|
||||
case 'R':
|
||||
Rflag = 1;
|
||||
break;
|
||||
case 'f':
|
||||
case 'f': /* XXX: undocumented. */
|
||||
fflag = 1;
|
||||
break;
|
||||
case 'h':
|
||||
@@ -195,7 +193,6 @@ done: argv += optind;
|
||||
}
|
||||
if (errno)
|
||||
err(1, "fts_read");
|
||||
free(set);
|
||||
exit(rval);
|
||||
}
|
||||
|
||||
@@ -203,6 +200,6 @@ void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
"usage: chmod [-f -R [-H | -L | -P]] mode file ...\n");
|
||||
"usage: chmod [-R [-H | -L | -P]] mode file ...\n");
|
||||
exit(1);
|
||||
}
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile,v 1.2 1994/09/24 02:53:39 davidg Exp $
|
||||
|
||||
PROG= cp
|
||||
SRCS= cp.c utils.c
|
||||
CFLAGS+= -DVM_AND_BUFFER_CACHE_SYNCHRONIZED
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+19
-30
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: cp.1,v 1.6.2.1 1997/02/28 07:54:27 mpp Exp $
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt CP 1
|
||||
@@ -48,7 +48,7 @@
|
||||
.Op Fl H | Fl L | Fl P
|
||||
.Oc
|
||||
.Op Fl f | i
|
||||
.Op Fl pv
|
||||
.Op Fl p
|
||||
.Ar source_file target_file
|
||||
.Nm cp
|
||||
.Oo
|
||||
@@ -56,11 +56,11 @@
|
||||
.Op Fl H | Fl L | Fl P
|
||||
.Oc
|
||||
.Op Fl f | i
|
||||
.Op Fl pv
|
||||
.Op Fl p
|
||||
.Ar source_file ... target_directory
|
||||
.Sh DESCRIPTION
|
||||
In the first synopsis form, the
|
||||
.Nm
|
||||
.Nm cp
|
||||
utility copies the contents of the
|
||||
.Ar source_file
|
||||
to the
|
||||
@@ -72,7 +72,7 @@ is copied to the destination
|
||||
.Ar target_directory .
|
||||
The names of the files themselves are not changed.
|
||||
If
|
||||
.Nm
|
||||
.Nm cp
|
||||
detects an attempt to copy a file to itself, the copy will fail.
|
||||
.Pp
|
||||
The following options are available:
|
||||
@@ -94,11 +94,11 @@ option is specified, no symbolic links are followed.
|
||||
If
|
||||
.Ar source_file
|
||||
designates a directory,
|
||||
.Nm
|
||||
.Nm cp
|
||||
copies the directory and the entire subtree connected at that point.
|
||||
This option also causes symbolic links to be copied, rather than
|
||||
indirected through, and for
|
||||
.Nm
|
||||
.Nm cp
|
||||
to create special files rather than copying them as normal files.
|
||||
Created directories have the same mode as the corresponding source
|
||||
directory, unmodified by the process' umask.
|
||||
@@ -112,8 +112,8 @@ option overrides any previous
|
||||
.Fl i
|
||||
options.)
|
||||
.It Fl i
|
||||
Cause
|
||||
.Nm
|
||||
Causes
|
||||
.Nm cp
|
||||
to write a prompt to the standard error output before copying a file
|
||||
that would overwrite an existing file.
|
||||
If the response from the standard input begins with the character
|
||||
@@ -127,8 +127,8 @@ option overrides any previous
|
||||
.Fl f
|
||||
options.)
|
||||
.It Fl p
|
||||
Cause
|
||||
.Nm
|
||||
Causes
|
||||
.Nm cp
|
||||
to preserve in the copy as many of the modification time, access time,
|
||||
file flags, file mode, user ID, and group ID as allowed by permissions.
|
||||
.Pp
|
||||
@@ -143,19 +143,13 @@ be preserved, the set group ID bit is not preserved
|
||||
in the copy's permissions.
|
||||
If the source file has both its set user ID and set group ID bits on,
|
||||
and either the user ID or group ID cannot be preserved, neither
|
||||
the set user ID nor set group ID bits are preserved in the copy's
|
||||
the set user ID or set group ID bits are preserved in the copy's
|
||||
permissions.
|
||||
.It Fl v
|
||||
Cause
|
||||
.Nm
|
||||
to be verbose, showing files as they are copied.
|
||||
.El
|
||||
.Pp
|
||||
For each destination file that already exists, its contents are
|
||||
overwritten if permissions allow. Its mode, user ID, and group
|
||||
ID are unchanged unless the
|
||||
.Fl p
|
||||
option was specified.
|
||||
overwritten if permissions allow, but its mode, user ID, and group
|
||||
ID are unchanged.
|
||||
.Pp
|
||||
In the second synopsis form,
|
||||
.Ar target_directory
|
||||
@@ -201,23 +195,18 @@ options are ignored unless the
|
||||
option is specified.
|
||||
In addition, these options override each other and the
|
||||
command's actions are determined by the last one specified.
|
||||
.Sh DIAGNOSTICS
|
||||
The
|
||||
.Nm
|
||||
utility exits 0 on success, and >0 if an error occurs.
|
||||
.Pp
|
||||
.Nm Cp
|
||||
exits 0 on success, >0 if an error occurred.
|
||||
.Sh COMPATIBILITY
|
||||
Historic versions of the
|
||||
.Nm
|
||||
.Nm cp
|
||||
utility had a
|
||||
.Fl r
|
||||
option.
|
||||
This implementation supports that option, however, its use is strongly
|
||||
discouraged, as it does not correctly copy special files, symbolic links
|
||||
or fifo's.
|
||||
.Pp
|
||||
The
|
||||
.Fl v
|
||||
option is non-standard and its use in scripts is not recommended.
|
||||
.Sh SEE ALSO
|
||||
.Xr mv 1 ,
|
||||
.Xr rcp 1 ,
|
||||
@@ -226,7 +215,7 @@ option is non-standard and its use in scripts is not recommended.
|
||||
.Xr symlink 7
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm cp
|
||||
command is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
|
||||
+28
-39
@@ -32,20 +32,18 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cp.c,v 1.10 1996/03/08 06:58:06 wosch Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char const copyright[] =
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1988, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@@ -53,7 +51,7 @@ static const char rcsid[] =
|
||||
*
|
||||
* The global PATH_T structure "to" always contains the path to the
|
||||
* current target file. Since fts(3) does not change directories,
|
||||
* this path can be either absolute or dot-relative.
|
||||
* this path can be either absolute or dot-realative.
|
||||
*
|
||||
* The basic algorithm is to initialize "to" and use fts(3) to traverse
|
||||
* the file hierarchy rooted in the argument list. A trivial case is the
|
||||
@@ -65,11 +63,16 @@ static const char rcsid[] =
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <dirent.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <fts.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -80,10 +83,10 @@ static const char rcsid[] =
|
||||
*--(p).p_end = 0; \
|
||||
}
|
||||
|
||||
PATH_T to = { to.p_path, "", "" };
|
||||
PATH_T to = { to.p_path, "" };
|
||||
|
||||
uid_t myuid;
|
||||
int Rflag, iflag, pflag, rflag, fflag, vflag;
|
||||
int Rflag, iflag, pflag, rflag, fflag;
|
||||
int myumask;
|
||||
|
||||
enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
|
||||
@@ -102,7 +105,7 @@ main(argc, argv)
|
||||
char *target;
|
||||
|
||||
Hflag = Lflag = Pflag = 0;
|
||||
while ((ch = getopt(argc, argv, "HLPRfiprv")) != -1)
|
||||
while ((ch = getopt(argc, argv, "HLPRfipr")) != EOF)
|
||||
switch (ch) {
|
||||
case 'H':
|
||||
Hflag = 1;
|
||||
@@ -133,9 +136,6 @@ main(argc, argv)
|
||||
case 'r':
|
||||
rflag = 1;
|
||||
break;
|
||||
case 'v':
|
||||
vflag = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
@@ -253,23 +253,22 @@ copy(argv, type, fts_options)
|
||||
struct stat to_stat;
|
||||
FTS *ftsp;
|
||||
FTSENT *curr;
|
||||
int base = 0, dne, badcp, nlen, rval;
|
||||
int base, dne, nlen, rval;
|
||||
char *p, *target_mid;
|
||||
|
||||
if ((ftsp = fts_open(argv, fts_options, mastercmp)) == NULL)
|
||||
err(1, NULL);
|
||||
for (badcp = rval = 0; (curr = fts_read(ftsp)) != NULL; badcp = 0) {
|
||||
for (rval = 0; (curr = fts_read(ftsp)) != NULL;) {
|
||||
switch (curr->fts_info) {
|
||||
case FTS_NS:
|
||||
case FTS_DNR:
|
||||
case FTS_ERR:
|
||||
warnx("%s: %s",
|
||||
curr->fts_path, strerror(curr->fts_errno));
|
||||
badcp = rval = 1;
|
||||
rval = 1;
|
||||
continue;
|
||||
case FTS_DC: /* Warn, continue. */
|
||||
warnx("%s: directory causes a cycle", curr->fts_path);
|
||||
badcp = rval = 1;
|
||||
rval = 1;
|
||||
continue;
|
||||
case FTS_DP: /* Ignore, continue. */
|
||||
continue;
|
||||
@@ -290,7 +289,7 @@ copy(argv, type, fts_options)
|
||||
* is the case where the target exists.
|
||||
*
|
||||
* Also, check for "..". This is for correct path
|
||||
* concatenation for paths ending in "..", e.g.
|
||||
* concatentation for paths ending in "..", e.g.
|
||||
* cp -R .. /tmp
|
||||
* Paths ending in ".." are changed to ".". This is
|
||||
* tricky, but seems the easiest way to fix the problem.
|
||||
@@ -299,7 +298,7 @@ copy(argv, type, fts_options)
|
||||
* Since the first level MUST be FTS_ROOTLEVEL, base
|
||||
* is always initialized.
|
||||
*/
|
||||
if (curr->fts_level == FTS_ROOTLEVEL) {
|
||||
if (curr->fts_level == FTS_ROOTLEVEL)
|
||||
if (type != DIR_TO_DNE) {
|
||||
p = strrchr(curr->fts_path, '/');
|
||||
base = (p == NULL) ? 0 :
|
||||
@@ -310,7 +309,6 @@ copy(argv, type, fts_options)
|
||||
base += 1;
|
||||
} else
|
||||
base = curr->fts_pathlen;
|
||||
}
|
||||
|
||||
p = &curr->fts_path[base];
|
||||
nlen = curr->fts_pathlen - base;
|
||||
@@ -321,7 +319,7 @@ copy(argv, type, fts_options)
|
||||
if (target_mid - to.p_path + nlen > MAXPATHLEN) {
|
||||
warnx("%s%s: name too long (not copied)",
|
||||
to.p_path, p);
|
||||
badcp = rval = 1;
|
||||
rval = 1;
|
||||
continue;
|
||||
}
|
||||
(void)strncat(target_mid, p, nlen);
|
||||
@@ -338,32 +336,25 @@ copy(argv, type, fts_options)
|
||||
to_stat.st_ino == curr->fts_statp->st_ino) {
|
||||
warnx("%s and %s are identical (not copied).",
|
||||
to.p_path, curr->fts_path);
|
||||
badcp = rval = 1;
|
||||
rval = 1;
|
||||
if (S_ISDIR(curr->fts_statp->st_mode))
|
||||
(void)fts_set(ftsp, curr, FTS_SKIP);
|
||||
continue;
|
||||
}
|
||||
if (!S_ISDIR(curr->fts_statp->st_mode) &&
|
||||
S_ISDIR(to_stat.st_mode)) {
|
||||
warnx("cannot overwrite directory %s with non-directory %s",
|
||||
to.p_path, curr->fts_path);
|
||||
badcp = rval = 1;
|
||||
continue;
|
||||
}
|
||||
dne = 0;
|
||||
}
|
||||
|
||||
switch (curr->fts_statp->st_mode & S_IFMT) {
|
||||
case S_IFLNK:
|
||||
if (copy_link(curr, !dne))
|
||||
badcp = rval = 1;
|
||||
rval = 1;
|
||||
break;
|
||||
case S_IFDIR:
|
||||
if (!Rflag && !rflag) {
|
||||
warnx("%s is a directory (not copied).",
|
||||
curr->fts_path);
|
||||
(void)fts_set(ftsp, curr, FTS_SKIP);
|
||||
badcp = rval = 1;
|
||||
rval = 1;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
@@ -389,7 +380,7 @@ copy(argv, type, fts_options)
|
||||
* forever.
|
||||
*/
|
||||
if (pflag && setfile(curr->fts_statp, 0))
|
||||
badcp = rval = 1;
|
||||
rval = 1;
|
||||
else if (dne)
|
||||
(void)chmod(to.p_path,
|
||||
curr->fts_statp->st_mode);
|
||||
@@ -398,28 +389,26 @@ copy(argv, type, fts_options)
|
||||
case S_IFCHR:
|
||||
if (Rflag) {
|
||||
if (copy_special(curr->fts_statp, !dne))
|
||||
badcp = rval = 1;
|
||||
rval = 1;
|
||||
} else {
|
||||
if (copy_file(curr, dne))
|
||||
badcp = rval = 1;
|
||||
rval = 1;
|
||||
}
|
||||
break;
|
||||
case S_IFIFO:
|
||||
if (Rflag) {
|
||||
if (copy_fifo(curr->fts_statp, !dne))
|
||||
badcp = rval = 1;
|
||||
rval = 1;
|
||||
} else {
|
||||
if (copy_file(curr, dne))
|
||||
badcp = rval = 1;
|
||||
rval = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (copy_file(curr, dne))
|
||||
badcp = rval = 1;
|
||||
rval = 1;
|
||||
break;
|
||||
}
|
||||
if (vflag && !badcp)
|
||||
(void)printf("%s -> %s\n", curr->fts_path, to.p_path);
|
||||
}
|
||||
if (errno)
|
||||
err(1, "fts_read");
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)extern.h 8.2 (Berkeley) 4/1/94
|
||||
* $FreeBSD$
|
||||
* $Id: extern.h,v 1.5 1996/03/08 06:58:07 wosch Exp $
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
|
||||
+32
-65
@@ -29,28 +29,26 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: utils.c,v 1.9 1996/03/08 06:58:08 wosch Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <fts.h>
|
||||
#include <stdio.h>
|
||||
#include <sysexits.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "extern.h"
|
||||
@@ -62,8 +60,7 @@ copy_file(entp, dne)
|
||||
{
|
||||
static char buf[MAXBSIZE];
|
||||
struct stat to_stat, *fs;
|
||||
int ch, checkch, from_fd, rcount, rval, to_fd, wcount, wresid;
|
||||
char *bufp;
|
||||
int ch, checkch, from_fd, rcount, rval, to_fd, wcount;
|
||||
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
|
||||
char *p;
|
||||
#endif
|
||||
@@ -84,16 +81,13 @@ copy_file(entp, dne)
|
||||
* modified by the umask.)
|
||||
*/
|
||||
if (!dne) {
|
||||
#define YESNO "(y/n [n]) "
|
||||
if (iflag) {
|
||||
(void)fprintf(stderr, "overwrite %s? %s",
|
||||
to.p_path, YESNO);
|
||||
(void)fprintf(stderr, "overwrite %s? ", to.p_path);
|
||||
checkch = ch = getchar();
|
||||
while (ch != '\n' && ch != EOF)
|
||||
ch = getchar();
|
||||
if (checkch != 'y' && checkch != 'Y') {
|
||||
(void)close(from_fd);
|
||||
(void)fprintf(stderr, "not overwritten\n");
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
@@ -125,19 +119,13 @@ copy_file(entp, dne)
|
||||
* wins some CPU back.
|
||||
*/
|
||||
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
|
||||
if (S_ISREG(fs->st_mode) && fs->st_size <= 8 * 1048576) {
|
||||
if (fs->st_size <= 8 * 1048576) {
|
||||
if ((p = mmap(NULL, (size_t)fs->st_size, PROT_READ,
|
||||
MAP_SHARED, from_fd, (off_t)0)) == MAP_FAILED) {
|
||||
0, from_fd, (off_t)0)) == (char *)-1) {
|
||||
warn("%s", entp->fts_path);
|
||||
rval = 1;
|
||||
} else {
|
||||
for (bufp = p, wresid = fs->st_size; ;
|
||||
bufp += wcount, wresid -= wcount) {
|
||||
wcount = write(to_fd, bufp, wresid);
|
||||
if (wcount >= wresid || wcount <= 0)
|
||||
break;
|
||||
}
|
||||
if (wcount != wresid) {
|
||||
if (write(to_fd, p, fs->st_size) != fs->st_size) {
|
||||
warn("%s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
@@ -151,13 +139,8 @@ copy_file(entp, dne)
|
||||
#endif
|
||||
{
|
||||
while ((rcount = read(from_fd, buf, MAXBSIZE)) > 0) {
|
||||
for (bufp = buf, wresid = rcount; ;
|
||||
bufp += wcount, wresid -= wcount) {
|
||||
wcount = write(to_fd, bufp, wresid);
|
||||
if (wcount >= wresid || wcount <= 0)
|
||||
break;
|
||||
}
|
||||
if (wcount != wresid) {
|
||||
wcount = write(to_fd, buf, rcount);
|
||||
if (rcount != wcount || wcount == -1) {
|
||||
warn("%s", to.p_path);
|
||||
rval = 1;
|
||||
break;
|
||||
@@ -172,7 +155,7 @@ copy_file(entp, dne)
|
||||
/*
|
||||
* Don't remove the target even after an error. The target might
|
||||
* not be a regular file, or its attributes might be important,
|
||||
* or its contents might be irreplaceable. It would only be safe
|
||||
* or its contents might be irreplacable. It would only be safe
|
||||
* to remove it if we created it and its length is 0.
|
||||
*/
|
||||
|
||||
@@ -184,7 +167,7 @@ copy_file(entp, dne)
|
||||
*/
|
||||
#define RETAINBITS \
|
||||
(S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
|
||||
else if (fs->st_mode & (S_ISUID | S_ISGID) && fs->st_uid == myuid) {
|
||||
else if (fs->st_mode & (S_ISUID | S_ISGID) && fs->st_uid == myuid)
|
||||
if (fstat(to_fd, &to_stat)) {
|
||||
warn("%s", to.p_path);
|
||||
rval = 1;
|
||||
@@ -193,7 +176,6 @@ copy_file(entp, dne)
|
||||
warn("%s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
}
|
||||
(void)close(from_fd);
|
||||
if (close(to_fd)) {
|
||||
warn("%s", to.p_path);
|
||||
@@ -210,7 +192,7 @@ copy_link(p, exists)
|
||||
int len;
|
||||
char link[MAXPATHLEN];
|
||||
|
||||
if ((len = readlink(p->fts_path, link, sizeof(link) - 1)) == -1) {
|
||||
if ((len = readlink(p->fts_path, link, sizeof(link))) == -1) {
|
||||
warn("readlink: %s", p->fts_path);
|
||||
return (1);
|
||||
}
|
||||
@@ -265,9 +247,7 @@ setfile(fs, fd)
|
||||
int fd;
|
||||
{
|
||||
static struct timeval tv[2];
|
||||
struct stat ts;
|
||||
int rval;
|
||||
int gotstat;
|
||||
|
||||
rval = 0;
|
||||
fs->st_mode &= S_ISUID | S_ISGID | S_ISVTX |
|
||||
@@ -279,51 +259,38 @@ setfile(fs, fd)
|
||||
warn("utimes: %s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
if (fd ? fstat(fd, &ts) : stat(to.p_path, &ts))
|
||||
gotstat = 0;
|
||||
else {
|
||||
gotstat = 1;
|
||||
ts.st_mode &= S_ISUID | S_ISGID | S_ISVTX |
|
||||
S_IRWXU | S_IRWXG | S_IRWXO;
|
||||
}
|
||||
/*
|
||||
* Changing the ownership probably won't succeed, unless we're root
|
||||
* or POSIX_CHOWN_RESTRICTED is not set. Set uid/gid before setting
|
||||
* the mode; current BSD behavior is to remove all setuid bits on
|
||||
* chown. If chown fails, lose setuid/setgid bits.
|
||||
*/
|
||||
if (!gotstat || fs->st_uid != ts.st_uid || fs->st_gid != ts.st_gid)
|
||||
if (fd ? fchown(fd, fs->st_uid, fs->st_gid) :
|
||||
chown(to.p_path, fs->st_uid, fs->st_gid)) {
|
||||
if (errno != EPERM) {
|
||||
warn("chown: %s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
fs->st_mode &= ~(S_ISUID | S_ISGID);
|
||||
}
|
||||
|
||||
if (!gotstat || fs->st_mode != ts.st_mode)
|
||||
if (fd ? fchmod(fd, fs->st_mode) : chmod(to.p_path, fs->st_mode)) {
|
||||
if (fd ? fchown(fd, fs->st_uid, fs->st_gid) :
|
||||
chown(to.p_path, fs->st_uid, fs->st_gid)) {
|
||||
if (errno != EPERM) {
|
||||
warn("chown: %s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
fs->st_mode &= ~(S_ISUID | S_ISGID);
|
||||
}
|
||||
if (fd ? fchmod(fd, fs->st_mode) : chmod(to.p_path, fs->st_mode)) {
|
||||
warn("chown: %s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
|
||||
if (!gotstat || fs->st_flags != ts.st_flags)
|
||||
if (fd ?
|
||||
fchflags(fd, fs->st_flags) : chflags(to.p_path, fs->st_flags)) {
|
||||
warn("chflags: %s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
|
||||
if (fd ?
|
||||
fchflags(fd, fs->st_flags) : chflags(to.p_path, fs->st_flags)) {
|
||||
warn("chflags: %s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
return (rval);
|
||||
}
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target",
|
||||
" cp [-R [-H | -L | -P]] [-f | -i] [-pv] src1 ... srcN directory");
|
||||
exit(EX_USAGE);
|
||||
"usage: cp [-R [-H | -L | -P]] [-f | -i] [-p] src target",
|
||||
" cp [-R [-H | -L | -P]] [-f | -i] [-p] src1 ... srcN directory");
|
||||
exit(1);
|
||||
}
|
||||
+19
-19
@@ -1,5 +1,5 @@
|
||||
# $FreeBSD$
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $Id: Makefile,v 1.5 1994/09/24 02:53:44 davidg Exp $
|
||||
#
|
||||
# C Shell with process control; VM/UNIX VAX Makefile
|
||||
# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
|
||||
@@ -11,31 +11,31 @@ DFLAGS=-DBUILTIN -DFILEC -DNLS -DSHORT_STRINGS
|
||||
CFLAGS+=-I${.CURDIR} -I. ${DFLAGS}
|
||||
SRCS= alloc.c char.c const.c csh.c dir.c dol.c err.c exec.c exp.c file.c \
|
||||
func.c glob.c hist.c init.c lex.c misc.c parse.c printf.c proc.c \
|
||||
sem.c set.c str.c time.c const.h errnum.h
|
||||
sem.c set.c str.c time.c const.h err.h
|
||||
.PATH: ${.CURDIR}/../../usr.bin/printf
|
||||
|
||||
MAN1= csh.1
|
||||
# MLINKS for Shell built in commands for which there are no userland
|
||||
# utilities of the same name are handled with the associated manpage,
|
||||
# builtin.1 in share/man/man1/.
|
||||
MLINKS= csh.1 limit.1 csh.1 alias.1 csh.1 bg.1 csh.1 dirs.1 csh.1 fg.1 \
|
||||
csh.1 foreach.1 csh.1 history.1 csh.1 jobs.1 csh.1 popd.1 \
|
||||
csh.1 pushd.1 csh.1 rehash.1 csh.1 repeat.1 csh.1 suspend.1 \
|
||||
csh.1 stop.1 csh.1 source.1
|
||||
CLEANFILES+=err.h const.h
|
||||
|
||||
CLEANFILES+=const.h errnum.h
|
||||
const.h: err.h
|
||||
|
||||
const.h: errnum.h
|
||||
|
||||
errnum.h: err.c
|
||||
@rm -f ${.TARGET}
|
||||
@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
|
||||
@echo '#ifndef _h_sh_error' >> ${.TARGET}
|
||||
@echo '#define _h_sh_error' >> ${.TARGET}
|
||||
egrep 'ERR_' ${.ALLSRC} | egrep '^#define' >> ${.TARGET}
|
||||
@echo '#endif /* _h_sh_error */' >> ${.TARGET}
|
||||
err.h: err.c
|
||||
@rm -f $@
|
||||
@echo '/* Do not edit this file, make creates it. */' > $@
|
||||
@echo '#ifndef _h_sh_err' >> $@
|
||||
@echo '#define _h_sh_err' >> $@
|
||||
egrep 'ERR_' ${.CURDIR}/$*.c | egrep '^#define' >> $@
|
||||
@echo '#endif /* _h_sh_err */' >> $@
|
||||
|
||||
const.h: const.c
|
||||
@rm -f ${.TARGET}
|
||||
@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
|
||||
${CC} -E ${CFLAGS} ${.ALLSRC} | egrep 'Char STR' | \
|
||||
@rm -f $@
|
||||
@echo '/* Do not edit this file, make creates it. */' > $@
|
||||
${CC} -E ${CFLAGS} ${.CURDIR}/$*.c | egrep 'Char STR' | \
|
||||
sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
|
||||
sort >> ${.TARGET}
|
||||
sort >> $@
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
@@ -1,5 +1,5 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 8/14/93
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile,v 1.2 1994/09/24 02:54:22 davidg Exp $
|
||||
|
||||
DIR= usd/04.csh
|
||||
SRCS= tabs csh.1 csh.2 csh.3 csh.4 csh.a csh.g
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)csh.1 8.1 (Berkeley) 6/8/93
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: csh.1,v 1.3 1996/10/05 22:25:45 wosch Exp $
|
||||
.\"
|
||||
.EH 'USD:4-%''An Introduction to the C shell'
|
||||
.OH 'An Introduction to the C shell''USD:4-%'
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)csh.2 8.1 (Berkeley) 6/8/93
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: csh.2,v 1.3 1996/10/05 22:25:46 wosch Exp $
|
||||
.\"
|
||||
.nr H1 1
|
||||
.NH
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)csh.3 8.1 (Berkeley) 6/8/93
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: csh.3,v 1.2 1994/09/24 02:54:26 davidg Exp $
|
||||
.\"
|
||||
.nr H1 2
|
||||
.NH
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)csh.4 8.1 (Berkeley) 6/8/93
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: csh.4,v 1.2 1994/09/24 02:54:27 davidg Exp $
|
||||
.\"
|
||||
.nr H1 3
|
||||
.NH
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)csh.a 8.1 (Berkeley) 6/8/93
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: csh.a,v 1.2 1994/09/24 02:54:28 davidg Exp $
|
||||
.\"
|
||||
.SH
|
||||
Appendix \- Special characters
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)csh.g 8.1 (Berkeley) 6/8/93
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: csh.g,v 1.2 1994/09/24 02:54:31 davidg Exp $
|
||||
.\"
|
||||
.SH
|
||||
Glossary
|
||||
|
||||
@@ -30,6 +30,6 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)tabs 8.1 (Berkeley) 6/8/93
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: tabs,v 1.2 1994/09/24 02:54:32 davidg Exp $
|
||||
.\"
|
||||
.ta 5n 10n 15n 20n 25n 30n 35n 40n 45n 50n 55n 60n 65n 70n 75n 80n
|
||||
+2
-5
@@ -29,15 +29,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: alloc.c,v 1.4 1995/05/30 00:06:28 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)alloc.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
+2
-5
@@ -29,15 +29,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: char.c,v 1.2 1994/09/24 02:53:46 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)char.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include "char.h"
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)char.h 8.1 (Berkeley) 5/31/93
|
||||
* $FreeBSD$
|
||||
* $Id: char.h,v 1.2 1994/09/24 02:53:47 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
+2
-5
@@ -29,15 +29,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: const.c,v 1.4 1995/10/23 23:08:24 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)const.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
||||
+88
-124
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)csh.1 8.2 (Berkeley) 1/21/94
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: csh.1,v 1.5.2.1 1997/02/28 07:54:29 mpp Exp $
|
||||
.\"
|
||||
.Dd January 21, 1994
|
||||
.Dt CSH 1
|
||||
@@ -46,18 +46,17 @@
|
||||
.Op Fl l
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm csh
|
||||
is a command language interpreter
|
||||
incorporating a history mechanism (see
|
||||
.Sx History Substitutions ) ,
|
||||
.Nm History Substitutions ) ,
|
||||
job control facilities (see
|
||||
.Sx Jobs ) ,
|
||||
.Nm Jobs ) ,
|
||||
interactive file name
|
||||
and user name completion (see
|
||||
.Sx File Name Completion ) ,
|
||||
and a C-like syntax.
|
||||
It is used both as an interactive login shell and
|
||||
a shell script command processor.
|
||||
.Nm File Name Completion ) ,
|
||||
and a C-like syntax. It is used both as an interactive
|
||||
login shell and a shell script command processor.
|
||||
.Ss Argument list processing
|
||||
If the first argument (argument 0) to the shell is
|
||||
.Ql Fl \& ,
|
||||
@@ -101,7 +100,7 @@ is the only flag specified).
|
||||
The shell loads
|
||||
.Pa .cshrc
|
||||
even if it does not belong to the effective user.
|
||||
.Xr Su 1
|
||||
.Xr su 1
|
||||
can pass
|
||||
.Fl m
|
||||
to the shell.
|
||||
@@ -117,16 +116,16 @@ A
|
||||
may be used to escape the newline at the end of this
|
||||
line and continue onto another line.
|
||||
.It Fl v
|
||||
Cause the
|
||||
Causes the
|
||||
.Ar verbose
|
||||
variable to be set, with the effect
|
||||
that command input is echoed after history substitution.
|
||||
.It Fl x
|
||||
Cause the
|
||||
Causes the
|
||||
.Ar echo
|
||||
variable to be set, so that commands are echoed immediately before execution.
|
||||
.It Fl V
|
||||
Cause the
|
||||
Causes the
|
||||
.Ar verbose
|
||||
variable to be set even before
|
||||
.Pa .cshrc
|
||||
@@ -158,7 +157,7 @@ Remaining arguments initialize the variable
|
||||
.Ar argv .
|
||||
.Pp
|
||||
An instance of
|
||||
.Nm
|
||||
.Nm csh
|
||||
begins by executing commands from the file
|
||||
.Pa /etc/csh.cshrc
|
||||
and,
|
||||
@@ -237,9 +236,8 @@ may be a component of a pipeline, etc.).
|
||||
It is also possible to separate pipelines with `\&|\&|' or `&&' showing,
|
||||
as in the C language,
|
||||
that the second is to be executed only if the first fails or succeeds
|
||||
respectively.
|
||||
See
|
||||
.Sx Expressions .
|
||||
respectively. (See
|
||||
.Em Expressions . )
|
||||
.Ss Jobs
|
||||
The shell associates a
|
||||
.Ar job
|
||||
@@ -258,7 +256,7 @@ showing that the job which was started asynchronously was job number
|
||||
1 and had one (top-level) process, whose process id was 1234.
|
||||
.Pp
|
||||
If you are running a job and wish to do something else you may hit the key
|
||||
.Em ^Z
|
||||
.Nm ^Z
|
||||
(control-Z) which sends a STOP signal to the current job.
|
||||
The shell will then normally show that the job has been `Stopped',
|
||||
and print another prompt. You can then manipulate the state of this job,
|
||||
@@ -273,11 +271,11 @@ the
|
||||
command
|
||||
.Ar fg .
|
||||
A
|
||||
.Em ^Z
|
||||
.Nm ^Z
|
||||
takes effect immediately and
|
||||
is like an interrupt in that pending output and unread input are discarded
|
||||
when it is typed. There is another special key
|
||||
.Em ^Y
|
||||
.Nm ^Y
|
||||
that does not generate a STOP signal until a program attempts to
|
||||
.Xr read 2
|
||||
it.
|
||||
@@ -319,15 +317,12 @@ The job control mechanism requires that the
|
||||
.Xr stty 1
|
||||
option
|
||||
.Ic new
|
||||
be set.
|
||||
It is an artifact from a
|
||||
be set. It is an artifact from a
|
||||
.Em new
|
||||
implementation
|
||||
of the
|
||||
tty driver that allows generation of interrupt characters from
|
||||
the keyboard to tell jobs to stop. See
|
||||
.Xr stty 1
|
||||
for details
|
||||
the keyboard to tell jobs to stop. See stty(1) for details
|
||||
on setting options in the new tty driver.
|
||||
.Ss Status reporting
|
||||
This shell learns immediately whenever a process changes state.
|
||||
@@ -358,7 +353,7 @@ the shell variable
|
||||
.Ar filec
|
||||
(see
|
||||
.Ic set ) ,
|
||||
.Nm
|
||||
.Nm csh
|
||||
will
|
||||
interactively complete file names and user names from unique
|
||||
prefixes, when they are input from the terminal followed by
|
||||
@@ -375,7 +370,7 @@ and the input is
|
||||
.Pp
|
||||
.Dl % vi ch<escape>
|
||||
.Pp
|
||||
.Nm
|
||||
.Nm csh
|
||||
will complete the prefix ``ch''
|
||||
to the only matching file name ``chaosnet'', changing the input
|
||||
line to
|
||||
@@ -386,7 +381,7 @@ However, given
|
||||
.Pp
|
||||
.Dl % vi D<escape>
|
||||
.Pp
|
||||
.Nm
|
||||
.Nm csh
|
||||
will only expand the input to
|
||||
.Pp
|
||||
.Dl % vi DSC.
|
||||
@@ -396,7 +391,7 @@ incomplete, since there are two file names matching the prefix ``D''.
|
||||
.Pp
|
||||
If a partial file name is followed by the end-of-file character
|
||||
(usually control-D), then, instead of completing the name,
|
||||
.Nm
|
||||
.Nm csh
|
||||
will list all file names matching the prefix. For example,
|
||||
the input
|
||||
.Pp
|
||||
@@ -460,7 +455,7 @@ in the previous command with little typing and a high degree of confidence.
|
||||
History substitutions begin with the character `!' and may begin
|
||||
.Ar anywhere
|
||||
in the input stream (with the proviso that they
|
||||
.Em "do not"
|
||||
.Nm "do not"
|
||||
nest.)
|
||||
This `!' may be preceded by a `\e' to prevent its special meaning; for
|
||||
convenience, an `!' is passed unchanged when it is followed by a blank,
|
||||
@@ -571,8 +566,8 @@ Repeat the previous substitution.
|
||||
Apply the change once on each word, prefixing the above, e.g., `g&'.
|
||||
.It a
|
||||
Apply the change as many times as possible on a single word, prefixing
|
||||
the above.
|
||||
It can be used together with `g' to apply a substitution globally.
|
||||
the above. It can be used together with `g' to apply a substitution
|
||||
globally.
|
||||
.It p
|
||||
Print the new command line but do not execute it.
|
||||
.It q
|
||||
@@ -636,7 +631,7 @@ Strings enclosed in `"' may be expanded as described below.
|
||||
.Pp
|
||||
In both cases the resulting text becomes (all or part of) a single word;
|
||||
only in one special case (see
|
||||
.Sx Command Substitution
|
||||
.Em Command Substitution
|
||||
below) does a `"' quoted string yield parts of more than one word;
|
||||
`\'' quoted strings never do.
|
||||
.Ss Alias substitution
|
||||
@@ -713,7 +708,7 @@ occurs, and within `\''s where it
|
||||
.Em never
|
||||
occurs.
|
||||
Strings quoted by `\*(ga' are interpreted later (see
|
||||
.Sx "Command substitution"
|
||||
.Nm "Command substitution"
|
||||
below) so `$' substitution does not occur there until later, if at all.
|
||||
A `$' is passed unchanged if followed by a blank, tab, or end-of-line.
|
||||
.Pp
|
||||
@@ -769,11 +764,11 @@ It is not an error for a range to be empty if the second argument is omitted
|
||||
or in range.
|
||||
.It $#name
|
||||
.It ${#name}
|
||||
Give the number of words in the variable.
|
||||
Gives the number of words in the variable.
|
||||
This is useful for later use in a
|
||||
`$argv[selector]'.
|
||||
.It $0
|
||||
Substitute the name of the file from which command input is being read.
|
||||
Substitutes the name of the file from which command input is being read.
|
||||
An error occurs if the name is not known.
|
||||
.It $number
|
||||
.It ${number}
|
||||
@@ -793,16 +788,16 @@ The following substitutions may not be modified with `:' modifiers.
|
||||
.Bl -tag -width Ds -compact -offset indent
|
||||
.It $?name
|
||||
.It ${?name}
|
||||
Substitute the string `1' if name is set, `0' if it is not.
|
||||
Substitutes the string `1' if name is set, `0' if it is not.
|
||||
.It $?0
|
||||
Substitute `1' if the current input filename is known, `0' if it is not.
|
||||
Substitutes `1' if the current input filename is known, `0' if it is not.
|
||||
.It \&$\&$\&
|
||||
Substitute the (decimal) process number of the (parent) shell.
|
||||
.It $!
|
||||
Substitute the (decimal) process number of the last background process
|
||||
started by this shell.
|
||||
.It $<
|
||||
Substitute a line from the standard
|
||||
Substitutes a line from the standard
|
||||
input, with no further interpretation.
|
||||
It can be used to read from the keyboard in a shell script.
|
||||
.El
|
||||
@@ -927,7 +922,7 @@ is expanded in the same way as `<' input filenames are.
|
||||
.It >>& name
|
||||
.It >>! name
|
||||
.It >>&! name
|
||||
Use file
|
||||
Uses file
|
||||
.Ar name
|
||||
as the standard output;
|
||||
like `>' but places output at the end of the file.
|
||||
@@ -966,11 +961,11 @@ Several of the builtin commands (to be described later)
|
||||
take expressions, in which the operators are similar to those of C, with
|
||||
the same precedence.
|
||||
These expressions appear in the
|
||||
.Em @ ,
|
||||
.Em exit ,
|
||||
.Em if ,
|
||||
.Nm @,
|
||||
.Ar exit ,
|
||||
.Ar if ,
|
||||
and
|
||||
.Em while
|
||||
.Ar while
|
||||
commands.
|
||||
The following operators are available:
|
||||
.Bd -ragged -offset indent
|
||||
@@ -1081,7 +1076,7 @@ or
|
||||
.Ar unalias .
|
||||
.Pp
|
||||
.It Ic alloc
|
||||
Show the amount of dynamic memory acquired, broken down into used and
|
||||
Shows the amount of dynamic memory acquired, broken down into used and
|
||||
free memory.
|
||||
With an argument shows the number of free and used blocks in each size
|
||||
category. The categories start at size 8 and double at each step.
|
||||
@@ -1090,11 +1085,11 @@ systems other than the VAX may use a different memory allocator.
|
||||
.Pp
|
||||
.It Ic bg
|
||||
.It Ic bg \&% Ns Ar job ...
|
||||
Put the current or specified jobs into the background, continuing them
|
||||
Puts the current or specified jobs into the background, continuing them
|
||||
if they were stopped.
|
||||
.Pp
|
||||
.It Ic break
|
||||
Cause execution to resume after the
|
||||
Causes execution to resume after the
|
||||
.Ic end
|
||||
of the nearest enclosing
|
||||
.Ic foreach
|
||||
@@ -1104,7 +1099,7 @@ The remaining commands on the current line are executed.
|
||||
Multi-level breaks are thus possible by writing them all on one line.
|
||||
.Pp
|
||||
.It Ic breaksw
|
||||
Cause a break from a
|
||||
Causes a break from a
|
||||
.Ic switch ,
|
||||
resuming after the
|
||||
.Ic endsw .
|
||||
@@ -1142,7 +1137,7 @@ or
|
||||
The rest of the commands on the current line are executed.
|
||||
.Pp
|
||||
.It Ic default :
|
||||
Label the default case in a
|
||||
Labels the default case in a
|
||||
.Ic switch
|
||||
statement.
|
||||
The default should come after all
|
||||
@@ -1150,7 +1145,7 @@ The default should come after all
|
||||
labels.
|
||||
.Pp
|
||||
.It Ic dirs
|
||||
Print the directory stack; the top of the stack is at the left,
|
||||
Prints the directory stack; the top of the stack is at the left,
|
||||
the first directory in the stack being the current directory.
|
||||
.Pp
|
||||
.It Ic echo Ar wordlist
|
||||
@@ -1197,7 +1192,7 @@ variable (first form) or with the value of the specified
|
||||
.Pp
|
||||
.It Ic fg
|
||||
.It Ic fg % Ns Ar job ...
|
||||
Bring the current or specified jobs into the foreground, continuing them if
|
||||
Brings the current or specified jobs into the foreground, continuing them if
|
||||
they were stopped.
|
||||
.Pp
|
||||
.It Ic foreach Ar name (wordlist)
|
||||
@@ -1257,7 +1252,7 @@ that does not begin with a `/'.
|
||||
.It Ic history Ar n
|
||||
.It Ic history Fl r Ar n
|
||||
.It Ic history Fl h Ar n
|
||||
Display the history event list; if
|
||||
Displays the history event list; if
|
||||
.Ar n
|
||||
is given only the
|
||||
.Ar n
|
||||
@@ -1329,7 +1324,7 @@ must appear alone on its input line or after an
|
||||
.Pp
|
||||
.It Ic jobs
|
||||
.It Ic jobs Fl l
|
||||
List the active jobs; the
|
||||
Lists the active jobs; the
|
||||
.Fl l
|
||||
option lists process id's in addition to the normal information.
|
||||
.Pp
|
||||
@@ -1337,10 +1332,10 @@ option lists process id's in addition to the normal information.
|
||||
.It Ic kill Ar pid
|
||||
.It Ic kill Fl sig Ar pid ...
|
||||
.It Ic kill Fl l
|
||||
Send either the TERM (terminate) signal or the
|
||||
Sends either the TERM (terminate) signal or the
|
||||
specified signal to the specified jobs or processes.
|
||||
Signals are either given by number or by names (as given in
|
||||
.Pa /usr/include/signal.h ,
|
||||
.Pa /usr/include/signal.h,
|
||||
stripped of the prefix ``SIG'').
|
||||
The signal names are listed by ``kill \-l''.
|
||||
There is no default, just saying `kill' does not
|
||||
@@ -1354,7 +1349,7 @@ then the job or process will be sent a CONT (continue) signal as well.
|
||||
.It Ic limit Fl h
|
||||
.It Ic limit Fl h Ar resource
|
||||
.It Ic limit Fl h Ar resource maximum-use
|
||||
Limit the consumption by the current process and each process
|
||||
Limits the consumption by the current process and each process
|
||||
it creates to not individually exceed
|
||||
.Ar maximum-use
|
||||
on the
|
||||
@@ -1410,7 +1405,7 @@ of the names suffice.
|
||||
.Pp
|
||||
.It Ic login
|
||||
Terminate a login shell, replacing it with an instance of
|
||||
.Pa /usr/bin/login .
|
||||
.Pa /usr/bin/login.
|
||||
This is one way to log off, included for compatibility with
|
||||
.Xr sh 1 .
|
||||
.Pp
|
||||
@@ -1453,7 +1448,7 @@ All processes detached with `&' are effectively
|
||||
.Pp
|
||||
.It Ic notify
|
||||
.It Ic notify % Ns Ar job ...
|
||||
Cause the shell to notify the user asynchronously when the status of the
|
||||
Causes the shell to notify the user asynchronously when the status of the
|
||||
current or specified jobs change; normally notification is presented
|
||||
before a prompt. This is automatic if the shell variable
|
||||
.Ic notify
|
||||
@@ -1483,7 +1478,7 @@ are disabled (/etc/csh.cshrc, /etc/csh.login).
|
||||
.Pp
|
||||
.It Ic popd
|
||||
.It Ic popd Ar +n
|
||||
Pop the directory stack, returning to the new top directory.
|
||||
Pops the directory stack, returning to the new top directory.
|
||||
With an argument
|
||||
.Ns \`+ Ar n Ns \'
|
||||
discards the
|
||||
@@ -1491,17 +1486,6 @@ discards the
|
||||
entry in the stack.
|
||||
The members of the directory stack are numbered from the top starting at 0.
|
||||
.Pp
|
||||
.It Ic printf Ar format-string values
|
||||
Invokes a builtin version of
|
||||
.Ic printf
|
||||
after evaluating the
|
||||
.Ar format-string
|
||||
and
|
||||
.Ar values .
|
||||
See the
|
||||
.Xr printf 1
|
||||
manpage for details.
|
||||
.Pp
|
||||
.It Ic pushd
|
||||
.It Ic pushd Ar name
|
||||
.It Ic pushd Ar n
|
||||
@@ -1527,7 +1511,7 @@ stack around to be the top element and changes to it. The members
|
||||
of the directory stack are numbered from the top starting at 0.
|
||||
.Pp
|
||||
.It Ic rehash
|
||||
Cause the internal hash table of the contents of the directories in
|
||||
Causes the internal hash table of the contents of the directories in
|
||||
the
|
||||
.Ic path
|
||||
variable to be recomputed. This is needed if new commands are added
|
||||
@@ -1605,7 +1589,7 @@ The most commonly used environment variables
|
||||
and
|
||||
.Ev PATH
|
||||
are automatically imported to and exported from the
|
||||
.Nm
|
||||
.Nm csh
|
||||
variables
|
||||
.Ar user ,
|
||||
.Ar term ,
|
||||
@@ -1641,21 +1625,19 @@ commands.
|
||||
Normally input during
|
||||
.Ic source
|
||||
commands is not placed on the history list;
|
||||
the
|
||||
.Fl h
|
||||
option causes the commands to be placed on the
|
||||
the \-h option causes the commands to be placed on the
|
||||
history list without being executed.
|
||||
.Pp
|
||||
.It Ic stop
|
||||
.It Ic stop % Ns Ar job ...
|
||||
Stop the current or specified jobs that are executing in the background.
|
||||
Stops the current or specified jobs that are executing in the background.
|
||||
.Pp
|
||||
.It Ic suspend
|
||||
Cause the shell to stop in its tracks, much as if it had been sent a stop
|
||||
Causes the shell to stop in its tracks, much as if it had been sent a stop
|
||||
signal with
|
||||
.Em ^Z .
|
||||
.Ic ^Z .
|
||||
This is most often used to stop shells started by
|
||||
.Xr su 1 .
|
||||
.Xr su 1 .
|
||||
.Pp
|
||||
.It Ic switch Ar (string)
|
||||
.It Ic case Ar str1 :
|
||||
@@ -1717,7 +1699,7 @@ is disabled.
|
||||
.It Ic unlimit Ar resource
|
||||
.It Ic unlimit Fl h
|
||||
.It Ic unlimit Fl h Ar resource
|
||||
Remove the limitation on
|
||||
Removes the limitation on
|
||||
.Ar resource .
|
||||
If no
|
||||
.Ar resource
|
||||
@@ -1736,7 +1718,7 @@ It is not an error for nothing to be
|
||||
.Ic unset .
|
||||
.Pp
|
||||
.It Ic unsetenv Ar pattern
|
||||
Remove all variables whose name match the specified pattern from the
|
||||
Removes all variables whose name match the specified pattern from the
|
||||
environment. See also the
|
||||
.Ic setenv
|
||||
command above and
|
||||
@@ -1748,7 +1730,7 @@ If the shell is interactive, then an interrupt can disrupt the wait.
|
||||
After the interrupt, the shell prints names and job numbers of all jobs
|
||||
known to be outstanding.
|
||||
.It Ic which Ar command
|
||||
Display the resolved command that will be executed by the shell.
|
||||
Displays the resolved command that will be executed by the shell.
|
||||
.Pp
|
||||
.It Ic while Ar (expr)
|
||||
.It \&...
|
||||
@@ -1773,10 +1755,10 @@ Prompting occurs here the first time through the loop as for the
|
||||
statement if the input is a terminal.
|
||||
.Pp
|
||||
.It Ic % Ns Ar job
|
||||
Bring the specified job into the foreground.
|
||||
Brings the specified job into the foreground.
|
||||
.Pp
|
||||
.It Ic % Ns Ar job Ic &
|
||||
Continue the specified job in the background.
|
||||
Continues the specified job in the background.
|
||||
.Pp
|
||||
.It Ic @
|
||||
.It Ic @ Ar name Ns = Ns expr
|
||||
@@ -1849,7 +1831,7 @@ is likewise handled; it is not
|
||||
necessary to worry about its setting other than in the file
|
||||
.Ar \&.cshrc
|
||||
as inferior
|
||||
.Nm
|
||||
.Nm csh
|
||||
processes will import the definition of
|
||||
.Ar path
|
||||
from the environment, and re-export it if you then change it.
|
||||
@@ -1860,7 +1842,7 @@ positional parameters are substituted, i.e., `$1' is replaced by
|
||||
`$argv[1]',
|
||||
etc.
|
||||
.It Ic cdpath
|
||||
Give a list of alternate directories searched to find subdirectories
|
||||
Gives a list of alternate directories searched to find subdirectories
|
||||
in
|
||||
.Ar chdir
|
||||
commands.
|
||||
@@ -1928,9 +1910,10 @@ files are not accidentally destroyed, and that `>>' redirections
|
||||
refer to existing files.
|
||||
.It Ic noglob
|
||||
If set, filename expansion is inhibited.
|
||||
This inhibition is most useful in shell scripts that are not dealing with
|
||||
filenames, or after a list of filenames has been obtained and further
|
||||
expansions are not desirable.
|
||||
This inhibition is most useful in shell scripts that
|
||||
are not dealing with filenames,
|
||||
or after a list of filenames has been obtained and further expansions
|
||||
are not desirable.
|
||||
.It Ic nonomatch
|
||||
If set, it is not an error for a filename expansion to not match any
|
||||
existing files; instead the primitive pattern is returned.
|
||||
@@ -1998,7 +1981,7 @@ If it terminated abnormally, then 0200 is added to the status.
|
||||
Builtin commands that fail return exit status `1',
|
||||
all other builtin commands set status to `0'.
|
||||
.It Ic time
|
||||
Control automatic timing of commands.
|
||||
Controls automatic timing of commands.
|
||||
If set, then any command that takes more than this many cpu seconds
|
||||
will cause a line giving user, system, and real times and a utilization
|
||||
percentage which is the ratio of user plus system times to real time
|
||||
@@ -2097,35 +2080,27 @@ signal; otherwise this signal is passed on to children from the state in the
|
||||
shell's parent.
|
||||
Interrupts are not allowed when a login shell is reading the file
|
||||
.Pa \&.logout .
|
||||
.Sh AUTHORS
|
||||
.An William Joy .
|
||||
.Pp
|
||||
Job control and directory stack features first implemented by
|
||||
.An J.E. Kulp
|
||||
of IIASA, Laxenburg, Austria,
|
||||
.Sh AUTHOR
|
||||
William Joy.
|
||||
Job control and directory stack features first implemented by J.E. Kulp of
|
||||
IIASA, Laxenburg, Austria,
|
||||
with different syntax than that used now.
|
||||
.Pp
|
||||
File name completion code written by
|
||||
.An Ken Greer ,
|
||||
HP Labs.
|
||||
.Pp
|
||||
Eight-bit implementation
|
||||
.An Christos S. Zoulas ,
|
||||
Cornell University.
|
||||
File name completion code written by Ken Greer, HP Labs.
|
||||
Eight-bit implementation Christos S. Zoulas, Cornell University.
|
||||
.Sh FILES
|
||||
.Bl -tag -width /etc/passwd -compact
|
||||
.It Pa ~/.cshrc
|
||||
read at beginning of execution by each shell.
|
||||
Read at beginning of execution by each shell.
|
||||
.It Pa ~/.login
|
||||
read by login shell, after `.cshrc' at login.
|
||||
Read by login shell, after `.cshrc' at login.
|
||||
.It Pa ~/.logout
|
||||
read by login shell, at logout.
|
||||
Read by login shell, at logout.
|
||||
.It Pa /bin/sh
|
||||
standard shell, for shell scripts not starting with a `#'.
|
||||
Standard shell, for shell scripts not starting with a `#'.
|
||||
.It Pa /tmp/sh*
|
||||
temporary file for `<<'.
|
||||
Temporary file for `<<'.
|
||||
.It Pa /etc/passwd
|
||||
source of home directories for `~name'.
|
||||
Source of home directories for `~name'.
|
||||
.El
|
||||
.Sh LIMITATIONS
|
||||
Word lengths \-
|
||||
@@ -2139,18 +2114,8 @@ To detect looping, the shell restricts the number of
|
||||
.Ic alias
|
||||
substitutions on a single line to 20.
|
||||
.Sh SEE ALSO
|
||||
.Xr builtin 1 ,
|
||||
.Xr echo 1 ,
|
||||
.Xr kill 1 ,
|
||||
.Xr login 1 ,
|
||||
.Xr nice 1 ,
|
||||
.Xr nohup 1 ,
|
||||
.Xr printenv 1 ,
|
||||
.Xr printf 1 ,
|
||||
.Xr sh 1 ,
|
||||
.Xr su 1 ,
|
||||
.Xr time 1 ,
|
||||
.Xr which 1 ,
|
||||
.Xr access 2 ,
|
||||
.Xr execve 2 ,
|
||||
.Xr fork 2 ,
|
||||
@@ -2163,9 +2128,8 @@ substitutions on a single line to 20.
|
||||
.Xr tty 4 ,
|
||||
.Xr a.out 5 ,
|
||||
.Xr environ 7
|
||||
.Rs
|
||||
.%T "An introduction to the C shell"
|
||||
.Re
|
||||
.br
|
||||
.Em An introduction to the C shell
|
||||
.Sh HISTORY
|
||||
.Nm Csh
|
||||
appeared in
|
||||
@@ -2182,7 +2146,7 @@ and user name completion (see
|
||||
and a C-like syntax.
|
||||
There are now many shells that also have these mechanisms, plus
|
||||
a few more (and maybe some bugs too), which are available through the
|
||||
Usenet.
|
||||
usenet.
|
||||
.Sh BUGS
|
||||
When a command is restarted from a stop,
|
||||
the shell prints the directory it started in if this is different
|
||||
@@ -2209,7 +2173,7 @@ shell procedures should be provided instead of aliases.
|
||||
Commands within loops, prompted for by `?', are not placed on the
|
||||
.Ic history
|
||||
list.
|
||||
Control structure should be parsed instead of being recognized as builtin
|
||||
Control structure should be parsed instead of being recognized as built-in
|
||||
commands. This would allow control commands to be placed anywhere,
|
||||
to be combined with `\&|', and to be used with `&' and `;' metasyntax.
|
||||
.Pp
|
||||
|
||||
+29
-32
@@ -29,24 +29,21 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: csh.c,v 1.6 1995/10/23 23:08:25 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char copyright[] =
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1980, 1991, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)csh.c 8.2 (Berkeley) 10/12/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
@@ -117,10 +114,10 @@ main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
Char *cp;
|
||||
char *tcp;
|
||||
int f;
|
||||
char **tempv;
|
||||
register Char *cp;
|
||||
register char *tcp;
|
||||
register int f;
|
||||
register char **tempv;
|
||||
struct sigvec osv;
|
||||
|
||||
cshin = stdin;
|
||||
@@ -232,7 +229,7 @@ main(argc, argv)
|
||||
*/
|
||||
set(STRstatus, Strsave(STR0));
|
||||
|
||||
if ((tcp = getenv("HOME")) != NULL && strlen(tcp) < MAXPATHLEN)
|
||||
if ((tcp = getenv("HOME")) != NULL)
|
||||
cp = SAVE(tcp);
|
||||
else
|
||||
cp = NULL;
|
||||
@@ -527,7 +524,7 @@ notty:
|
||||
{
|
||||
int osetintr = setintr;
|
||||
sig_t oparintr = parintr;
|
||||
int omask = sigblock(sigmask(SIGINT));
|
||||
sigset_t omask = sigblock(sigmask(SIGINT));
|
||||
|
||||
setintr = 0;
|
||||
parintr = SIG_IGN; /* Disable onintr */
|
||||
@@ -606,9 +603,9 @@ void
|
||||
importpath(cp)
|
||||
Char *cp;
|
||||
{
|
||||
int i = 0;
|
||||
Char *dp;
|
||||
Char **pv;
|
||||
register int i = 0;
|
||||
register Char *dp;
|
||||
register Char **pv;
|
||||
int c;
|
||||
|
||||
for (dp = cp; *dp; dp++)
|
||||
@@ -626,7 +623,7 @@ importpath(cp)
|
||||
if ((c = *dp) == ':' || c == 0) {
|
||||
*dp = 0;
|
||||
if (*cp != '/' && (euid == 0 || uid == 0) &&
|
||||
(intact || (intty && isatty(SHOUT))))
|
||||
(intact || intty && isatty(SHOUT)))
|
||||
(void) fprintf(csherr,
|
||||
"Warning: imported path contains relative components\n");
|
||||
pv[i++] = Strsave(*cp ? cp : STRdot);
|
||||
@@ -650,7 +647,7 @@ static int
|
||||
srccat(cp, dp)
|
||||
Char *cp, *dp;
|
||||
{
|
||||
Char *ep = Strspl(cp, dp);
|
||||
register Char *ep = Strspl(cp, dp);
|
||||
char *ptr = short2str(ep);
|
||||
|
||||
xfree((ptr_t) ep);
|
||||
@@ -665,7 +662,7 @@ srcfile(f, onlyown, flag)
|
||||
char *f;
|
||||
bool onlyown, flag;
|
||||
{
|
||||
int unit;
|
||||
register int unit;
|
||||
|
||||
if ((unit = open(f, O_RDONLY)) == -1)
|
||||
return 0;
|
||||
@@ -683,7 +680,7 @@ srcfile(f, onlyown, flag)
|
||||
int insource;
|
||||
static void
|
||||
srcunit(unit, onlyown, hflg)
|
||||
int unit;
|
||||
register int unit;
|
||||
bool onlyown, hflg;
|
||||
{
|
||||
/* We have to push down a lot of state here */
|
||||
@@ -698,7 +695,7 @@ srcunit(unit, onlyown, hflg)
|
||||
bool otell = cantell;
|
||||
|
||||
struct Bin saveB;
|
||||
volatile int omask;
|
||||
volatile sigset_t omask;
|
||||
jmp_buf oldexit;
|
||||
|
||||
/* The (few) real local variables */
|
||||
@@ -734,7 +731,7 @@ srcunit(unit, onlyown, hflg)
|
||||
if (setintr)
|
||||
omask = sigblock(sigmask(SIGINT));
|
||||
/* Setup the new values of the state stuff saved above */
|
||||
memmove((char *) &(saveB), (char *) &B, sizeof(B));
|
||||
bcopy((char *) &B, (char *) &(saveB), sizeof(B));
|
||||
fbuf = NULL;
|
||||
fseekp = feobp = fblocks = 0;
|
||||
oSHIN = SHIN, SHIN = unit, arginp = 0, onelflg = 0;
|
||||
@@ -759,7 +756,7 @@ srcunit(unit, onlyown, hflg)
|
||||
if (setintr)
|
||||
(void) sigsetmask(omask);
|
||||
if (oSHIN >= 0) {
|
||||
int i;
|
||||
register int i;
|
||||
|
||||
/* We made it to the new state... free up its storage */
|
||||
/* This code could get run twice but xfree doesn't care */
|
||||
@@ -768,7 +765,7 @@ srcunit(unit, onlyown, hflg)
|
||||
xfree((ptr_t) fbuf);
|
||||
|
||||
/* Reset input arena */
|
||||
memmove((char *) &B, (char *) &(saveB), sizeof(B));
|
||||
bcopy((char *) &(saveB), (char *) &B, sizeof(B));
|
||||
|
||||
(void) close(SHIN), SHIN = oSHIN;
|
||||
arginp = oarginp, onelflg = oonelflg;
|
||||
@@ -934,9 +931,9 @@ pintr1(wantnl)
|
||||
bool wantnl;
|
||||
{
|
||||
Char **v;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
|
||||
omask = sigblock(0);
|
||||
omask = sigblock((sigset_t) 0);
|
||||
if (setintr) {
|
||||
(void) sigsetmask(omask & ~sigmask(SIGINT));
|
||||
if (pjobs) {
|
||||
@@ -1006,7 +1003,7 @@ process(catch)
|
||||
* Interruptible during interactive reads
|
||||
*/
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
|
||||
/*
|
||||
* For the sake of reset()
|
||||
@@ -1123,7 +1120,7 @@ dosource(v, t)
|
||||
struct command *t;
|
||||
|
||||
{
|
||||
Char *f;
|
||||
register Char *f;
|
||||
bool hflg = 0;
|
||||
Char buf[BUFSIZ];
|
||||
|
||||
@@ -1153,8 +1150,8 @@ dosource(v, t)
|
||||
static void
|
||||
mailchk()
|
||||
{
|
||||
struct varent *v;
|
||||
Char **vp;
|
||||
register struct varent *v;
|
||||
register Char **vp;
|
||||
time_t t;
|
||||
int intvl, cnt;
|
||||
struct stat stb;
|
||||
@@ -1223,7 +1220,7 @@ gethdir(home)
|
||||
|
||||
/*
|
||||
* When didfds is set, we do I/O from 0, 1, 2 otherwise from 15, 16, 17
|
||||
* We also check if the shell has already changed the descriptor to point to
|
||||
* We also check if the shell has already changed the decriptor to point to
|
||||
* 0, 1, 2 when didfds is set.
|
||||
*/
|
||||
#define DESC(a) (*((int *) (a)) - (didfds && *((int *) a) >= FSHIN ? FSHIN : 0))
|
||||
@@ -1341,7 +1338,7 @@ defaultpath()
|
||||
void
|
||||
printprompt()
|
||||
{
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
|
||||
if (!whyles) {
|
||||
for (cp = value(STRprompt); *cp; cp++)
|
||||
|
||||
+8
-6
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)csh.h 8.1 (Berkeley) 5/31/93
|
||||
* $FreeBSD$
|
||||
* $Id: csh.h,v 1.2 1994/09/24 02:53:52 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -84,7 +84,7 @@ typedef void *ptr_t;
|
||||
|
||||
#include "const.h"
|
||||
#include "char.h"
|
||||
#include "errnum.h"
|
||||
#include "err.h"
|
||||
|
||||
#define xmalloc(i) Malloc(i)
|
||||
#define xrealloc(p, i) Realloc(p, i)
|
||||
@@ -187,8 +187,8 @@ jmp_buf reslab;
|
||||
#define setexit() (setjmp(reslab))
|
||||
#define reset() longjmp(reslab, 1)
|
||||
/* Should use structure assignment here */
|
||||
#define getexit(a) memmove((char *)(a), (char *)reslab, sizeof reslab)
|
||||
#define resexit(a) memmove((char *)reslab, (char *)(a), sizeof reslab)
|
||||
#define getexit(a) bcopy((char *)reslab, ((char *)(a)), sizeof reslab)
|
||||
#define resexit(a) bcopy((char *)(a), (char *)reslab, sizeof reslab)
|
||||
|
||||
Char *gointr; /* Label for an onintr transfer */
|
||||
|
||||
@@ -306,7 +306,7 @@ Char *lap;
|
||||
*
|
||||
* Each command is parsed to a tree of command structures and
|
||||
* flags are set bottom up during this process, to be propagated down
|
||||
* as needed during the semantics/execution pass (sh.sem.c).
|
||||
* as needed during the semantics/exeuction pass (sh.sem.c).
|
||||
*/
|
||||
struct command {
|
||||
short t_dtyp; /* Type of node */
|
||||
@@ -421,6 +421,8 @@ struct varent {
|
||||
#define v_right v_link[1]
|
||||
#define v_parent v_link[2]
|
||||
|
||||
struct varent *adrof1();
|
||||
|
||||
#define adrof(v) adrof1(v, &shvhed)
|
||||
#define value(v) value1(v, &shvhed)
|
||||
|
||||
@@ -535,7 +537,7 @@ Char **evalvec;
|
||||
Char *evalp;
|
||||
|
||||
/* word_chars is set by default to WORD_CHARS but can be overridden by
|
||||
the wordchars variable--if unset, reverts to WORD_CHARS */
|
||||
the worchars variable--if unset, reverts to WORD_CHARS */
|
||||
|
||||
Char *word_chars;
|
||||
|
||||
|
||||
+31
-32
@@ -29,15 +29,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: dir.c,v 1.4 1995/06/18 14:34:48 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)dir.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -78,14 +75,14 @@ void
|
||||
dinit(hp)
|
||||
Char *hp;
|
||||
{
|
||||
char *tcp;
|
||||
Char *cp;
|
||||
struct directory *dp;
|
||||
register char *tcp;
|
||||
register Char *cp;
|
||||
register struct directory *dp;
|
||||
char path[MAXPATHLEN];
|
||||
static char *emsg = "csh: Trying to start from \"%s\"\n";
|
||||
|
||||
/* Don't believe the login shell home, because it may be a symlink */
|
||||
tcp = getcwd(path, MAXPATHLEN); /* see ngetwd.c for System V version */
|
||||
tcp = getwd(path); /* see ngetwd.c for System V version */
|
||||
if (tcp == NULL || *tcp == '\0') {
|
||||
(void) fprintf(csherr, "csh: %s: %s\n", path, strerror(errno));
|
||||
if (hp && *hp) {
|
||||
@@ -148,7 +145,7 @@ Char *dp;
|
||||
* Don't call set() directly cause if the directory contains ` or
|
||||
* other junk characters glob will fail.
|
||||
*/
|
||||
Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
|
||||
register Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
|
||||
|
||||
vec[0] = Strsave(dp);
|
||||
vec[1] = 0;
|
||||
@@ -206,7 +203,7 @@ dodirs(v, t)
|
||||
static void
|
||||
printdirs()
|
||||
{
|
||||
struct directory *dp;
|
||||
register struct directory *dp;
|
||||
Char *s, *hp = value(STRhome);
|
||||
int idx, len, cur;
|
||||
|
||||
@@ -243,7 +240,7 @@ printdirs()
|
||||
|
||||
void
|
||||
dtildepr(home, dir)
|
||||
Char *home, *dir;
|
||||
register Char *home, *dir;
|
||||
{
|
||||
|
||||
if (!eq(home, STRslash) && prefix(home, dir))
|
||||
@@ -343,8 +340,8 @@ dochngd(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
Char *cp;
|
||||
struct directory *dp;
|
||||
register Char *cp;
|
||||
register struct directory *dp;
|
||||
|
||||
skipargs(&v, " [<dir>]");
|
||||
printd = 0;
|
||||
@@ -392,7 +389,7 @@ dgoto(cp)
|
||||
Char *dp;
|
||||
|
||||
if (*cp != '/') {
|
||||
Char *p, *q;
|
||||
register Char *p, *q;
|
||||
int cwdlen;
|
||||
|
||||
for (p = dcwd->di_name; *p++;)
|
||||
@@ -426,9 +423,9 @@ dgoto(cp)
|
||||
*/
|
||||
static Char *
|
||||
dfollow(cp)
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
{
|
||||
Char *dp;
|
||||
register Char *dp;
|
||||
struct varent *c;
|
||||
char ebuf[MAXPATHLEN];
|
||||
int serrno;
|
||||
@@ -452,7 +449,7 @@ dfollow(cp)
|
||||
if (cp[0] != '/' && !prefix(STRdotsl, cp) && !prefix(STRdotdotsl, cp)
|
||||
&& (c = adrof(STRcdpath))) {
|
||||
Char **cdp;
|
||||
Char *p;
|
||||
register Char *p;
|
||||
Char buf[MAXPATHLEN];
|
||||
|
||||
for (cdp = c->vec; *cdp; cdp++) {
|
||||
@@ -494,7 +491,7 @@ dopushd(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct directory *dp;
|
||||
register struct directory *dp;
|
||||
|
||||
skipargs(&v, " [<dir>|+<n>]");
|
||||
printd = 1;
|
||||
@@ -526,7 +523,7 @@ dopushd(v, t)
|
||||
stderror(ERR_SYSTEM, tmp, strerror(errno));
|
||||
}
|
||||
else {
|
||||
Char *ccp;
|
||||
register Char *ccp;
|
||||
|
||||
ccp = dfollow(*v);
|
||||
dp = (struct directory *) xcalloc(sizeof(struct directory), 1);
|
||||
@@ -545,11 +542,11 @@ dopushd(v, t)
|
||||
*/
|
||||
static struct directory *
|
||||
dfind(cp)
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
{
|
||||
struct directory *dp;
|
||||
int i;
|
||||
Char *ep;
|
||||
register struct directory *dp;
|
||||
register int i;
|
||||
register Char *ep;
|
||||
|
||||
if (*cp++ != '+')
|
||||
return (0);
|
||||
@@ -579,7 +576,7 @@ dopopd(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct directory *dp, *p = NULL;
|
||||
register struct directory *dp, *p = NULL;
|
||||
|
||||
skipargs(&v, " [+<n>]");
|
||||
printd = 1;
|
||||
@@ -617,7 +614,7 @@ dopopd(v, t)
|
||||
*/
|
||||
void
|
||||
dfree(dp)
|
||||
struct directory *dp;
|
||||
register struct directory *dp;
|
||||
{
|
||||
|
||||
if (dp->di_count != 0) {
|
||||
@@ -636,10 +633,10 @@ dfree(dp)
|
||||
*/
|
||||
Char *
|
||||
dcanon(cp, p)
|
||||
Char *cp, *p;
|
||||
register Char *cp, *p;
|
||||
{
|
||||
Char *sp;
|
||||
Char *p1, *p2; /* general purpose */
|
||||
register Char *sp;
|
||||
register Char *p1, *p2; /* general purpose */
|
||||
bool slash;
|
||||
|
||||
Char link[MAXPATHLEN];
|
||||
@@ -705,7 +702,8 @@ dcanon(cp, p)
|
||||
*/
|
||||
*--sp = 0; /* form the pathname for readlink */
|
||||
if (sp != cp && !adrof(STRignore_symlinks) &&
|
||||
(cc = readlink(short2str(cp), tlink, sizeof(tlink) - 1)) >= 0) {
|
||||
(cc = readlink(short2str(cp), tlink,
|
||||
sizeof tlink)) >= 0) {
|
||||
(void) Strcpy(link, str2short(tlink));
|
||||
link[cc] = '\0';
|
||||
|
||||
@@ -789,7 +787,8 @@ dcanon(cp, p)
|
||||
|
||||
if (sp != cp && adrof(STRchase_symlinks) &&
|
||||
!adrof(STRignore_symlinks) &&
|
||||
(cc = readlink(short2str(cp), tlink, sizeof(tlink) - 1)) >= 0) {
|
||||
(cc = readlink(short2str(cp), tlink,
|
||||
sizeof tlink)) >= 0) {
|
||||
(void) Strcpy(link, str2short(tlink));
|
||||
link[cc] = '\0';
|
||||
|
||||
@@ -924,7 +923,7 @@ dcanon(cp, p)
|
||||
*/
|
||||
static void
|
||||
dnewcwd(dp)
|
||||
struct directory *dp;
|
||||
register struct directory *dp;
|
||||
{
|
||||
dcwd = dp;
|
||||
dset(dcwd->di_name);
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)dir.h 8.1 (Berkeley) 5/31/93
|
||||
* $FreeBSD$
|
||||
* $Id: dir.h,v 1.2 1994/09/24 02:53:55 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+24
-27
@@ -29,15 +29,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: dol.c,v 1.3 1995/05/30 00:06:31 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)dol.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -108,10 +105,10 @@ static void Dtestq __P((int));
|
||||
*/
|
||||
void
|
||||
Dfix(t)
|
||||
struct command *t;
|
||||
register struct command *t;
|
||||
{
|
||||
Char **pp;
|
||||
Char *p;
|
||||
register Char **pp;
|
||||
register Char *p;
|
||||
|
||||
if (noexec)
|
||||
return;
|
||||
@@ -133,7 +130,7 @@ Dfix(t)
|
||||
*/
|
||||
Char *
|
||||
Dfix1(cp)
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
{
|
||||
Char *Dv[2];
|
||||
|
||||
@@ -176,8 +173,8 @@ static Char *
|
||||
Dpack(wbuf, wp)
|
||||
Char *wbuf, *wp;
|
||||
{
|
||||
int c;
|
||||
int i = MAXWLEN - (wp - wbuf);
|
||||
register int c;
|
||||
register int i = MAXWLEN - (wp - wbuf);
|
||||
|
||||
for (;;) {
|
||||
c = DgetC(DODOL);
|
||||
@@ -223,11 +220,11 @@ Dpack(wbuf, wp)
|
||||
static int
|
||||
Dword()
|
||||
{
|
||||
int c, c1;
|
||||
register int c, c1;
|
||||
Char wbuf[BUFSIZ];
|
||||
Char *wp = wbuf;
|
||||
int i = MAXWLEN;
|
||||
bool dolflg;
|
||||
register Char *wp = wbuf;
|
||||
register int i = MAXWLEN;
|
||||
register bool dolflg;
|
||||
bool sofar = 0, done = 0;
|
||||
|
||||
while (!done) {
|
||||
@@ -343,9 +340,9 @@ Dword()
|
||||
*/
|
||||
static int
|
||||
DgetC(flag)
|
||||
int flag;
|
||||
register int flag;
|
||||
{
|
||||
int c;
|
||||
register int c;
|
||||
|
||||
top:
|
||||
if ((c = Dpeekc) != '\0') {
|
||||
@@ -404,8 +401,8 @@ dolerror(s)
|
||||
static void
|
||||
Dgetdol()
|
||||
{
|
||||
Char *np;
|
||||
struct varent *vp = NULL;
|
||||
register Char *np;
|
||||
register struct varent *vp = NULL;
|
||||
Char name[4 * MAXVARLEN + 1];
|
||||
int c, sc;
|
||||
int subscr = 0, lwb = 1, upb = 0;
|
||||
@@ -577,7 +574,7 @@ Dgetdol()
|
||||
else if (*np != '-')
|
||||
stderror(ERR_MISSING, '-');
|
||||
else {
|
||||
int i = upb;
|
||||
register int i = upb;
|
||||
|
||||
np++;
|
||||
if (Isdigit(*np)) {
|
||||
@@ -635,7 +632,7 @@ eatbrac:
|
||||
static void
|
||||
fixDolMod()
|
||||
{
|
||||
int c;
|
||||
register int c;
|
||||
|
||||
c = DgetC(0);
|
||||
if (c == ':') {
|
||||
@@ -694,9 +691,9 @@ fixDolMod()
|
||||
|
||||
static void
|
||||
setDolp(cp)
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
{
|
||||
Char *dp;
|
||||
register Char *dp;
|
||||
int i;
|
||||
|
||||
if (dolnmod == 0 || dolmcnt == 0) {
|
||||
@@ -807,7 +804,7 @@ unDredc(c)
|
||||
static int
|
||||
Dredc()
|
||||
{
|
||||
int c;
|
||||
register int c;
|
||||
|
||||
if ((c = Dpeekrd) != '\0') {
|
||||
Dpeekrd = 0;
|
||||
@@ -825,7 +822,7 @@ Dredc()
|
||||
|
||||
static void
|
||||
Dtestq(c)
|
||||
int c;
|
||||
register int c;
|
||||
{
|
||||
|
||||
if (cmap(c, QUOTES))
|
||||
@@ -842,11 +839,11 @@ void
|
||||
heredoc(term)
|
||||
Char *term;
|
||||
{
|
||||
int c;
|
||||
register int c;
|
||||
Char *Dv[2];
|
||||
Char obuf[BUFSIZ], lbuf[BUFSIZ], mbuf[BUFSIZ];
|
||||
int ocnt, lcnt, mcnt;
|
||||
Char *lbp, *obp, *mbp;
|
||||
register Char *lbp, *obp, *mbp;
|
||||
Char **vp;
|
||||
bool quoted;
|
||||
char *tmp;
|
||||
|
||||
+6
-8
@@ -29,18 +29,16 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: err.c,v 1.2 1994/09/24 02:53:57 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#if __STDC__
|
||||
# include <stdarg.h>
|
||||
@@ -309,7 +307,7 @@ seterror(id, va_alist)
|
||||
#endif
|
||||
if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0]))
|
||||
id = ERR_INVALID;
|
||||
vsnprintf(berr, sizeof(berr), errorlist[id], va);
|
||||
vsprintf(berr, errorlist[id], va);
|
||||
va_end(va);
|
||||
|
||||
seterr = strsave(berr);
|
||||
@@ -327,7 +325,7 @@ seterror(id, va_alist)
|
||||
* in bname
|
||||
*
|
||||
* This routine always resets or exits. The flag haderr
|
||||
* is set so the routine who catches the unwind can propagate
|
||||
* is set so the routine who catches the unwind can propogate
|
||||
* it if they want.
|
||||
*
|
||||
* Note that any open files at the point of error will eventually
|
||||
@@ -344,7 +342,7 @@ stderror(id, va_alist)
|
||||
#endif
|
||||
{
|
||||
va_list va;
|
||||
Char **v;
|
||||
register Char **v;
|
||||
int flags = id & ERR_FLAGS;
|
||||
|
||||
id &= ~ERR_FLAGS;
|
||||
|
||||
+30
-31
@@ -29,22 +29,21 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: exec.c,v 1.4 1995/06/18 14:20:16 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#if __STDC__
|
||||
@@ -114,10 +113,10 @@ doexec(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
Char *dp, **pv, **av, *sav;
|
||||
struct varent *pathv;
|
||||
bool slash;
|
||||
int hashval = 0, hashval1, i;
|
||||
register Char *dp, **pv, **av, *sav;
|
||||
register struct varent *pathv;
|
||||
register bool slash;
|
||||
register int hashval = 0, hashval1, i;
|
||||
Char *blk[2];
|
||||
|
||||
/*
|
||||
@@ -194,7 +193,7 @@ doexec(v, t)
|
||||
* We must do this AFTER any possible forking (like `foo` in glob) so that
|
||||
* this shell can still do subprocesses.
|
||||
*/
|
||||
(void) sigsetmask(0);
|
||||
(void) sigsetmask((sigset_t) 0);
|
||||
/*
|
||||
* If no path, no words in path, or a / in the filename then restrict the
|
||||
* command search.
|
||||
@@ -266,12 +265,12 @@ pexerr()
|
||||
static void
|
||||
texec(sf, st)
|
||||
Char *sf;
|
||||
Char **st;
|
||||
register Char **st;
|
||||
{
|
||||
char **t;
|
||||
char *f;
|
||||
struct varent *v;
|
||||
Char **vp;
|
||||
register char **t;
|
||||
register char *f;
|
||||
register struct varent *v;
|
||||
register Char **vp;
|
||||
Char *lastsh[2];
|
||||
int fd;
|
||||
unsigned char c;
|
||||
@@ -362,7 +361,7 @@ texec(sf, st)
|
||||
void
|
||||
execash(t, kp)
|
||||
Char **t;
|
||||
struct command *kp;
|
||||
register struct command *kp;
|
||||
{
|
||||
int saveIN, saveOUT, saveDIAG, saveSTD;
|
||||
int oSHIN;
|
||||
@@ -447,8 +446,8 @@ dohash(v, t)
|
||||
struct command *t;
|
||||
{
|
||||
DIR *dirp;
|
||||
struct dirent *dp;
|
||||
int cnt;
|
||||
register struct dirent *dp;
|
||||
register int cnt;
|
||||
int i = 0;
|
||||
struct varent *pathv = adrof(STRpath);
|
||||
Char **pv;
|
||||
@@ -505,9 +504,9 @@ hashstat(v, t)
|
||||
*/
|
||||
static int
|
||||
hashname(cp)
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
{
|
||||
long h = 0;
|
||||
register long h = 0;
|
||||
|
||||
while (*cp)
|
||||
h = hash(h, *cp++);
|
||||
@@ -518,11 +517,11 @@ static int
|
||||
iscommand(name)
|
||||
Char *name;
|
||||
{
|
||||
Char **pv;
|
||||
Char *sav;
|
||||
struct varent *v;
|
||||
bool slash = any(short2str(name), '/');
|
||||
int hashval = 0, hashval1, i;
|
||||
register Char **pv;
|
||||
register Char *sav;
|
||||
register struct varent *v;
|
||||
register bool slash = any(short2str(name), '/');
|
||||
register int hashval = 0, hashval1, i;
|
||||
|
||||
v = adrof(STRpath);
|
||||
if (v == 0 || v->vec[0] == 0 || slash)
|
||||
@@ -619,7 +618,7 @@ executable(dir, name, dir_ok)
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
dowhich(v, c)
|
||||
Char **v;
|
||||
register Char **v;
|
||||
struct command *c;
|
||||
{
|
||||
struct wordent lex[3];
|
||||
@@ -653,9 +652,9 @@ static void
|
||||
tellmewhat(lex)
|
||||
struct wordent *lex;
|
||||
{
|
||||
int i;
|
||||
struct biltins *bptr;
|
||||
struct wordent *sp = lex->next;
|
||||
register int i;
|
||||
register struct biltins *bptr;
|
||||
register struct wordent *sp = lex->next;
|
||||
bool aliased = 0;
|
||||
Char *s0, *s1, *s2, *cmd;
|
||||
Char qc;
|
||||
@@ -707,8 +706,8 @@ tellmewhat(lex)
|
||||
sp->word = cmd = globone(sp->word, G_IGNORE);
|
||||
|
||||
if ((i = iscommand(strip(sp->word))) != 0) {
|
||||
Char **pv;
|
||||
struct varent *v;
|
||||
register Char **pv;
|
||||
register struct varent *v;
|
||||
bool slash = any(short2str(sp->word), '/');
|
||||
|
||||
v = adrof(STRpath);
|
||||
|
||||
+50
-49
@@ -29,20 +29,21 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: exp.c,v 1.2 1994/09/24 02:54:00 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)exp.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#ifndef SHORT_STRINGS
|
||||
#include <string.h>
|
||||
#endif /* SHORT_STRINGS */
|
||||
#if __STDC__
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
@@ -90,23 +91,23 @@ static void etraci __P((char *, int, Char ***));
|
||||
|
||||
int
|
||||
expr(vp)
|
||||
Char ***vp;
|
||||
register Char ***vp;
|
||||
{
|
||||
return (exp0(vp, 0));
|
||||
}
|
||||
|
||||
int
|
||||
exp0(vp, ignore)
|
||||
Char ***vp;
|
||||
register Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
int p1 = exp1(vp, ignore);
|
||||
register int p1 = exp1(vp, ignore);
|
||||
|
||||
#ifdef EDEBUG
|
||||
etraci("exp0 p1", p1, vp);
|
||||
#endif
|
||||
if (**vp && eq(**vp, STRor2)) {
|
||||
int p2;
|
||||
register int p2;
|
||||
|
||||
(*vp)++;
|
||||
p2 = exp0(vp, (ignore & IGNORE) || p1);
|
||||
@@ -120,16 +121,16 @@ exp0(vp, ignore)
|
||||
|
||||
static int
|
||||
exp1(vp, ignore)
|
||||
Char ***vp;
|
||||
register Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
int p1 = exp2(vp, ignore);
|
||||
register int p1 = exp2(vp, ignore);
|
||||
|
||||
#ifdef EDEBUG
|
||||
etraci("exp1 p1", p1, vp);
|
||||
#endif
|
||||
if (**vp && eq(**vp, STRand2)) {
|
||||
int p2;
|
||||
register int p2;
|
||||
|
||||
(*vp)++;
|
||||
p2 = exp1(vp, (ignore & IGNORE) || !p1);
|
||||
@@ -143,16 +144,16 @@ exp1(vp, ignore)
|
||||
|
||||
static int
|
||||
exp2(vp, ignore)
|
||||
Char ***vp;
|
||||
register Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
int p1 = exp2a(vp, ignore);
|
||||
register int p1 = exp2a(vp, ignore);
|
||||
|
||||
#ifdef EDEBUG
|
||||
etraci("exp3 p1", p1, vp);
|
||||
#endif
|
||||
if (**vp && eq(**vp, STRor)) {
|
||||
int p2;
|
||||
register int p2;
|
||||
|
||||
(*vp)++;
|
||||
p2 = exp2(vp, ignore);
|
||||
@@ -166,16 +167,16 @@ exp2(vp, ignore)
|
||||
|
||||
static int
|
||||
exp2a(vp, ignore)
|
||||
Char ***vp;
|
||||
register Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
int p1 = exp2b(vp, ignore);
|
||||
register int p1 = exp2b(vp, ignore);
|
||||
|
||||
#ifdef EDEBUG
|
||||
etraci("exp2a p1", p1, vp);
|
||||
#endif
|
||||
if (**vp && eq(**vp, STRcaret)) {
|
||||
int p2;
|
||||
register int p2;
|
||||
|
||||
(*vp)++;
|
||||
p2 = exp2a(vp, ignore);
|
||||
@@ -189,16 +190,16 @@ exp2a(vp, ignore)
|
||||
|
||||
static int
|
||||
exp2b(vp, ignore)
|
||||
Char ***vp;
|
||||
register Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
int p1 = exp2c(vp, ignore);
|
||||
register int p1 = exp2c(vp, ignore);
|
||||
|
||||
#ifdef EDEBUG
|
||||
etraci("exp2b p1", p1, vp);
|
||||
#endif
|
||||
if (**vp && eq(**vp, STRand)) {
|
||||
int p2;
|
||||
register int p2;
|
||||
|
||||
(*vp)++;
|
||||
p2 = exp2b(vp, ignore);
|
||||
@@ -212,12 +213,12 @@ exp2b(vp, ignore)
|
||||
|
||||
static int
|
||||
exp2c(vp, ignore)
|
||||
Char ***vp;
|
||||
register Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
Char *p1 = exp3(vp, ignore);
|
||||
Char *p2;
|
||||
int i;
|
||||
register Char *p1 = exp3(vp, ignore);
|
||||
register Char *p2;
|
||||
register int i;
|
||||
|
||||
#ifdef EDEBUG
|
||||
etracc("exp2c p1", p1, vp);
|
||||
@@ -260,11 +261,11 @@ exp2c(vp, ignore)
|
||||
|
||||
static Char *
|
||||
exp3(vp, ignore)
|
||||
Char ***vp;
|
||||
register Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
Char *p1, *p2;
|
||||
int i;
|
||||
register Char *p1, *p2;
|
||||
register int i;
|
||||
|
||||
p1 = exp3a(vp, ignore);
|
||||
#ifdef EDEBUG
|
||||
@@ -306,11 +307,11 @@ exp3(vp, ignore)
|
||||
|
||||
static Char *
|
||||
exp3a(vp, ignore)
|
||||
Char ***vp;
|
||||
register Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
Char *p1, *p2, *op;
|
||||
int i;
|
||||
register Char *p1, *p2, *op;
|
||||
register int i;
|
||||
|
||||
p1 = exp4(vp, ignore);
|
||||
#ifdef EDEBUG
|
||||
@@ -336,18 +337,18 @@ exp3a(vp, ignore)
|
||||
|
||||
static Char *
|
||||
exp4(vp, ignore)
|
||||
Char ***vp;
|
||||
register Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
Char *p1, *p2;
|
||||
int i = 0;
|
||||
register Char *p1, *p2;
|
||||
register int i = 0;
|
||||
|
||||
p1 = exp5(vp, ignore);
|
||||
#ifdef EDEBUG
|
||||
etracc("exp4 p1", p1, vp);
|
||||
#endif
|
||||
if (isa(**vp, ADDOP)) {
|
||||
Char *op = *(*vp)++;
|
||||
register Char *op = *(*vp)++;
|
||||
|
||||
p2 = exp4(vp, ignore);
|
||||
#ifdef EDEBUG
|
||||
@@ -373,18 +374,18 @@ exp4(vp, ignore)
|
||||
|
||||
static Char *
|
||||
exp5(vp, ignore)
|
||||
Char ***vp;
|
||||
register Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
Char *p1, *p2;
|
||||
int i = 0;
|
||||
register Char *p1, *p2;
|
||||
register int i = 0;
|
||||
|
||||
p1 = exp6(vp, ignore);
|
||||
#ifdef EDEBUG
|
||||
etracc("exp5 p1", p1, vp);
|
||||
#endif
|
||||
if (isa(**vp, MULOP)) {
|
||||
Char *op = *(*vp)++;
|
||||
register Char *op = *(*vp)++;
|
||||
|
||||
p2 = exp5(vp, ignore);
|
||||
#ifdef EDEBUG
|
||||
@@ -420,11 +421,11 @@ exp5(vp, ignore)
|
||||
|
||||
static Char *
|
||||
exp6(vp, ignore)
|
||||
Char ***vp;
|
||||
register Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
int ccode, i = 0;
|
||||
Char *cp, *dp, *ep;
|
||||
register Char *cp, *dp, *ep;
|
||||
|
||||
if (**vp == 0)
|
||||
stderror(ERR_NAME | ERR_EXPRESSION);
|
||||
@@ -460,7 +461,7 @@ exp6(vp, ignore)
|
||||
return (putn(ccode));
|
||||
}
|
||||
if (eq(**vp, STRLbrace)) {
|
||||
Char **v;
|
||||
register Char **v;
|
||||
struct command faket;
|
||||
Char *fakecom[2];
|
||||
|
||||
@@ -599,18 +600,18 @@ exp6(vp, ignore)
|
||||
|
||||
static void
|
||||
evalav(v)
|
||||
Char **v;
|
||||
register Char **v;
|
||||
{
|
||||
struct wordent paraml1;
|
||||
struct wordent *hp = ¶ml1;
|
||||
register struct wordent *hp = ¶ml1;
|
||||
struct command *t;
|
||||
struct wordent *wdp = hp;
|
||||
register struct wordent *wdp = hp;
|
||||
|
||||
set(STRstatus, Strsave(STR0));
|
||||
hp->prev = hp->next = hp;
|
||||
hp->word = STRNULL;
|
||||
while (*v) {
|
||||
struct wordent *new =
|
||||
register struct wordent *new =
|
||||
(struct wordent *) xcalloc(1, sizeof *wdp);
|
||||
|
||||
new->prev = wdp;
|
||||
@@ -630,8 +631,8 @@ evalav(v)
|
||||
|
||||
static int
|
||||
isa(cp, what)
|
||||
Char *cp;
|
||||
int what;
|
||||
register Char *cp;
|
||||
register int what;
|
||||
{
|
||||
if (cp == 0)
|
||||
return ((what & RESTOP) != 0);
|
||||
@@ -679,7 +680,7 @@ isa(cp, what)
|
||||
|
||||
static int
|
||||
egetn(cp)
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
{
|
||||
if (*cp && *cp != '-' && !Isdigit(*cp))
|
||||
stderror(ERR_NAME | ERR_EXPRESSION);
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)extern.h 8.1 (Berkeley) 5/31/93
|
||||
* $FreeBSD$
|
||||
* $Id: extern.h,v 1.2 1994/09/24 02:54:02 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
@@ -161,7 +161,7 @@ Char *globone __P((Char *, int));
|
||||
int Gmatch __P((Char *, Char *));
|
||||
void ginit __P((void));
|
||||
Char **globall __P((Char **));
|
||||
void rscan __P((Char **, void (*)(int)));
|
||||
void rscan __P((Char **, void (*)()));
|
||||
void tglob __P((Char **));
|
||||
void trim __P((Char **));
|
||||
#ifdef FILEC
|
||||
|
||||
+34
-33
@@ -29,26 +29,27 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: file.c,v 1.4 1995/06/18 14:08:44 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)file.c 8.2 (Berkeley) 3/19/94";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#ifdef FILEC
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <termios.h>
|
||||
#include <dirent.h>
|
||||
#include <pwd.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#ifndef SHORT_STRINGS
|
||||
#include <string.h>
|
||||
#endif /* SHORT_STRINGS */
|
||||
#if __STDC__
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
@@ -159,7 +160,7 @@ static void
|
||||
pushback(string)
|
||||
Char *string;
|
||||
{
|
||||
Char *p;
|
||||
register Char *p;
|
||||
struct termios tty, tty_normal;
|
||||
int omask;
|
||||
char c;
|
||||
@@ -183,8 +184,8 @@ pushback(string)
|
||||
*/
|
||||
static void
|
||||
catn(des, src, count)
|
||||
Char *des, *src;
|
||||
int count;
|
||||
register Char *des, *src;
|
||||
register int count;
|
||||
{
|
||||
while (--count >= 0 && *des)
|
||||
des++;
|
||||
@@ -200,8 +201,8 @@ catn(des, src, count)
|
||||
*/
|
||||
static void
|
||||
copyn(des, src, count)
|
||||
Char *des, *src;
|
||||
int count;
|
||||
register Char *des, *src;
|
||||
register int count;
|
||||
{
|
||||
while (--count >= 0)
|
||||
if ((*des++ = *src++) == 0)
|
||||
@@ -250,7 +251,7 @@ print_by_column(dir, items, count)
|
||||
Char *dir, *items[];
|
||||
int count;
|
||||
{
|
||||
int i, rows, r, c, maxwidth = 0, columns;
|
||||
register int i, rows, r, c, maxwidth = 0, columns;
|
||||
|
||||
if (ioctl(SHOUT, TIOCGWINSZ, (ioctl_t) & win) < 0 || win.ws_col == 0)
|
||||
win.ws_col = 80;
|
||||
@@ -265,7 +266,7 @@ print_by_column(dir, items, count)
|
||||
for (c = 0; c < columns; c++) {
|
||||
i = c * rows + r;
|
||||
if (i < count) {
|
||||
int w;
|
||||
register int w;
|
||||
|
||||
(void) fprintf(cshout, "%s", vis_str(items[i]));
|
||||
(void) fputc(dir ? filetype(dir, items[i]) : ' ', cshout);
|
||||
@@ -291,8 +292,8 @@ static Char *
|
||||
tilde(new, old)
|
||||
Char *new, *old;
|
||||
{
|
||||
Char *o, *p;
|
||||
struct passwd *pw;
|
||||
register Char *o, *p;
|
||||
register struct passwd *pw;
|
||||
static Char person[40];
|
||||
|
||||
if (old[0] != '~')
|
||||
@@ -374,7 +375,7 @@ static void
|
||||
extract_dir_and_name(path, dir, name)
|
||||
Char *path, *dir, *name;
|
||||
{
|
||||
Char *p;
|
||||
register Char *p;
|
||||
|
||||
p = Strrchr(path, '/');
|
||||
if (p == NULL) {
|
||||
@@ -392,8 +393,8 @@ getentry(dir_fd, looking_for_lognames)
|
||||
DIR *dir_fd;
|
||||
int looking_for_lognames;
|
||||
{
|
||||
struct passwd *pw;
|
||||
struct dirent *dirp;
|
||||
register struct passwd *pw;
|
||||
register struct dirent *dirp;
|
||||
|
||||
if (looking_for_lognames) {
|
||||
if ((pw = getpwent()) == NULL)
|
||||
@@ -407,9 +408,9 @@ getentry(dir_fd, looking_for_lognames)
|
||||
|
||||
static void
|
||||
free_items(items)
|
||||
Char **items;
|
||||
register Char **items;
|
||||
{
|
||||
int i;
|
||||
register int i;
|
||||
|
||||
for (i = 0; items[i]; i++)
|
||||
xfree((ptr_t) items[i]);
|
||||
@@ -435,9 +436,9 @@ tsearch(word, command, max_word_length)
|
||||
int max_word_length;
|
||||
{
|
||||
static Char **items = NULL;
|
||||
DIR *dir_fd;
|
||||
int numitems = 0, ignoring = TRUE, nignored = 0;
|
||||
int name_length, looking_for_lognames;
|
||||
register DIR *dir_fd;
|
||||
register numitems = 0, ignoring = TRUE, nignored = 0;
|
||||
register name_length, looking_for_lognames;
|
||||
Char tilded_dir[MAXPATHLEN + 1], dir[MAXPATHLEN + 1];
|
||||
Char name[MAXNAMLEN + 1], extended_name[MAXNAMLEN + 1];
|
||||
Char *entry;
|
||||
@@ -449,7 +450,7 @@ tsearch(word, command, max_word_length)
|
||||
|
||||
looking_for_lognames = (*word == '~') && (Strchr(word, '/') == NULL);
|
||||
if (looking_for_lognames) {
|
||||
setpwent();
|
||||
(void) setpwent();
|
||||
copyn(name, &word[1], MAXNAMLEN); /* name sans ~ */
|
||||
dir_fd = NULL;
|
||||
}
|
||||
@@ -497,7 +498,7 @@ again: /* search for matches */
|
||||
ignoring = FALSE;
|
||||
nignored = 0;
|
||||
if (looking_for_lognames)
|
||||
setpwent();
|
||||
(void) setpwent();
|
||||
else
|
||||
rewinddir(dir_fd);
|
||||
goto again;
|
||||
@@ -546,8 +547,8 @@ recognize(extended_name, entry, name_length, numitems)
|
||||
if (numitems == 1) /* 1st match */
|
||||
copyn(extended_name, entry, MAXNAMLEN);
|
||||
else { /* 2nd & subsequent matches */
|
||||
Char *x, *ent;
|
||||
int len = 0;
|
||||
register Char *x, *ent;
|
||||
register int len = 0;
|
||||
|
||||
x = extended_name;
|
||||
for (ent = entry; *x && *x == *ent++; x++, len++)
|
||||
@@ -566,7 +567,7 @@ recognize(extended_name, entry, name_length, numitems)
|
||||
*/
|
||||
static int
|
||||
is_prefix(check, template)
|
||||
Char *check, *template;
|
||||
register Char *check, *template;
|
||||
{
|
||||
do
|
||||
if (*check == 0)
|
||||
@@ -583,7 +584,7 @@ static int
|
||||
is_suffix(check, template)
|
||||
Char *check, *template;
|
||||
{
|
||||
Char *c, *t;
|
||||
register Char *c, *t;
|
||||
|
||||
for (c = check; *c++;)
|
||||
continue;
|
||||
@@ -602,7 +603,7 @@ tenex(inputline, inputline_size)
|
||||
Char *inputline;
|
||||
int inputline_size;
|
||||
{
|
||||
int numitems, num_read;
|
||||
register int numitems, num_read;
|
||||
char tinputline[BUFSIZ];
|
||||
|
||||
|
||||
@@ -612,8 +613,8 @@ tenex(inputline, inputline_size)
|
||||
int i;
|
||||
static Char delims[] = {' ', '\'', '"', '\t', ';', '&', '<',
|
||||
'>', '(', ')', '|', '^', '%', '\0'};
|
||||
Char *str_end, *word_start, last_Char, should_retype;
|
||||
int space_left;
|
||||
register Char *str_end, *word_start, last_Char, should_retype;
|
||||
register int space_left;
|
||||
COMMAND command;
|
||||
|
||||
for (i = 0; i < num_read; i++)
|
||||
@@ -670,10 +671,10 @@ tenex(inputline, inputline_size)
|
||||
|
||||
static int
|
||||
ignored(entry)
|
||||
Char *entry;
|
||||
register Char *entry;
|
||||
{
|
||||
struct varent *vp;
|
||||
Char **cp;
|
||||
register Char **cp;
|
||||
|
||||
if ((vp = adrof(STRfignore)) == NULL || (cp = vp->vec) == NULL)
|
||||
return (FALSE);
|
||||
|
||||
+57
-72
@@ -29,15 +29,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: func.c,v 1.5 1996/08/11 23:10:38 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)func.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -75,8 +72,8 @@ struct biltins *
|
||||
isbfunc(t)
|
||||
struct command *t;
|
||||
{
|
||||
Char *cp = t->t_dcom[0];
|
||||
struct biltins *bp, *bp1, *bp2;
|
||||
register Char *cp = t->t_dcom[0];
|
||||
register struct biltins *bp, *bp1, *bp2;
|
||||
static struct biltins label = {"", dozip, 0, 0};
|
||||
static struct biltins foregnd = {"%job", dofg1, 0, 0};
|
||||
static struct biltins backgnd = {"%job &", dobg1, 0, 0};
|
||||
@@ -99,7 +96,7 @@ isbfunc(t)
|
||||
* one past the end.
|
||||
*/
|
||||
for (bp1 = bfunc, bp2 = bfunc + nbfunc; bp1 < bp2;) {
|
||||
int i;
|
||||
register i;
|
||||
|
||||
bp = bp1 + ((bp2 - bp1) >> 1);
|
||||
if ((i = *cp - *bp->bname) == 0 &&
|
||||
@@ -115,8 +112,8 @@ isbfunc(t)
|
||||
|
||||
void
|
||||
func(t, bp)
|
||||
struct command *t;
|
||||
struct biltins *bp;
|
||||
register struct command *t;
|
||||
register struct biltins *bp;
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -136,8 +133,8 @@ doonintr(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
Char *cp;
|
||||
Char *vv = v[1];
|
||||
register Char *cp;
|
||||
register Char *vv = v[1];
|
||||
|
||||
if (parintr == SIG_IGN)
|
||||
return;
|
||||
@@ -197,8 +194,8 @@ doalias(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct varent *vp;
|
||||
Char *p;
|
||||
register struct varent *vp;
|
||||
register Char *p;
|
||||
|
||||
v++;
|
||||
p = *v++;
|
||||
@@ -268,8 +265,8 @@ doif(v, kp)
|
||||
Char **v;
|
||||
struct command *kp;
|
||||
{
|
||||
int i;
|
||||
Char **vv;
|
||||
register int i;
|
||||
register Char **vv;
|
||||
|
||||
v++;
|
||||
i = expr(&v);
|
||||
@@ -305,7 +302,7 @@ doif(v, kp)
|
||||
*/
|
||||
static void
|
||||
reexecute(kp)
|
||||
struct command *kp;
|
||||
register struct command *kp;
|
||||
{
|
||||
kp->t_dflg &= F_SAVE;
|
||||
kp->t_dflg |= F_REPEAT;
|
||||
@@ -342,7 +339,7 @@ void
|
||||
gotolab(lab)
|
||||
Char *lab;
|
||||
{
|
||||
struct whyle *wp;
|
||||
register struct whyle *wp;
|
||||
/*
|
||||
* While we still can, locate any unknown ends of existing loops. This
|
||||
* obscure code is the WORST result of the fact that we don't really parse.
|
||||
@@ -368,7 +365,7 @@ doswitch(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
Char *cp, *lp;
|
||||
register Char *cp, *lp;
|
||||
|
||||
v++;
|
||||
if (!*v || *(*v++) != '(')
|
||||
@@ -422,8 +419,8 @@ doforeach(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
Char *cp, *sp;
|
||||
struct whyle *nwp;
|
||||
register Char *cp, *sp;
|
||||
register struct whyle *nwp;
|
||||
|
||||
v++;
|
||||
sp = cp = strip(*v);
|
||||
@@ -466,8 +463,8 @@ dowhile(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
int status;
|
||||
bool again = whyles != 0 && SEEKEQ(&whyles->w_start, &lineloc) &&
|
||||
register int status;
|
||||
register bool again = whyles != 0 && SEEKEQ(&whyles->w_start, &lineloc) &&
|
||||
whyles->w_fename == 0;
|
||||
|
||||
v++;
|
||||
@@ -482,7 +479,7 @@ dowhile(v, t)
|
||||
if (*v)
|
||||
stderror(ERR_NAME | ERR_EXPRESSION);
|
||||
if (!again) {
|
||||
struct whyle *nwp =
|
||||
register struct whyle *nwp =
|
||||
(struct whyle *) xcalloc(1, sizeof(*nwp));
|
||||
|
||||
nwp->w_start = lineloc;
|
||||
@@ -510,7 +507,7 @@ preread()
|
||||
{
|
||||
whyles->w_end.type = I_SEEK;
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
|
||||
search(T_BREAK, 0, NULL); /* read the expression in */
|
||||
if (setintr)
|
||||
@@ -567,8 +564,8 @@ dorepeat(v, kp)
|
||||
Char **v;
|
||||
struct command *kp;
|
||||
{
|
||||
int i;
|
||||
int omask = 0;
|
||||
register int i;
|
||||
register sigset_t omask = 0;
|
||||
|
||||
i = getn(v[1]);
|
||||
if (setintr)
|
||||
@@ -596,10 +593,10 @@ doswbrk(v, t)
|
||||
|
||||
int
|
||||
srchx(cp)
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
{
|
||||
struct srch *sp, *sp1, *sp2;
|
||||
int i;
|
||||
register struct srch *sp, *sp1, *sp2;
|
||||
register i;
|
||||
|
||||
/*
|
||||
* Binary search Sp1 is the beginning of the current search range. Sp2 is
|
||||
@@ -625,12 +622,12 @@ static Char *Sgoal;
|
||||
static void
|
||||
search(type, level, goal)
|
||||
int type;
|
||||
int level;
|
||||
register int level;
|
||||
Char *goal;
|
||||
{
|
||||
Char wordbuf[BUFSIZ];
|
||||
Char *aword = wordbuf;
|
||||
Char *cp;
|
||||
register Char *aword = wordbuf;
|
||||
register Char *cp;
|
||||
|
||||
Stype = type;
|
||||
Sgoal = goal;
|
||||
@@ -725,10 +722,10 @@ search(type, level, goal)
|
||||
|
||||
static int
|
||||
getword(wp)
|
||||
Char *wp;
|
||||
register Char *wp;
|
||||
{
|
||||
int found = 0;
|
||||
int c, d;
|
||||
register int found = 0;
|
||||
register int c, d;
|
||||
int kwd = 0;
|
||||
Char *owp = wp;
|
||||
|
||||
@@ -854,7 +851,7 @@ wfree()
|
||||
btell(&o);
|
||||
|
||||
for (; whyles; whyles = nwp) {
|
||||
struct whyle *wp = whyles;
|
||||
register struct whyle *wp = whyles;
|
||||
nwp = wp->w_next;
|
||||
|
||||
/*
|
||||
@@ -904,13 +901,13 @@ doglob(v, t)
|
||||
static void
|
||||
xecho(sep, v)
|
||||
int sep;
|
||||
Char **v;
|
||||
register Char **v;
|
||||
{
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
int nonl = 0;
|
||||
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
v++;
|
||||
if (*v == 0)
|
||||
return;
|
||||
@@ -927,7 +924,7 @@ xecho(sep, v)
|
||||
if (sep == ' ' && *v && eq(*v, STRmn))
|
||||
nonl++, v++;
|
||||
while ((cp = *v++) != NULL) {
|
||||
int c;
|
||||
register int c;
|
||||
|
||||
while ((c = *cp++) != '\0')
|
||||
(void) vis_fputc(c | QUOTE, cshout);
|
||||
@@ -955,10 +952,10 @@ dosetenv(v, t)
|
||||
|
||||
v++;
|
||||
if ((vp = *v++) == 0) {
|
||||
Char **ep;
|
||||
register Char **ep;
|
||||
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
for (ep = STR_environ; *ep; ep++)
|
||||
(void) fprintf(cshout, "%s\n", vis_str(*ep));
|
||||
return;
|
||||
@@ -1048,8 +1045,8 @@ void
|
||||
Setenv(name, val)
|
||||
Char *name, *val;
|
||||
{
|
||||
Char **ep = STR_environ;
|
||||
Char *cp, *dp;
|
||||
register Char **ep = STR_environ;
|
||||
register Char *cp, *dp;
|
||||
Char *blk[2];
|
||||
Char **oep = ep;
|
||||
|
||||
@@ -1081,8 +1078,8 @@ static void
|
||||
Unsetenv(name)
|
||||
Char *name;
|
||||
{
|
||||
Char **ep = STR_environ;
|
||||
Char *cp, *dp;
|
||||
register Char **ep = STR_environ;
|
||||
register Char *cp, *dp;
|
||||
Char **oep = ep;
|
||||
|
||||
for (; *ep; ep++) {
|
||||
@@ -1107,8 +1104,8 @@ doumask(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
Char *cp = v[1];
|
||||
int i;
|
||||
register Char *cp = v[1];
|
||||
register int i;
|
||||
|
||||
if (cp == 0) {
|
||||
i = umask(0);
|
||||
@@ -1154,7 +1151,7 @@ static struct limits *
|
||||
findlim(cp)
|
||||
Char *cp;
|
||||
{
|
||||
struct limits *lp, *res;
|
||||
register struct limits *lp, *res;
|
||||
|
||||
res = (struct limits *) NULL;
|
||||
for (lp = limits; lp->limconst >= 0; lp++)
|
||||
@@ -1176,8 +1173,8 @@ dolimit(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct limits *lp;
|
||||
RLIM_TYPE limit;
|
||||
register struct limits *lp;
|
||||
register RLIM_TYPE limit;
|
||||
char hard = 0;
|
||||
|
||||
v++;
|
||||
@@ -1202,10 +1199,11 @@ dolimit(v, t)
|
||||
|
||||
static RLIM_TYPE
|
||||
getval(lp, v)
|
||||
struct limits *lp;
|
||||
register struct limits *lp;
|
||||
Char **v;
|
||||
{
|
||||
float f;
|
||||
register float f;
|
||||
double atof();
|
||||
Char *cp = *v++;
|
||||
|
||||
f = atof(short2str(cp));
|
||||
@@ -1285,7 +1283,7 @@ limtail(cp, str)
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
plim(lp, hard)
|
||||
struct limits *lp;
|
||||
register struct limits *lp;
|
||||
Char hard;
|
||||
{
|
||||
struct rlimit rlim;
|
||||
@@ -1312,7 +1310,7 @@ dounlimit(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct limits *lp;
|
||||
register struct limits *lp;
|
||||
int lerr = 0;
|
||||
Char hard = 0;
|
||||
|
||||
@@ -1338,7 +1336,7 @@ dounlimit(v, t)
|
||||
|
||||
static int
|
||||
setlim(lp, hard, limit)
|
||||
struct limits *lp;
|
||||
register struct limits *lp;
|
||||
Char hard;
|
||||
RLIM_TYPE limit;
|
||||
{
|
||||
@@ -1370,7 +1368,7 @@ dosuspend(v, t)
|
||||
{
|
||||
int ctpgrp;
|
||||
|
||||
void (*old) __P((int));
|
||||
void (*old) ();
|
||||
|
||||
if (loginsh)
|
||||
stderror(ERR_SUSPLOG);
|
||||
@@ -1396,7 +1394,7 @@ dosuspend(v, t)
|
||||
/* This is the dreaded EVAL built-in.
|
||||
* If you don't fiddle with file descriptors, and reset didfds,
|
||||
* this command will either ignore redirection inside or outside
|
||||
* its arguments, e.g. eval "date >x" vs. eval "date" >x
|
||||
* its aguments, e.g. eval "date >x" vs. eval "date" >x
|
||||
* The stuff here seems to work, but I did it by trial and error rather
|
||||
* than really knowing what was going on. If tpgrp is zero, we are
|
||||
* probably a background eval, e.g. "eval date &", and we want to
|
||||
@@ -1491,23 +1489,10 @@ doprintf(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
Char **newv;
|
||||
char **c;
|
||||
extern int progprintf __P((int, char **));
|
||||
int ret;
|
||||
|
||||
gflag = 0;
|
||||
tglob(v);
|
||||
if (gflag) {
|
||||
newv = globall(v);
|
||||
if (newv == 0) {
|
||||
stderror(ERR_NAME | ERR_NOMATCH);
|
||||
return;
|
||||
}
|
||||
v = newv;
|
||||
gargv=0;
|
||||
}
|
||||
|
||||
ret = progprintf(blklen(v), c = short2blk(v));
|
||||
(void) fflush(cshout);
|
||||
(void) fflush(csherr);
|
||||
|
||||
+18
-19
@@ -29,20 +29,19 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: glob.c,v 1.6 1996/10/31 07:22:48 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)glob.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <glob.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#if __STDC__
|
||||
@@ -554,10 +553,10 @@ ginit()
|
||||
|
||||
void
|
||||
rscan(t, f)
|
||||
Char **t;
|
||||
void (*f) __P((int));
|
||||
register Char **t;
|
||||
void (*f) ();
|
||||
{
|
||||
Char *p;
|
||||
register Char *p;
|
||||
|
||||
while ((p = *t++) != NULL)
|
||||
while (*p)
|
||||
@@ -566,9 +565,9 @@ rscan(t, f)
|
||||
|
||||
void
|
||||
trim(t)
|
||||
Char **t;
|
||||
register Char **t;
|
||||
{
|
||||
Char *p;
|
||||
register Char *p;
|
||||
|
||||
while ((p = *t++) != NULL)
|
||||
while (*p)
|
||||
@@ -577,9 +576,9 @@ trim(t)
|
||||
|
||||
void
|
||||
tglob(t)
|
||||
Char **t;
|
||||
register Char **t;
|
||||
{
|
||||
Char *p, c;
|
||||
register Char *p, c;
|
||||
|
||||
while ((p = *t++) != NULL) {
|
||||
if (*p == '~' || *p == '=')
|
||||
@@ -623,7 +622,7 @@ dobackp(cp, literal)
|
||||
Char *cp;
|
||||
bool literal;
|
||||
{
|
||||
Char *lp, *rp;
|
||||
register Char *lp, *rp;
|
||||
Char *ep, word[MAXPATHLEN];
|
||||
|
||||
if (pargv) {
|
||||
@@ -668,8 +667,8 @@ backeval(cp, literal)
|
||||
Char *cp;
|
||||
bool literal;
|
||||
{
|
||||
int icnt, c;
|
||||
Char *ip;
|
||||
register int icnt, c;
|
||||
register Char *ip;
|
||||
struct command faket;
|
||||
bool hadnl;
|
||||
int pvec[2], quoted;
|
||||
@@ -852,9 +851,9 @@ Gmatch(string, pattern)
|
||||
|
||||
static int
|
||||
pmatch(string, pattern)
|
||||
Char *string, *pattern;
|
||||
register Char *string, *pattern;
|
||||
{
|
||||
Char stringc, patternc;
|
||||
register Char stringc, patternc;
|
||||
int match, negate_range;
|
||||
Char rangec;
|
||||
|
||||
@@ -911,7 +910,7 @@ void
|
||||
Gcat(s1, s2)
|
||||
Char *s1, *s2;
|
||||
{
|
||||
Char *p, *q;
|
||||
register Char *p, *q;
|
||||
int n;
|
||||
|
||||
for (p = s1; *p++;)
|
||||
@@ -935,7 +934,7 @@ Gcat(s1, s2)
|
||||
#ifdef FILEC
|
||||
int
|
||||
sortscmp(a, b)
|
||||
const ptr_t a, b;
|
||||
register const ptr_t a, b;
|
||||
{
|
||||
#if defined(NLS) && !defined(NOSTRCOLL)
|
||||
char buf[2048];
|
||||
|
||||
+11
-13
@@ -29,18 +29,16 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: hist.c,v 1.2 1994/09/24 02:54:06 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#if __STDC__
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
@@ -58,8 +56,8 @@ void
|
||||
savehist(sp)
|
||||
struct wordent *sp;
|
||||
{
|
||||
struct Hist *hp, *np;
|
||||
int histlen = 0;
|
||||
register struct Hist *hp, *np;
|
||||
register int histlen = 0;
|
||||
Char *cp;
|
||||
|
||||
/* throw away null lines */
|
||||
@@ -67,7 +65,7 @@ savehist(sp)
|
||||
return;
|
||||
cp = value(STRhistory);
|
||||
if (*cp) {
|
||||
Char *p = cp;
|
||||
register Char *p = cp;
|
||||
|
||||
while (*p) {
|
||||
if (!Isdigit(*p)) {
|
||||
@@ -88,10 +86,10 @@ savehist(sp)
|
||||
struct Hist *
|
||||
enthist(event, lp, docopy)
|
||||
int event;
|
||||
struct wordent *lp;
|
||||
register struct wordent *lp;
|
||||
bool docopy;
|
||||
{
|
||||
struct Hist *np;
|
||||
register struct Hist *np;
|
||||
|
||||
np = (struct Hist *) xmalloc((size_t) sizeof(*np));
|
||||
np->Hnum = np->Href = event;
|
||||
@@ -111,7 +109,7 @@ enthist(event, lp, docopy)
|
||||
|
||||
static void
|
||||
hfree(hp)
|
||||
struct Hist *hp;
|
||||
register struct Hist *hp;
|
||||
{
|
||||
|
||||
freelex(&hp->Hlex);
|
||||
@@ -129,7 +127,7 @@ dohist(v, t)
|
||||
if (getn(value(STRhistory)) == 0)
|
||||
return;
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
while (*++v && **v == '-') {
|
||||
Char *vp = *v;
|
||||
|
||||
@@ -179,7 +177,7 @@ dohist1(hp, np, rflg, hflg)
|
||||
|
||||
static void
|
||||
phist(hp, hflg)
|
||||
struct Hist *hp;
|
||||
register struct Hist *hp;
|
||||
int hflg;
|
||||
{
|
||||
if (hflg == 0)
|
||||
|
||||
+3
-5
@@ -29,15 +29,13 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: init.c,v 1.2 1994/09/24 02:54:07 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
/*###9 [cc] warning: `sccsid' defined but not used%%%*/
|
||||
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#if __STDC__
|
||||
|
||||
+50
-52
@@ -29,21 +29,19 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: lex.c,v 1.4 1995/08/10 05:13:42 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)lex.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#if __STDC__
|
||||
@@ -144,9 +142,9 @@ static Char getCtmp;
|
||||
|
||||
int
|
||||
lex(hp)
|
||||
struct wordent *hp;
|
||||
register struct wordent *hp;
|
||||
{
|
||||
struct wordent *wdp;
|
||||
register struct wordent *wdp;
|
||||
int c;
|
||||
|
||||
btell(&lineloc);
|
||||
@@ -167,7 +165,7 @@ lex(hp)
|
||||
* be ready and rarin to go even if it is interrupted.
|
||||
*/
|
||||
do {
|
||||
struct wordent *new;
|
||||
register struct wordent *new;
|
||||
|
||||
new = (struct wordent *) xmalloc((size_t) sizeof(*wdp));
|
||||
new->word = 0;
|
||||
@@ -186,7 +184,7 @@ prlex(fp, sp0)
|
||||
FILE *fp;
|
||||
struct wordent *sp0;
|
||||
{
|
||||
struct wordent *sp = sp0->next;
|
||||
register struct wordent *sp = sp0->next;
|
||||
|
||||
for (;;) {
|
||||
(void) fprintf(fp, "%s", vis_str(sp->word));
|
||||
@@ -200,15 +198,15 @@ prlex(fp, sp0)
|
||||
|
||||
void
|
||||
copylex(hp, fp)
|
||||
struct wordent *hp;
|
||||
struct wordent *fp;
|
||||
register struct wordent *hp;
|
||||
register struct wordent *fp;
|
||||
{
|
||||
struct wordent *wdp;
|
||||
register struct wordent *wdp;
|
||||
|
||||
wdp = hp;
|
||||
fp = fp->next;
|
||||
do {
|
||||
struct wordent *new;
|
||||
register struct wordent *new;
|
||||
|
||||
new = (struct wordent *) xmalloc((size_t) sizeof(*wdp));
|
||||
new->prev = wdp;
|
||||
@@ -223,9 +221,9 @@ copylex(hp, fp)
|
||||
|
||||
void
|
||||
freelex(vp)
|
||||
struct wordent *vp;
|
||||
register struct wordent *vp;
|
||||
{
|
||||
struct wordent *fp;
|
||||
register struct wordent *fp;
|
||||
|
||||
while (vp->next != vp) {
|
||||
fp = vp->next;
|
||||
@@ -239,11 +237,11 @@ freelex(vp)
|
||||
static Char *
|
||||
word()
|
||||
{
|
||||
Char c, c1;
|
||||
Char *wp;
|
||||
register Char c, c1;
|
||||
register Char *wp;
|
||||
Char wbuf[BUFSIZ];
|
||||
bool dolflg;
|
||||
int i;
|
||||
register bool dolflg;
|
||||
register int i;
|
||||
|
||||
wp = wbuf;
|
||||
i = BUFSIZ - 4;
|
||||
@@ -360,9 +358,9 @@ ret:
|
||||
|
||||
static int
|
||||
getC1(flag)
|
||||
int flag;
|
||||
register int flag;
|
||||
{
|
||||
Char c;
|
||||
register Char c;
|
||||
|
||||
while (1) {
|
||||
if ((c = peekc) != '\0') {
|
||||
@@ -418,9 +416,9 @@ getC1(flag)
|
||||
static void
|
||||
getdol()
|
||||
{
|
||||
Char *np, *ep;
|
||||
register Char *np, *ep;
|
||||
Char name[4 * MAXVARLEN + 1];
|
||||
int c;
|
||||
register int c;
|
||||
int sc;
|
||||
bool special = 0, toolong;
|
||||
|
||||
@@ -652,9 +650,9 @@ static void
|
||||
getexcl(sc)
|
||||
int sc;
|
||||
{
|
||||
struct wordent *hp, *ip;
|
||||
register struct wordent *hp, *ip;
|
||||
int left, right, dol;
|
||||
int c;
|
||||
register int c;
|
||||
|
||||
if (sc == 0) {
|
||||
sc = getC(0);
|
||||
@@ -729,9 +727,9 @@ static struct wordent *
|
||||
getsub(en)
|
||||
struct wordent *en;
|
||||
{
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
int delim;
|
||||
int c;
|
||||
register int c;
|
||||
int sc;
|
||||
bool global;
|
||||
Char orhsb[sizeof(rhsb) / sizeof(Char)];
|
||||
@@ -874,12 +872,12 @@ dosub(sc, en, global)
|
||||
struct wordent lexi;
|
||||
bool didsub = 0, didone = 0;
|
||||
struct wordent *hp = &lexi;
|
||||
struct wordent *wdp;
|
||||
int i = exclc;
|
||||
register struct wordent *wdp;
|
||||
register int i = exclc;
|
||||
|
||||
wdp = hp;
|
||||
while (--i >= 0) {
|
||||
struct wordent *new =
|
||||
register struct wordent *new =
|
||||
(struct wordent *) xcalloc(1, sizeof *wdp);
|
||||
|
||||
new->word = 0;
|
||||
@@ -926,8 +924,8 @@ subword(cp, type, adid)
|
||||
bool *adid;
|
||||
{
|
||||
Char wbuf[BUFSIZ];
|
||||
Char *wp, *mp, *np;
|
||||
int i;
|
||||
register Char *wp, *mp, *np;
|
||||
register int i;
|
||||
|
||||
*adid = 0;
|
||||
switch (type) {
|
||||
@@ -998,8 +996,8 @@ domod(cp, type)
|
||||
Char *cp;
|
||||
int type;
|
||||
{
|
||||
Char *wp, *xp;
|
||||
int c;
|
||||
register Char *wp, *xp;
|
||||
register int c;
|
||||
|
||||
switch (type) {
|
||||
|
||||
@@ -1044,7 +1042,7 @@ domod(cp, type)
|
||||
|
||||
static int
|
||||
matchs(str, pat)
|
||||
Char *str, *pat;
|
||||
register Char *str, *pat;
|
||||
{
|
||||
while (*str && *pat && *str == *pat)
|
||||
str++, pat++;
|
||||
@@ -1053,11 +1051,11 @@ matchs(str, pat)
|
||||
|
||||
static int
|
||||
getsel(al, ar, dol)
|
||||
int *al, *ar;
|
||||
register int *al, *ar;
|
||||
int dol;
|
||||
{
|
||||
int c = getC(0);
|
||||
int i;
|
||||
register int c = getC(0);
|
||||
register int i;
|
||||
bool first = *al < 0;
|
||||
|
||||
switch (c) {
|
||||
@@ -1141,9 +1139,9 @@ static struct wordent *
|
||||
gethent(sc)
|
||||
int sc;
|
||||
{
|
||||
struct Hist *hp;
|
||||
Char *np;
|
||||
int c;
|
||||
register struct Hist *hp;
|
||||
register Char *np;
|
||||
register int c;
|
||||
int event;
|
||||
bool back = 0;
|
||||
|
||||
@@ -1179,7 +1177,7 @@ gethent(sc)
|
||||
case '-':
|
||||
back = 1;
|
||||
c = getC(0);
|
||||
/* FALLTHROUGH */
|
||||
/* FALLSTHROUGH */
|
||||
|
||||
default:
|
||||
if (any("(=~", c)) {
|
||||
@@ -1260,12 +1258,12 @@ findev(cp, anyarg)
|
||||
Char *cp;
|
||||
bool anyarg;
|
||||
{
|
||||
struct Hist *hp;
|
||||
register struct Hist *hp;
|
||||
|
||||
for (hp = Histlist.Hnext; hp; hp = hp->Hnext) {
|
||||
Char *dp;
|
||||
Char *p, *q;
|
||||
struct wordent *lp = hp->Hlex.next;
|
||||
register Char *p, *q;
|
||||
register struct wordent *lp = hp->Hlex.next;
|
||||
int argno = 0;
|
||||
|
||||
/*
|
||||
@@ -1309,7 +1307,7 @@ findev(cp, anyarg)
|
||||
|
||||
static void
|
||||
setexclp(cp)
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
{
|
||||
if (cp && cp[0] == '\n')
|
||||
return;
|
||||
@@ -1327,7 +1325,7 @@ int
|
||||
readc(wanteof)
|
||||
bool wanteof;
|
||||
{
|
||||
int c;
|
||||
register int c;
|
||||
static sincereal;
|
||||
|
||||
aret = F_SEEK;
|
||||
@@ -1442,10 +1440,10 @@ reread:
|
||||
static int
|
||||
bgetc()
|
||||
{
|
||||
int buf, off, c;
|
||||
register int buf, off, c;
|
||||
|
||||
#ifdef FILEC
|
||||
int numleft = 0, roomleft;
|
||||
register int numleft = 0, roomleft;
|
||||
Char ttyline[BUFSIZ];
|
||||
#endif
|
||||
char tbuf[BUFSIZ + 1];
|
||||
@@ -1476,7 +1474,7 @@ bgetc()
|
||||
again:
|
||||
buf = (int) fseekp / BUFSIZ;
|
||||
if (buf >= fblocks) {
|
||||
Char **nfbuf =
|
||||
register Char **nfbuf =
|
||||
(Char **) xcalloc((size_t) (fblocks + 2),
|
||||
sizeof(Char **));
|
||||
|
||||
@@ -1507,7 +1505,7 @@ again:
|
||||
goto again;
|
||||
}
|
||||
if (c > 0)
|
||||
memmove(fbuf[buf] + off, ttyline, c * sizeof(Char));
|
||||
bcopy(ttyline, fbuf[buf] + off, c * sizeof(Char));
|
||||
numleft = 0;
|
||||
}
|
||||
else {
|
||||
@@ -1551,7 +1549,7 @@ again:
|
||||
static void
|
||||
bfree()
|
||||
{
|
||||
int sb, i;
|
||||
register int sb, i;
|
||||
|
||||
if (cantell)
|
||||
return;
|
||||
|
||||
+35
-37
@@ -29,18 +29,16 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: misc.c,v 1.3 1996/09/28 14:32:01 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#if __STDC__
|
||||
# include <stdarg.h>
|
||||
@@ -55,8 +53,8 @@ static int renum __P((int, int));
|
||||
|
||||
int
|
||||
any(s, c)
|
||||
char *s;
|
||||
int c;
|
||||
register char *s;
|
||||
register int c;
|
||||
{
|
||||
if (!s)
|
||||
return (0); /* Check for nil pointer */
|
||||
@@ -79,10 +77,10 @@ setzero(cp, i)
|
||||
|
||||
char *
|
||||
strsave(s)
|
||||
char *s;
|
||||
register char *s;
|
||||
{
|
||||
char *n;
|
||||
char *p;
|
||||
register char *p;
|
||||
|
||||
if (s == NULL)
|
||||
s = "";
|
||||
@@ -96,7 +94,7 @@ strsave(s)
|
||||
|
||||
Char **
|
||||
blkend(up)
|
||||
Char **up;
|
||||
register Char **up;
|
||||
{
|
||||
|
||||
while (*up)
|
||||
@@ -108,7 +106,7 @@ blkend(up)
|
||||
void
|
||||
blkpr(fp, av)
|
||||
FILE *fp;
|
||||
Char **av;
|
||||
register Char **av;
|
||||
{
|
||||
|
||||
for (; *av; av++) {
|
||||
@@ -120,9 +118,9 @@ blkpr(fp, av)
|
||||
|
||||
int
|
||||
blklen(av)
|
||||
Char **av;
|
||||
register Char **av;
|
||||
{
|
||||
int i = 0;
|
||||
register int i = 0;
|
||||
|
||||
while (*av++)
|
||||
i++;
|
||||
@@ -132,9 +130,9 @@ blklen(av)
|
||||
Char **
|
||||
blkcpy(oav, bv)
|
||||
Char **oav;
|
||||
Char **bv;
|
||||
register Char **bv;
|
||||
{
|
||||
Char **av = oav;
|
||||
register Char **av = oav;
|
||||
|
||||
while ((*av++ = *bv++) != NULL)
|
||||
continue;
|
||||
@@ -154,7 +152,7 @@ void
|
||||
blkfree(av0)
|
||||
Char **av0;
|
||||
{
|
||||
Char **av = av0;
|
||||
register Char **av = av0;
|
||||
|
||||
if (!av0)
|
||||
return;
|
||||
@@ -165,9 +163,9 @@ blkfree(av0)
|
||||
|
||||
Char **
|
||||
saveblk(v)
|
||||
Char **v;
|
||||
register Char **v;
|
||||
{
|
||||
Char **newv =
|
||||
register Char **newv =
|
||||
(Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **));
|
||||
Char **onewv = newv;
|
||||
|
||||
@@ -179,11 +177,11 @@ saveblk(v)
|
||||
#ifdef NOTUSED
|
||||
char *
|
||||
strstr(s, t)
|
||||
char *s, *t;
|
||||
register char *s, *t;
|
||||
{
|
||||
do {
|
||||
char *ss = s;
|
||||
char *tt = t;
|
||||
register char *ss = s;
|
||||
register char *tt = t;
|
||||
|
||||
do
|
||||
if (*tt == '\0')
|
||||
@@ -201,7 +199,7 @@ strspl(cp, dp)
|
||||
char *cp, *dp;
|
||||
{
|
||||
char *ep;
|
||||
char *p, *q;
|
||||
register char *p, *q;
|
||||
|
||||
if (!cp)
|
||||
cp = "";
|
||||
@@ -223,9 +221,9 @@ strspl(cp, dp)
|
||||
|
||||
Char **
|
||||
blkspl(up, vp)
|
||||
Char **up, **vp;
|
||||
register Char **up, **vp;
|
||||
{
|
||||
Char **wp =
|
||||
register Char **wp =
|
||||
(Char **) xcalloc((size_t) (blklen(up) + blklen(vp) + 1),
|
||||
sizeof(Char **));
|
||||
|
||||
@@ -235,7 +233,7 @@ blkspl(up, vp)
|
||||
|
||||
Char
|
||||
lastchr(cp)
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
{
|
||||
|
||||
if (!cp)
|
||||
@@ -254,7 +252,7 @@ lastchr(cp)
|
||||
void
|
||||
closem()
|
||||
{
|
||||
int f, flimit;
|
||||
register int f, flimit;
|
||||
|
||||
for (f = 0, flimit = getdtablesize(); f < flimit; f++)
|
||||
if (f != SHIN && f != SHOUT && f != SHERR && f != OLDSTD &&
|
||||
@@ -279,7 +277,7 @@ donefds()
|
||||
*/
|
||||
int
|
||||
dmove(i, j)
|
||||
int i, j;
|
||||
register int i, j;
|
||||
{
|
||||
|
||||
if (i == j || i < 0)
|
||||
@@ -298,7 +296,7 @@ dmove(i, j)
|
||||
|
||||
int
|
||||
dcopy(i, j)
|
||||
int i, j;
|
||||
register int i, j;
|
||||
{
|
||||
|
||||
if (i == j || i < 0 || (j < 0 && i > 2))
|
||||
@@ -313,9 +311,9 @@ dcopy(i, j)
|
||||
|
||||
static int
|
||||
renum(i, j)
|
||||
int i, j;
|
||||
register int i, j;
|
||||
{
|
||||
int k = dup(i);
|
||||
register int k = dup(i);
|
||||
|
||||
if (k < 0)
|
||||
return (-1);
|
||||
@@ -336,10 +334,10 @@ renum(i, j)
|
||||
*/
|
||||
void
|
||||
lshift(v, c)
|
||||
Char **v;
|
||||
int c;
|
||||
register Char **v;
|
||||
register int c;
|
||||
{
|
||||
Char **u;
|
||||
register Char **u;
|
||||
|
||||
for (u = v; *u && --c >= 0; u++)
|
||||
xfree((ptr_t) *u);
|
||||
@@ -365,7 +363,7 @@ number(cp)
|
||||
|
||||
Char **
|
||||
copyblk(v)
|
||||
Char **v;
|
||||
register Char **v;
|
||||
{
|
||||
Char **nv = (Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **));
|
||||
|
||||
@@ -375,7 +373,7 @@ copyblk(v)
|
||||
#ifndef SHORT_STRINGS
|
||||
char *
|
||||
strend(cp)
|
||||
char *cp;
|
||||
register char *cp;
|
||||
{
|
||||
if (!cp)
|
||||
return (cp);
|
||||
@@ -390,7 +388,7 @@ Char *
|
||||
strip(cp)
|
||||
Char *cp;
|
||||
{
|
||||
Char *dp = cp;
|
||||
register Char *dp = cp;
|
||||
|
||||
if (!cp)
|
||||
return (cp);
|
||||
@@ -410,7 +408,7 @@ udvar(name)
|
||||
|
||||
int
|
||||
prefix(sub, str)
|
||||
Char *sub, *str;
|
||||
register Char *sub, *str;
|
||||
{
|
||||
|
||||
for (;;) {
|
||||
|
||||
+32
-34
@@ -29,18 +29,16 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: parse.c,v 1.3 1995/05/30 00:06:37 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#if __STDC__
|
||||
# include <stdarg.h>
|
||||
@@ -81,7 +79,7 @@ static int aleft;
|
||||
extern int hleft;
|
||||
void
|
||||
alias(lex)
|
||||
struct wordent *lex;
|
||||
register struct wordent *lex;
|
||||
{
|
||||
jmp_buf osetexit;
|
||||
|
||||
@@ -101,7 +99,7 @@ alias(lex)
|
||||
|
||||
static void
|
||||
asyntax(p1, p2)
|
||||
struct wordent *p1, *p2;
|
||||
register struct wordent *p1, *p2;
|
||||
{
|
||||
while (p1 != p2)
|
||||
if (any(";&\n", p1->word[0]))
|
||||
@@ -115,10 +113,10 @@ asyntax(p1, p2)
|
||||
static void
|
||||
asyn0(p1, p2)
|
||||
struct wordent *p1;
|
||||
struct wordent *p2;
|
||||
register struct wordent *p2;
|
||||
{
|
||||
struct wordent *p;
|
||||
int l = 0;
|
||||
register struct wordent *p;
|
||||
register int l = 0;
|
||||
|
||||
for (p = p1; p != p2; p = p->next)
|
||||
switch (p->word[0]) {
|
||||
@@ -155,11 +153,11 @@ asyn0(p1, p2)
|
||||
static void
|
||||
asyn3(p1, p2)
|
||||
struct wordent *p1;
|
||||
struct wordent *p2;
|
||||
register struct wordent *p2;
|
||||
{
|
||||
struct varent *ap;
|
||||
register struct varent *ap;
|
||||
struct wordent alout;
|
||||
bool redid;
|
||||
register bool redid;
|
||||
|
||||
if (p1 == p2)
|
||||
return;
|
||||
@@ -205,9 +203,9 @@ asyn3(p1, p2)
|
||||
|
||||
static struct wordent *
|
||||
freenod(p1, p2)
|
||||
struct wordent *p1, *p2;
|
||||
register struct wordent *p1, *p2;
|
||||
{
|
||||
struct wordent *retp = p1->prev;
|
||||
register struct wordent *retp = p1->prev;
|
||||
|
||||
while (p1 != p2) {
|
||||
xfree((ptr_t) p1->word);
|
||||
@@ -231,7 +229,7 @@ freenod(p1, p2)
|
||||
*/
|
||||
struct command *
|
||||
syntax(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
register struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
|
||||
@@ -253,8 +251,8 @@ syn0(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
struct wordent *p;
|
||||
struct command *t, *t1;
|
||||
register struct wordent *p;
|
||||
register struct command *t, *t1;
|
||||
int l;
|
||||
|
||||
l = 0;
|
||||
@@ -321,8 +319,8 @@ syn1(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
struct wordent *p;
|
||||
struct command *t;
|
||||
register struct wordent *p;
|
||||
register struct command *t;
|
||||
int l;
|
||||
|
||||
l = 0;
|
||||
@@ -362,9 +360,9 @@ syn1a(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
struct wordent *p;
|
||||
struct command *t;
|
||||
int l = 0;
|
||||
register struct wordent *p;
|
||||
register struct command *t;
|
||||
register int l = 0;
|
||||
|
||||
for (p = p1; p != p2; p = p->next)
|
||||
switch (p->word[0]) {
|
||||
@@ -403,9 +401,9 @@ syn1b(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
struct wordent *p;
|
||||
struct command *t;
|
||||
int l = 0;
|
||||
register struct wordent *p;
|
||||
register struct command *t;
|
||||
register int l = 0;
|
||||
|
||||
for (p = p1; p != p2; p = p->next)
|
||||
switch (p->word[0]) {
|
||||
@@ -443,9 +441,9 @@ syn2(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
struct wordent *p, *pn;
|
||||
struct command *t;
|
||||
int l = 0;
|
||||
register struct wordent *p, *pn;
|
||||
register struct command *t;
|
||||
register int l = 0;
|
||||
int f;
|
||||
|
||||
for (p = p1; p != p2; p = p->next)
|
||||
@@ -494,10 +492,10 @@ syn3(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
struct wordent *p;
|
||||
register struct wordent *p;
|
||||
struct wordent *lp, *rp;
|
||||
struct command *t;
|
||||
int l;
|
||||
register struct command *t;
|
||||
register int l;
|
||||
Char **av;
|
||||
int n, c;
|
||||
bool specp = 0;
|
||||
@@ -670,9 +668,9 @@ again:
|
||||
|
||||
void
|
||||
freesyn(t)
|
||||
struct command *t;
|
||||
register struct command *t;
|
||||
{
|
||||
Char **v;
|
||||
register Char **v;
|
||||
|
||||
if (t == 0)
|
||||
return;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/*-
|
||||
/*
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)pathnames.h 8.1 (Berkeley) 5/31/93
|
||||
* $FreeBSD$
|
||||
* $Id: pathnames.h,v 1.2 1994/09/24 02:54:12 davidg Exp $
|
||||
*/
|
||||
|
||||
#define _PATH_BIN "/bin"
|
||||
|
||||
+56
-60
@@ -29,17 +29,15 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: proc.c,v 1.2 1994/09/24 02:54:13 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
@@ -76,7 +74,7 @@ static void okpcntl __P((void));
|
||||
* pchild - called at interrupt level by the SIGCHLD signal
|
||||
* indicating that at least one child has terminated or stopped
|
||||
* thus at least one wait system call will definitely return a
|
||||
* child's status. Top level routines (like pwait) must be sure
|
||||
* childs status. Top level routines (like pwait) must be sure
|
||||
* to mask interrupts when playing with the proclist data structures!
|
||||
*/
|
||||
/* ARGUSED */
|
||||
@@ -84,11 +82,10 @@ void
|
||||
pchild(notused)
|
||||
int notused;
|
||||
{
|
||||
struct process *pp;
|
||||
struct process *fp;
|
||||
int pid;
|
||||
register struct process *pp;
|
||||
register struct process *fp;
|
||||
register int pid;
|
||||
extern int insource;
|
||||
int save_errno = errno;
|
||||
union wait w;
|
||||
int jobflags;
|
||||
struct rusage ru;
|
||||
@@ -104,7 +101,6 @@ loop:
|
||||
goto loop;
|
||||
}
|
||||
pnoprocesses = pid == -1;
|
||||
errno = save_errno;
|
||||
return;
|
||||
}
|
||||
for (pp = proclist.p_next; pp != NULL; pp = pp->p_next)
|
||||
@@ -205,9 +201,9 @@ found:
|
||||
void
|
||||
pnote()
|
||||
{
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
int flags;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
|
||||
neednote = 0;
|
||||
for (pp = proclist.p_next; pp != NULL; pp = pp->p_next) {
|
||||
@@ -229,8 +225,8 @@ pnote()
|
||||
void
|
||||
pwait()
|
||||
{
|
||||
struct process *fp, *pp;
|
||||
int omask;
|
||||
register struct process *fp, *pp;
|
||||
sigset_t omask;
|
||||
|
||||
/*
|
||||
* Here's where dead procs get flushed.
|
||||
@@ -257,11 +253,11 @@ pwait()
|
||||
*/
|
||||
void
|
||||
pjwait(pp)
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
{
|
||||
struct process *fp;
|
||||
register struct process *fp;
|
||||
int jobflags, reason;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
|
||||
while (pp->p_pid != pp->p_jobid)
|
||||
pp = pp->p_friends;
|
||||
@@ -349,8 +345,8 @@ dowait(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct process *pp;
|
||||
int omask;
|
||||
register struct process *pp;
|
||||
sigset_t omask;
|
||||
|
||||
pjobs++;
|
||||
omask = sigblock(sigmask(SIGCHLD));
|
||||
@@ -358,7 +354,7 @@ loop:
|
||||
for (pp = proclist.p_next; pp; pp = pp->p_next)
|
||||
if (pp->p_pid && /* pp->p_pid == pp->p_jobid && */
|
||||
pp->p_flags & PRUNNING) {
|
||||
(void) sigpause(0);
|
||||
(void) sigpause((sigset_t) 0);
|
||||
goto loop;
|
||||
}
|
||||
(void) sigsetmask(omask);
|
||||
@@ -371,7 +367,7 @@ loop:
|
||||
static void
|
||||
pflushall()
|
||||
{
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
|
||||
for (pp = proclist.p_next; pp != NULL; pp = pp->p_next)
|
||||
if (pp->p_pid)
|
||||
@@ -385,10 +381,10 @@ pflushall()
|
||||
*/
|
||||
static void
|
||||
pflush(pp)
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
{
|
||||
struct process *np;
|
||||
int idx;
|
||||
register struct process *np;
|
||||
register int idx;
|
||||
|
||||
if (pp->p_pid == 0) {
|
||||
(void) fprintf(csherr, "BUG: process flushed twice");
|
||||
@@ -419,7 +415,7 @@ pflush(pp)
|
||||
*/
|
||||
static void
|
||||
pclrcurr(pp)
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
{
|
||||
|
||||
if (pp == pcurrent)
|
||||
@@ -447,9 +443,9 @@ static Char *cmdp;
|
||||
void
|
||||
palloc(pid, t)
|
||||
int pid;
|
||||
struct command *t;
|
||||
register struct command *t;
|
||||
{
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
int i;
|
||||
|
||||
pp = (struct process *) xcalloc(1, (size_t) sizeof(struct process));
|
||||
@@ -513,7 +509,7 @@ palloc(pid, t)
|
||||
|
||||
static void
|
||||
padd(t)
|
||||
struct command *t;
|
||||
register struct command *t;
|
||||
{
|
||||
Char **argp;
|
||||
|
||||
@@ -574,7 +570,7 @@ static void
|
||||
pads(cp)
|
||||
Char *cp;
|
||||
{
|
||||
int i;
|
||||
register int i;
|
||||
|
||||
/*
|
||||
* Avoid the Quoted Space alias hack! Reported by:
|
||||
@@ -630,7 +626,7 @@ prestjob()
|
||||
void
|
||||
pendjob()
|
||||
{
|
||||
struct process *pp, *tp;
|
||||
register struct process *pp, *tp;
|
||||
|
||||
if (pcurrjob && (pcurrjob->p_flags & (PFOREGND | PSTOPPED)) == 0) {
|
||||
pp = pcurrjob;
|
||||
@@ -652,10 +648,10 @@ pendjob()
|
||||
*/
|
||||
static int
|
||||
pprint(pp, flag)
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
bool flag;
|
||||
{
|
||||
int status, reason;
|
||||
register status, reason;
|
||||
struct process *tp;
|
||||
int jobflags, pstatus;
|
||||
bool hadnl = 1; /* did we just have a newline */
|
||||
@@ -818,13 +814,13 @@ prcomd:
|
||||
|
||||
static void
|
||||
ptprint(tp)
|
||||
struct process *tp;
|
||||
register struct process *tp;
|
||||
{
|
||||
struct timeval tetime, diff;
|
||||
static struct timeval ztime;
|
||||
struct rusage ru;
|
||||
static struct rusage zru;
|
||||
struct process *pp = tp;
|
||||
register struct process *pp = tp;
|
||||
|
||||
ru = zru;
|
||||
tetime = ztime;
|
||||
@@ -846,8 +842,8 @@ dojobs(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct process *pp;
|
||||
int flag = NUMBER | NAME | REASON;
|
||||
register struct process *pp;
|
||||
register int flag = NUMBER | NAME | REASON;
|
||||
int i;
|
||||
|
||||
if (chkstop)
|
||||
@@ -876,7 +872,7 @@ dofg(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
|
||||
okpcntl();
|
||||
++v;
|
||||
@@ -896,7 +892,7 @@ dofg1(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
|
||||
okpcntl();
|
||||
pp = pfind(v[0]);
|
||||
@@ -913,7 +909,7 @@ dobg(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
|
||||
okpcntl();
|
||||
++v;
|
||||
@@ -932,7 +928,7 @@ dobg1(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
|
||||
pp = pfind(v[0]);
|
||||
pstart(pp, 0);
|
||||
@@ -959,8 +955,8 @@ dokill(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
int signum = SIGTERM;
|
||||
char *name;
|
||||
register int signum = SIGTERM;
|
||||
register char *name;
|
||||
|
||||
v++;
|
||||
if (v[0] && v[0][0] == '-') {
|
||||
@@ -1002,10 +998,10 @@ pkill(v, signum)
|
||||
Char **v;
|
||||
int signum;
|
||||
{
|
||||
struct process *pp, *np;
|
||||
int jobflags = 0;
|
||||
register struct process *pp, *np;
|
||||
register int jobflags = 0;
|
||||
int pid, err1 = 0;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
Char *cp;
|
||||
|
||||
omask = sigmask(SIGCHLD);
|
||||
@@ -1085,11 +1081,11 @@ cont:
|
||||
*/
|
||||
void
|
||||
pstart(pp, foregnd)
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
int foregnd;
|
||||
{
|
||||
struct process *np;
|
||||
int omask;
|
||||
register struct process *np;
|
||||
sigset_t omask;
|
||||
long jobflags = 0;
|
||||
|
||||
omask = sigblock(sigmask(SIGCHLD));
|
||||
@@ -1119,7 +1115,7 @@ void
|
||||
panystop(neednl)
|
||||
bool neednl;
|
||||
{
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
|
||||
chkstop = 2;
|
||||
for (pp = proclist.p_next; pp; pp = pp->p_next)
|
||||
@@ -1131,7 +1127,7 @@ struct process *
|
||||
pfind(cp)
|
||||
Char *cp;
|
||||
{
|
||||
struct process *pp, *np;
|
||||
register struct process *pp, *np;
|
||||
|
||||
if (cp == 0 || cp[1] == 0 || eq(cp, STRcent2) || eq(cp, STRcentplus)) {
|
||||
if (pcurrent == NULL)
|
||||
@@ -1155,7 +1151,7 @@ pfind(cp)
|
||||
for (pp = proclist.p_next; pp; pp = pp->p_next)
|
||||
if (pp->p_pid == pp->p_jobid) {
|
||||
if (cp[1] == '?') {
|
||||
Char *dp;
|
||||
register Char *dp;
|
||||
|
||||
for (dp = pp->p_command; *dp; dp++) {
|
||||
if (*dp != cp[2])
|
||||
@@ -1173,7 +1169,7 @@ pfind(cp)
|
||||
}
|
||||
if (np)
|
||||
return (np);
|
||||
stderror(ERR_NAME | (cp[1] == '?' ? ERR_JOBPAT : ERR_NOSUCHJOB));
|
||||
stderror(ERR_NAME | cp[1] == '?' ? ERR_JOBPAT : ERR_NOSUCHJOB);
|
||||
/* NOTREACHED */
|
||||
return (0);
|
||||
}
|
||||
@@ -1184,10 +1180,10 @@ pfind(cp)
|
||||
*/
|
||||
static struct process *
|
||||
pgetcurr(pp)
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
{
|
||||
struct process *np;
|
||||
struct process *xp = NULL;
|
||||
register struct process *np;
|
||||
register struct process *xp = NULL;
|
||||
|
||||
for (np = proclist.p_next; np; np = np->p_next)
|
||||
if (np != pcurrent && np != pp && np->p_pid &&
|
||||
@@ -1209,7 +1205,7 @@ donotify(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct process *pp;
|
||||
register struct process *pp;
|
||||
|
||||
pp = pfind(*++v);
|
||||
pp->p_flags |= PNOTIFY;
|
||||
@@ -1232,10 +1228,10 @@ pfork(t, wanttty)
|
||||
struct command *t; /* command we are forking for */
|
||||
int wanttty;
|
||||
{
|
||||
int pid;
|
||||
register int pid;
|
||||
bool ignint = 0;
|
||||
int pgrp;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
|
||||
/*
|
||||
* A child will be uninterruptible only under very special conditions.
|
||||
@@ -1332,7 +1328,7 @@ void
|
||||
pgetty(wanttty, pgrp)
|
||||
int wanttty, pgrp;
|
||||
{
|
||||
int omask = 0;
|
||||
sigset_t omask = 0;
|
||||
|
||||
/*
|
||||
* christos: I am blocking the tty signals till I've set things
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)proc.h 8.1 (Berkeley) 5/31/93
|
||||
* $FreeBSD$
|
||||
* $Id: proc.h,v 1.2 1994/09/24 02:54:14 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+16
-18
@@ -29,15 +29,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: sem.c,v 1.3 1995/05/30 00:06:37 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)sem.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -45,6 +42,7 @@ static const char rcsid[] =
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#if __STDC__
|
||||
@@ -64,7 +62,7 @@ static void chkclob __P((char *));
|
||||
|
||||
void
|
||||
execute(t, wanttty, pipein, pipeout)
|
||||
struct command *t;
|
||||
register struct command *t;
|
||||
int wanttty, *pipein, *pipeout;
|
||||
{
|
||||
bool forked = 0;
|
||||
@@ -72,9 +70,9 @@ execute(t, wanttty, pipein, pipeout)
|
||||
int pid = 0;
|
||||
int pv[2];
|
||||
|
||||
static int csigmask;
|
||||
static sigset_t csigmask;
|
||||
|
||||
static int ocsigmask;
|
||||
static sigset_t ocsigmask;
|
||||
static int onosigchld = 0;
|
||||
static int nosigchld = 0;
|
||||
|
||||
@@ -228,7 +226,7 @@ execute(t, wanttty, pipein, pipeout)
|
||||
else {
|
||||
int ochild, osetintr, ohaderr, odidfds;
|
||||
int oSHIN, oSHOUT, oSHERR, oOLDSTD, otpgrp;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
|
||||
/*
|
||||
* Prepare for the vfork by saving everything that the child
|
||||
@@ -453,7 +451,7 @@ static void
|
||||
vffree(i)
|
||||
int i;
|
||||
{
|
||||
Char **v;
|
||||
register Char **v;
|
||||
|
||||
if ((v = gargv) != NULL) {
|
||||
gargv = 0;
|
||||
@@ -471,7 +469,7 @@ int i;
|
||||
* If more than one word is generated, then update the command vector.
|
||||
*
|
||||
* This is done differently in all the shells:
|
||||
* 1. in the Bourne shell and ksh globbing is not performed
|
||||
* 1. in the bourne shell and ksh globbing is not performed
|
||||
* 2. Bash/csh say ambiguous
|
||||
* 3. zsh does i/o to/from all the files
|
||||
* 4. itcsh concatenates the words.
|
||||
@@ -483,7 +481,7 @@ int i;
|
||||
*/
|
||||
static Char *
|
||||
splicepipe(t, cp)
|
||||
struct command *t;
|
||||
register struct command *t;
|
||||
Char *cp; /* word after < or > */
|
||||
{
|
||||
Char *blk[2];
|
||||
@@ -526,12 +524,12 @@ splicepipe(t, cp)
|
||||
*/
|
||||
static void
|
||||
doio(t, pipein, pipeout)
|
||||
struct command *t;
|
||||
register struct command *t;
|
||||
int *pipein, *pipeout;
|
||||
{
|
||||
int fd;
|
||||
Char *cp;
|
||||
int flags = t->t_dflg;
|
||||
register int fd;
|
||||
register Char *cp;
|
||||
register int flags = t->t_dflg;
|
||||
|
||||
if (didfds || (flags & F_REPEAT))
|
||||
return;
|
||||
@@ -622,7 +620,7 @@ doio(t, pipein, pipeout)
|
||||
|
||||
void
|
||||
mypipe(pv)
|
||||
int *pv;
|
||||
register int *pv;
|
||||
{
|
||||
|
||||
if (pipe(pv) < 0)
|
||||
@@ -637,7 +635,7 @@ oops:
|
||||
|
||||
static void
|
||||
chkclob(cp)
|
||||
char *cp;
|
||||
register char *cp;
|
||||
{
|
||||
struct stat stb;
|
||||
|
||||
|
||||
+55
-55
@@ -29,24 +29,24 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: set.c,v 1.4 1995/07/07 23:13:11 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)set.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef SHORT_STRINGS
|
||||
#include <string.h>
|
||||
#endif /* SHORT_STRINGS */
|
||||
#if __STDC__
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#include "csh.h"
|
||||
#include "extern.h"
|
||||
@@ -75,7 +75,7 @@ doset(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
Char *p;
|
||||
register Char *p;
|
||||
Char *vp, op;
|
||||
Char **vecp;
|
||||
bool hadsub;
|
||||
@@ -116,7 +116,7 @@ doset(v, t)
|
||||
if (op && op != '=')
|
||||
stderror(ERR_NAME | ERR_SYNTAX);
|
||||
if (eq(p, STRLparen)) {
|
||||
Char **e = v;
|
||||
register Char **e = v;
|
||||
|
||||
if (hadsub)
|
||||
stderror(ERR_NAME | ERR_SYNTAX);
|
||||
@@ -143,7 +143,7 @@ doset(v, t)
|
||||
dohash(NULL, NULL);
|
||||
}
|
||||
else if (eq(vp, STRhistchars)) {
|
||||
Char *pn = value(STRhistchars);
|
||||
register Char *pn = value(STRhistchars);
|
||||
|
||||
HIST = *pn++;
|
||||
HISTSUB = *pn;
|
||||
@@ -158,12 +158,12 @@ doset(v, t)
|
||||
else if (eq(vp, STRterm))
|
||||
Setenv(STRTERM, value(vp));
|
||||
else if (eq(vp, STRhome)) {
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
|
||||
cp = Strsave(value(vp)); /* get the old value back */
|
||||
|
||||
/*
|
||||
* convert to canonical pathname (possibly resolving symlinks)
|
||||
* convert to cononical pathname (possibly resolving symlinks)
|
||||
*/
|
||||
cp = dcanon(cp, cp);
|
||||
|
||||
@@ -184,8 +184,8 @@ doset(v, t)
|
||||
|
||||
static Char *
|
||||
getinx(cp, ip)
|
||||
Char *cp;
|
||||
int *ip;
|
||||
register Char *cp;
|
||||
register int *ip;
|
||||
{
|
||||
|
||||
*ip = 0;
|
||||
@@ -203,7 +203,7 @@ asx(vp, subscr, p)
|
||||
int subscr;
|
||||
Char *p;
|
||||
{
|
||||
struct varent *v = getvx(vp, subscr);
|
||||
register struct varent *v = getvx(vp, subscr);
|
||||
|
||||
xfree((ptr_t) v->vec[subscr - 1]);
|
||||
v->vec[subscr - 1] = globone(p, G_APPEND);
|
||||
@@ -214,7 +214,7 @@ getvx(vp, subscr)
|
||||
Char *vp;
|
||||
int subscr;
|
||||
{
|
||||
struct varent *v = adrof(vp);
|
||||
register struct varent *v = adrof(vp);
|
||||
|
||||
if (v == 0)
|
||||
udvar(vp);
|
||||
@@ -229,7 +229,7 @@ dolet(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
Char *p;
|
||||
register Char *p;
|
||||
Char *vp, c, op;
|
||||
bool hadsub;
|
||||
int subscr;
|
||||
@@ -314,7 +314,7 @@ static Char *
|
||||
xset(cp, vp)
|
||||
Char *cp, ***vp;
|
||||
{
|
||||
Char *dp;
|
||||
register Char *dp;
|
||||
|
||||
if (*cp) {
|
||||
dp = Strsave(cp);
|
||||
@@ -332,9 +332,9 @@ operate(op, vp, p)
|
||||
{
|
||||
Char opr[2];
|
||||
Char *vec[5];
|
||||
Char **v = vec;
|
||||
register Char **v = vec;
|
||||
Char **vecp = v;
|
||||
int i;
|
||||
register int i;
|
||||
|
||||
if (op != '=') {
|
||||
if (*vp)
|
||||
@@ -357,7 +357,7 @@ static Char *putp;
|
||||
|
||||
Char *
|
||||
putn(n)
|
||||
int n;
|
||||
register int n;
|
||||
{
|
||||
int num;
|
||||
static Char number[15];
|
||||
@@ -390,7 +390,7 @@ putn(n)
|
||||
|
||||
static void
|
||||
putn1(n)
|
||||
int n;
|
||||
register int n;
|
||||
{
|
||||
if (n > 9)
|
||||
putn1(n / 10);
|
||||
@@ -399,9 +399,9 @@ putn1(n)
|
||||
|
||||
int
|
||||
getn(cp)
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
{
|
||||
int n;
|
||||
register int n;
|
||||
int sign;
|
||||
|
||||
sign = 0;
|
||||
@@ -426,7 +426,7 @@ value1(var, head)
|
||||
Char *var;
|
||||
struct varent *head;
|
||||
{
|
||||
struct varent *vp;
|
||||
register struct varent *vp;
|
||||
|
||||
vp = adrof1(var, head);
|
||||
return (vp == 0 || vp->vec[0] == 0 ? STRNULL : vp->vec[0]);
|
||||
@@ -435,9 +435,9 @@ value1(var, head)
|
||||
static struct varent *
|
||||
madrof(pat, vp)
|
||||
Char *pat;
|
||||
struct varent *vp;
|
||||
register struct varent *vp;
|
||||
{
|
||||
struct varent *vp1;
|
||||
register struct varent *vp1;
|
||||
|
||||
for (; vp; vp = vp->v_right) {
|
||||
if (vp->v_left && (vp1 = madrof(pat, vp->v_left)))
|
||||
@@ -450,10 +450,10 @@ madrof(pat, vp)
|
||||
|
||||
struct varent *
|
||||
adrof1(name, v)
|
||||
Char *name;
|
||||
struct varent *v;
|
||||
register Char *name;
|
||||
register struct varent *v;
|
||||
{
|
||||
int cmp;
|
||||
register cmp;
|
||||
|
||||
v = v->v_left;
|
||||
while (v && ((cmp = *name - *v->v_name) ||
|
||||
@@ -472,7 +472,7 @@ void
|
||||
set(var, val)
|
||||
Char *var, *val;
|
||||
{
|
||||
Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
|
||||
register Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
|
||||
|
||||
vec[0] = val;
|
||||
vec[1] = 0;
|
||||
@@ -484,7 +484,7 @@ set1(var, vec, head)
|
||||
Char *var, **vec;
|
||||
struct varent *head;
|
||||
{
|
||||
Char **oldv = vec;
|
||||
register Char **oldv = vec;
|
||||
|
||||
gflag = 0;
|
||||
tglob(oldv);
|
||||
@@ -505,10 +505,10 @@ set1(var, vec, head)
|
||||
void
|
||||
setq(name, vec, p)
|
||||
Char *name, **vec;
|
||||
struct varent *p;
|
||||
register struct varent *p;
|
||||
{
|
||||
struct varent *c;
|
||||
int f;
|
||||
register struct varent *c;
|
||||
register f;
|
||||
|
||||
f = 0; /* tree hangs off the header's left link */
|
||||
while ((c = p->v_link[f]) != NULL) {
|
||||
@@ -551,11 +551,11 @@ unset(v, t)
|
||||
|
||||
void
|
||||
unset1(v, head)
|
||||
Char *v[];
|
||||
register Char *v[];
|
||||
struct varent *head;
|
||||
{
|
||||
struct varent *vp;
|
||||
int cnt;
|
||||
register struct varent *vp;
|
||||
register int cnt;
|
||||
|
||||
while (*++v) {
|
||||
cnt = 0;
|
||||
@@ -570,7 +570,7 @@ void
|
||||
unsetv(var)
|
||||
Char *var;
|
||||
{
|
||||
struct varent *vp;
|
||||
register struct varent *vp;
|
||||
|
||||
if ((vp = adrof1(var, &shvhed)) == 0)
|
||||
udvar(var);
|
||||
@@ -579,10 +579,10 @@ unsetv(var)
|
||||
|
||||
static void
|
||||
unsetv1(p)
|
||||
struct varent *p;
|
||||
register struct varent *p;
|
||||
{
|
||||
struct varent *c, *pp;
|
||||
int f;
|
||||
register struct varent *c, *pp;
|
||||
register f;
|
||||
|
||||
/*
|
||||
* Free associated memory first to avoid complications.
|
||||
@@ -633,8 +633,8 @@ shift(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
struct varent *argv;
|
||||
Char *name;
|
||||
register struct varent *argv;
|
||||
register Char *name;
|
||||
|
||||
v++;
|
||||
name = *v;
|
||||
@@ -665,7 +665,7 @@ exportpath(val)
|
||||
break;
|
||||
}
|
||||
if (**val != '/' && (euid == 0 || uid == 0) &&
|
||||
(intact || (intty && isatty(SHOUT))))
|
||||
(intact || intty && isatty(SHOUT)))
|
||||
(void) fprintf(csherr,
|
||||
"Warning: exported path contains relative components.\n");
|
||||
(void) Strcat(exppath, *val++);
|
||||
@@ -717,16 +717,16 @@ rright(p)
|
||||
*/
|
||||
static void
|
||||
balance(p, f, d)
|
||||
struct varent *p;
|
||||
int f, d;
|
||||
register struct varent *p;
|
||||
register int f, d;
|
||||
{
|
||||
struct varent *pp;
|
||||
register struct varent *pp;
|
||||
|
||||
#ifndef lint
|
||||
struct varent *t; /* used by the rotate macros */
|
||||
register struct varent *t; /* used by the rotate macros */
|
||||
|
||||
#endif
|
||||
int ff;
|
||||
register ff;
|
||||
|
||||
/*
|
||||
* Ok, from here on, p is the node we're operating on; pp is it's parent; f
|
||||
@@ -745,7 +745,7 @@ balance(p, f, d)
|
||||
break;
|
||||
case 1: /* was already right heavy */
|
||||
switch (p->v_right->v_bal) {
|
||||
case 1: /* single rotate */
|
||||
case 1: /* sigle rotate */
|
||||
pp->v_link[ff] = rleft(p);
|
||||
p->v_left->v_bal = 0;
|
||||
p->v_bal = 0;
|
||||
@@ -783,7 +783,7 @@ balance(p, f, d)
|
||||
p->v_right->v_bal = 0;
|
||||
p->v_bal = 0;
|
||||
break;
|
||||
case 0: /* single rotate */
|
||||
case 0: /* signle rotate */
|
||||
pp->v_link[ff] = rright(p);
|
||||
p->v_right->v_bal = -1;
|
||||
p->v_bal = 1;
|
||||
@@ -812,13 +812,13 @@ balance(p, f, d)
|
||||
|
||||
void
|
||||
plist(p)
|
||||
struct varent *p;
|
||||
register struct varent *p;
|
||||
{
|
||||
struct varent *c;
|
||||
int len;
|
||||
register struct varent *c;
|
||||
register len;
|
||||
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
|
||||
for (;;) {
|
||||
while (p->v_left)
|
||||
|
||||
+37
-40
@@ -29,15 +29,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: str.c,v 1.3 1995/05/30 00:06:39 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)str.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#define MALLOC_INCR 128
|
||||
@@ -62,10 +59,10 @@ static const char rcsid[] =
|
||||
|
||||
Char **
|
||||
blk2short(src)
|
||||
char **src;
|
||||
register char **src;
|
||||
{
|
||||
size_t n;
|
||||
Char **sdst, **dst;
|
||||
register Char **sdst, **dst;
|
||||
|
||||
/*
|
||||
* Count
|
||||
@@ -82,10 +79,10 @@ blk2short(src)
|
||||
|
||||
char **
|
||||
short2blk(src)
|
||||
Char **src;
|
||||
register Char **src;
|
||||
{
|
||||
size_t n;
|
||||
char **sdst, **dst;
|
||||
register char **sdst, **dst;
|
||||
|
||||
/*
|
||||
* Count
|
||||
@@ -102,11 +99,11 @@ short2blk(src)
|
||||
|
||||
Char *
|
||||
str2short(src)
|
||||
char *src;
|
||||
register char *src;
|
||||
{
|
||||
static Char *sdst;
|
||||
static size_t dstsize = 0;
|
||||
Char *dst, *edst;
|
||||
register Char *dst, *edst;
|
||||
|
||||
if (src == NULL)
|
||||
return (NULL);
|
||||
@@ -134,11 +131,11 @@ str2short(src)
|
||||
|
||||
char *
|
||||
short2str(src)
|
||||
Char *src;
|
||||
register Char *src;
|
||||
{
|
||||
static char *sdst = NULL;
|
||||
static size_t dstsize = 0;
|
||||
char *dst, *edst;
|
||||
register char *dst, *edst;
|
||||
|
||||
if (src == NULL)
|
||||
return (NULL);
|
||||
@@ -165,9 +162,9 @@ short2str(src)
|
||||
|
||||
Char *
|
||||
s_strcpy(dst, src)
|
||||
Char *dst, *src;
|
||||
register Char *dst, *src;
|
||||
{
|
||||
Char *sdst;
|
||||
register Char *sdst;
|
||||
|
||||
sdst = dst;
|
||||
while ((*dst++ = *src++) != '\0')
|
||||
@@ -177,10 +174,10 @@ s_strcpy(dst, src)
|
||||
|
||||
Char *
|
||||
s_strncpy(dst, src, n)
|
||||
Char *dst, *src;
|
||||
size_t n;
|
||||
register Char *dst, *src;
|
||||
register size_t n;
|
||||
{
|
||||
Char *sdst;
|
||||
register Char *sdst;
|
||||
|
||||
if (n == 0)
|
||||
return(dst);
|
||||
@@ -198,9 +195,9 @@ s_strncpy(dst, src, n)
|
||||
|
||||
Char *
|
||||
s_strcat(dst, src)
|
||||
Char *dst, *src;
|
||||
register Char *dst, *src;
|
||||
{
|
||||
short *sdst;
|
||||
register short *sdst;
|
||||
|
||||
sdst = dst;
|
||||
while (*dst++)
|
||||
@@ -214,10 +211,10 @@ s_strcat(dst, src)
|
||||
#ifdef NOTUSED
|
||||
Char *
|
||||
s_strncat(dst, src, n)
|
||||
Char *dst, *src;
|
||||
size_t n;
|
||||
register Char *dst, *src;
|
||||
register size_t n;
|
||||
{
|
||||
Char *sdst;
|
||||
register Char *sdst;
|
||||
|
||||
if (n == 0)
|
||||
return (dst);
|
||||
@@ -242,7 +239,7 @@ s_strncat(dst, src, n)
|
||||
|
||||
Char *
|
||||
s_strchr(str, ch)
|
||||
Char *str;
|
||||
register Char *str;
|
||||
int ch;
|
||||
{
|
||||
do
|
||||
@@ -254,10 +251,10 @@ s_strchr(str, ch)
|
||||
|
||||
Char *
|
||||
s_strrchr(str, ch)
|
||||
Char *str;
|
||||
register Char *str;
|
||||
int ch;
|
||||
{
|
||||
Char *rstr;
|
||||
register Char *rstr;
|
||||
|
||||
rstr = NULL;
|
||||
do
|
||||
@@ -269,9 +266,9 @@ s_strrchr(str, ch)
|
||||
|
||||
size_t
|
||||
s_strlen(str)
|
||||
Char *str;
|
||||
register Char *str;
|
||||
{
|
||||
size_t n;
|
||||
register size_t n;
|
||||
|
||||
for (n = 0; *str++; n++)
|
||||
continue;
|
||||
@@ -280,7 +277,7 @@ s_strlen(str)
|
||||
|
||||
int
|
||||
s_strcmp(str1, str2)
|
||||
Char *str1, *str2;
|
||||
register Char *str1, *str2;
|
||||
{
|
||||
for (; *str1 && *str1 == *str2; str1++, str2++)
|
||||
continue;
|
||||
@@ -301,8 +298,8 @@ s_strcmp(str1, str2)
|
||||
|
||||
int
|
||||
s_strncmp(str1, str2, n)
|
||||
Char *str1, *str2;
|
||||
size_t n;
|
||||
register Char *str1, *str2;
|
||||
register size_t n;
|
||||
{
|
||||
if (n == 0)
|
||||
return (0);
|
||||
@@ -330,10 +327,10 @@ s_strncmp(str1, str2, n)
|
||||
|
||||
Char *
|
||||
s_strsave(s)
|
||||
Char *s;
|
||||
register Char *s;
|
||||
{
|
||||
Char *n;
|
||||
Char *p;
|
||||
register Char *p;
|
||||
|
||||
if (s == 0)
|
||||
s = STRNULL;
|
||||
@@ -350,7 +347,7 @@ s_strspl(cp, dp)
|
||||
Char *cp, *dp;
|
||||
{
|
||||
Char *ep;
|
||||
Char *p, *q;
|
||||
register Char *p, *q;
|
||||
|
||||
if (!cp)
|
||||
cp = STRNULL;
|
||||
@@ -371,7 +368,7 @@ s_strspl(cp, dp)
|
||||
|
||||
Char *
|
||||
s_strend(cp)
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
{
|
||||
if (!cp)
|
||||
return (cp);
|
||||
@@ -382,11 +379,11 @@ s_strend(cp)
|
||||
|
||||
Char *
|
||||
s_strstr(s, t)
|
||||
Char *s, *t;
|
||||
register Char *s, *t;
|
||||
{
|
||||
do {
|
||||
Char *ss = s;
|
||||
Char *tt = t;
|
||||
register Char *ss = s;
|
||||
register Char *tt = t;
|
||||
|
||||
do
|
||||
if (*tt == '\0')
|
||||
@@ -399,11 +396,11 @@ s_strstr(s, t)
|
||||
|
||||
char *
|
||||
short2qstr(src)
|
||||
Char *src;
|
||||
register Char *src;
|
||||
{
|
||||
static char *sdst = NULL;
|
||||
static size_t dstsize = 0;
|
||||
char *dst, *edst;
|
||||
register char *dst, *edst;
|
||||
|
||||
if (src == NULL)
|
||||
return (NULL);
|
||||
|
||||
+13
-16
@@ -29,15 +29,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: time.c,v 1.5 1995/05/30 00:06:40 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)time.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -95,7 +92,7 @@ donice(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
Char *cp;
|
||||
register Char *cp;
|
||||
int nval = 0;
|
||||
|
||||
v++, cp = *v++;
|
||||
@@ -108,7 +105,7 @@ donice(v, t)
|
||||
|
||||
void
|
||||
ruadd(ru, ru2)
|
||||
struct rusage *ru, *ru2;
|
||||
register struct rusage *ru, *ru2;
|
||||
{
|
||||
tvadd(&ru->ru_utime, &ru2->ru_utime);
|
||||
tvadd(&ru->ru_stime, &ru2->ru_stime);
|
||||
@@ -132,17 +129,17 @@ ruadd(ru, ru2)
|
||||
|
||||
void
|
||||
prusage(r0, r1, e, b)
|
||||
struct rusage *r0, *r1;
|
||||
register struct rusage *r0, *r1;
|
||||
struct timeval *e, *b;
|
||||
{
|
||||
time_t t =
|
||||
register time_t t =
|
||||
(r1->ru_utime.tv_sec - r0->ru_utime.tv_sec) * 100 +
|
||||
(r1->ru_utime.tv_usec - r0->ru_utime.tv_usec) / 10000 +
|
||||
(r1->ru_stime.tv_sec - r0->ru_stime.tv_sec) * 100 +
|
||||
(r1->ru_stime.tv_usec - r0->ru_stime.tv_usec) / 10000;
|
||||
char *cp;
|
||||
long i;
|
||||
struct varent *vp = adrof(STRtime);
|
||||
register char *cp;
|
||||
register long i;
|
||||
register struct varent *vp = adrof(STRtime);
|
||||
|
||||
int ms =
|
||||
(e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000;
|
||||
@@ -219,7 +216,7 @@ prusage(r0, r1, e, b)
|
||||
(void) fprintf(cshout, "%ld", r1->ru_oublock - r0->ru_oublock);
|
||||
break;
|
||||
|
||||
case 'r': /* socket messages received */
|
||||
case 'r': /* socket messages recieved */
|
||||
(void) fprintf(cshout, "%ld", r1->ru_msgrcv - r0->ru_msgrcv);
|
||||
break;
|
||||
|
||||
@@ -227,7 +224,7 @@ prusage(r0, r1, e, b)
|
||||
(void) fprintf(cshout, "%ld", r1->ru_msgsnd - r0->ru_msgsnd);
|
||||
break;
|
||||
|
||||
case 'k': /* number of signals received */
|
||||
case 'k': /* number of signals recieved */
|
||||
(void) fprintf(cshout, "%ld", r1->ru_nsignals-r0->ru_nsignals);
|
||||
break;
|
||||
|
||||
@@ -280,7 +277,7 @@ void
|
||||
psecs(l)
|
||||
long l;
|
||||
{
|
||||
int i;
|
||||
register int i;
|
||||
|
||||
i = l / 3600;
|
||||
if (i) {
|
||||
@@ -301,7 +298,7 @@ void
|
||||
pcsecs(l) /* PWP: print mm:ss.dd, l is in sec*100 */
|
||||
long l;
|
||||
{
|
||||
int i;
|
||||
register int i;
|
||||
|
||||
i = l / 360000;
|
||||
if (i) {
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile,v 1.2 1994/09/24 02:54:33 davidg Exp $
|
||||
|
||||
PROG= date
|
||||
SRCS= date.c netdate.c vary.c
|
||||
SRCS= date.c netdate.c
|
||||
DPADD= ${LIBUTIL}
|
||||
LDADD= -lutil
|
||||
|
||||
|
||||
+19
-108
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: date.1,v 1.8.2.1 1997/02/28 07:54:32 mpp Exp $
|
||||
.\"
|
||||
.Dd November 17, 1993
|
||||
.Dt DATE 1
|
||||
@@ -43,16 +43,14 @@
|
||||
.Nd display or set date and time
|
||||
.Sh SYNOPSIS
|
||||
.Nm date
|
||||
.Op Fl nu
|
||||
.Op Fl d Ar dst
|
||||
.Op Fl r Ar seconds
|
||||
.Op Fl t Ar minutes_west
|
||||
.Op Fl v Ns Ar [+|-]val Ns Op ymwdHMS
|
||||
.Ar ...
|
||||
.Op Fl f Ar fmt Ar date | [[[[[cc]yy]mm]dd]HH]MM[\&.ss]
|
||||
.Op Fl nu
|
||||
.Op Cm + Ns Ar format
|
||||
.Op [yy[mm[dd[hh]]]]mm[\&.ss]
|
||||
.Sh DESCRIPTION
|
||||
.Nm Date
|
||||
.Nm
|
||||
displays the current date and time when invoked without arguments.
|
||||
Providing arguments will format the date and time in a user-defined
|
||||
way or set the date.
|
||||
@@ -69,14 +67,6 @@ to
|
||||
.Xr gettimeofday 2
|
||||
will return a non-zero
|
||||
.Ql tz_dsttime .
|
||||
.It Fl f
|
||||
Use
|
||||
.Ar fmt
|
||||
as the format string to parse the date provided rather than using
|
||||
the default
|
||||
.Ar [[[[[cc]yy]mm]dd]HH]MM[.ss]
|
||||
format. Parsing is done using
|
||||
.Xr strptime 3 .
|
||||
.It Fl n
|
||||
The utility
|
||||
.Xr timed 8
|
||||
@@ -84,12 +74,12 @@ is used to synchronize the clocks on groups of machines.
|
||||
By default, if
|
||||
.Xr timed
|
||||
is running,
|
||||
.Nm
|
||||
.Nm date
|
||||
will set the time on all of the machines in the local group.
|
||||
The
|
||||
.Fl n
|
||||
option stops
|
||||
.Nm
|
||||
.Nm date
|
||||
from setting the time for other than the current machine.
|
||||
.It Fl r
|
||||
Print out the date and time in
|
||||
@@ -107,41 +97,6 @@ by future calls to
|
||||
Display or set the date in
|
||||
.Tn UCT
|
||||
(universal) time.
|
||||
.It Fl v
|
||||
Adjust the second, minute, hour, month day, week day, month or year according to
|
||||
.Ar val .
|
||||
If
|
||||
.Ar val
|
||||
is preceded with a plus or minus sign, the date is adjusted forwards
|
||||
or backwards according to the remaining string, otherwise the relevant
|
||||
part of the date is set. The date can be adjusted as many times as
|
||||
required using these flags. Flags are processed in the order given.
|
||||
.Pp
|
||||
Seconds are in the range 0-59, minutes are in the range 0-59, hours are
|
||||
in the range 1-12, month days are in the range 1-31, week days are in the
|
||||
range 0-6 (Sun-Sat), months are in the range 1-12 (Jan-Dec) and years are
|
||||
in the range 80-38 or 1980-2038.
|
||||
.Pp
|
||||
If
|
||||
.Ar val
|
||||
is numeric, one of either
|
||||
.Ar y ,
|
||||
.Ar m ,
|
||||
.Ar w ,
|
||||
.Ar d ,
|
||||
.Ar H ,
|
||||
.Ar M
|
||||
or
|
||||
.Ar S
|
||||
must be used to specify which part of the date is to be adjusted.
|
||||
.Pp
|
||||
The week day or month may be specified using a name rather than a
|
||||
number. If a name is used with the plus (or minus) sign, the date
|
||||
will be put forwards (or backwards) to the next (previous) date that
|
||||
matches the given week day or month. This will not adjust the date
|
||||
if the given week day or month is the same as the current one.
|
||||
.Pp
|
||||
Refer to the examples below for further details.
|
||||
.El
|
||||
.Pp
|
||||
An operand with a leading plus (``+'') sign signals a user-defined format
|
||||
@@ -162,18 +117,16 @@ a value for setting the system's notion of the current date and time.
|
||||
The canonical representation for setting the date and time is:
|
||||
.Pp
|
||||
.Bl -tag -width Ds -compact -offset indent
|
||||
.It Ar cc
|
||||
Century (either 19 or 20) prepended to the abbreviated year.
|
||||
.It Ar yy
|
||||
Year in abbreviated form (e.g. 89 for 1989, 06 for 2006).
|
||||
Year in abbreviated form (.e.g 89 for 1989).
|
||||
.It Ar mm
|
||||
Numeric month.
|
||||
A number from 1 to 12.
|
||||
.It Ar dd
|
||||
Day, a number from 1 to 31.
|
||||
.It Ar HH
|
||||
.It Ar hh
|
||||
Hour, a number from 0 to 23.
|
||||
.It Ar MM
|
||||
.It Ar mm
|
||||
Minutes, a number from 0 to 59.
|
||||
.It Ar .ss
|
||||
Seconds, a number from 0 to 61 (59 plus a maximum of two leap seconds).
|
||||
@@ -186,51 +139,17 @@ and years are handled automatically.
|
||||
.Sh EXAMPLES
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S"
|
||||
date ``+DATE: %m/%d/%y%nTIME: %H:%M:%S''
|
||||
.Ed
|
||||
.Pp
|
||||
will display:
|
||||
.Bd -literal -offset indent
|
||||
DATE: 1987-11-21
|
||||
DATE: 11/21/87
|
||||
TIME: 13:36:16
|
||||
.Ed
|
||||
.Pp
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date -v1m -v+1y
|
||||
.Ed
|
||||
.Pp
|
||||
will display:
|
||||
.Bd -literal -offset indent
|
||||
Sun Jan 4 03:15:24 GMT 1998
|
||||
.Ed
|
||||
.Pp
|
||||
(where it is currently Mon Aug 4 04:15:24 BST 1997).
|
||||
.Pp
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date -v1d -v3m -v0y -v-1d
|
||||
.Ed
|
||||
.Pp
|
||||
will display the last day of February in the year 2000:
|
||||
.Bd -literal -offset indent
|
||||
Tue Feb 29 03:18:00 GMT 2000
|
||||
.Ed
|
||||
.Pp
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date -v1d -v+1m -v-1d -v-fri
|
||||
.Ed
|
||||
.Pp
|
||||
will display the last Friday of the month:
|
||||
.Bd -literal -offset indent
|
||||
Fri Aug 29 04:31:11 BST 1997
|
||||
.Ed
|
||||
.Pp
|
||||
(where it is currently Mon Aug 4 04:31:11 BST 1997).
|
||||
.Pp
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date 8506131627
|
||||
.Ed
|
||||
.Pp
|
||||
@@ -245,18 +164,13 @@ date 1432
|
||||
sets the time to
|
||||
.Li "2:32 PM" ,
|
||||
without modifying the date.
|
||||
.Sh ENVIRONMENT
|
||||
.Sh ENVIRONMENT VARIABLES
|
||||
The execution of
|
||||
.Nm
|
||||
is affected by the following environment variables:
|
||||
is affected by the following evironment variables:
|
||||
.Bl -tag -width Ds
|
||||
.It Ev TZ
|
||||
The timezone to use when displaying dates.
|
||||
The normal format is a pathname relative to
|
||||
.Pa /usr/share/zoneinfo .
|
||||
For example, the command
|
||||
.Dq TZ=America/Los_Angeles date
|
||||
displays the current time in California.
|
||||
See
|
||||
.Xr environ 7
|
||||
for more information.
|
||||
@@ -264,14 +178,13 @@ for more information.
|
||||
.Sh FILES
|
||||
.Bl -tag -width /var/log/messages -compact
|
||||
.It Pa /var/log/wtmp
|
||||
a record of date resets and time changes
|
||||
A record of date resets and time changes.
|
||||
.It Pa /var/log/messages
|
||||
a record of the user setting the time
|
||||
A record of the user setting the time.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr gettimeofday 2 ,
|
||||
.Xr strftime 3 ,
|
||||
.Xr strptime 3 ,
|
||||
.Xr utmp 5 ,
|
||||
.Xr timed 8
|
||||
.Rs
|
||||
@@ -280,9 +193,7 @@ a record of the user setting the time
|
||||
.%A S. Zatti
|
||||
.Re
|
||||
.Sh DIAGNOSTICS
|
||||
The
|
||||
.Nm
|
||||
utility exits 0 on success, 1 if unable to set the date, and 2
|
||||
Exit status is 0 on success, 1 if unable to set the date, and 2
|
||||
if able to set the local date, but unable to set it globally.
|
||||
.Pp
|
||||
Occasionally, when
|
||||
@@ -290,14 +201,14 @@ Occasionally, when
|
||||
synchronizes the time on many hosts, the setting of a new time value may
|
||||
require more than a few seconds.
|
||||
On these occasions,
|
||||
.Nm
|
||||
.Nm date
|
||||
prints:
|
||||
.Ql Network time being set .
|
||||
The message
|
||||
.Ql Communication error with timed
|
||||
occurs when the communication
|
||||
between
|
||||
.Nm
|
||||
.Nm date
|
||||
and
|
||||
.Xr timed
|
||||
fails.
|
||||
@@ -318,7 +229,7 @@ will be running on
|
||||
.Tn GMT .
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm date
|
||||
command is expected to be compatible with
|
||||
.St -p1003.2 .
|
||||
.Sh HISTORY
|
||||
|
||||
+68
-115
@@ -29,20 +29,18 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: date.c,v 1.7 1996/04/06 01:42:09 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char const copyright[] =
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1985, 1987, 1988, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)date.c 8.2 (Berkeley) 4/28/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
static char sccsid[] = "@(#)date.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -50,6 +48,7 @@ static const char rcsid[] =
|
||||
|
||||
#include <ctype.h>
|
||||
#include <err.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -58,12 +57,11 @@ static const char rcsid[] =
|
||||
#include <locale.h>
|
||||
|
||||
#include "extern.h"
|
||||
#include "vary.h"
|
||||
|
||||
time_t tval;
|
||||
int retval, nflag;
|
||||
|
||||
static void setthetime __P((const char *, const char *));
|
||||
static void setthetime __P((char *));
|
||||
static void badformat __P((void));
|
||||
static void usage __P((void));
|
||||
|
||||
@@ -79,19 +77,14 @@ main(argc, argv)
|
||||
struct timezone tz;
|
||||
int ch, rflag;
|
||||
char *format, buf[1024];
|
||||
char *endptr, *fmt;
|
||||
char *endptr;
|
||||
int set_timezone;
|
||||
struct vary *v;
|
||||
const struct vary *badv;
|
||||
struct tm lt;
|
||||
|
||||
v = NULL;
|
||||
fmt = NULL;
|
||||
(void) setlocale(LC_TIME, "");
|
||||
tz.tz_dsttime = tz.tz_minuteswest = 0;
|
||||
rflag = 0;
|
||||
set_timezone = 0;
|
||||
while ((ch = getopt(argc, argv, "d:f:nr:t:uv:")) != -1)
|
||||
while ((ch = getopt(argc, argv, "d:nr:ut:")) != EOF)
|
||||
switch((char)ch) {
|
||||
case 'd': /* daylight savings time */
|
||||
tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0;
|
||||
@@ -99,9 +92,6 @@ main(argc, argv)
|
||||
usage();
|
||||
set_timezone = 1;
|
||||
break;
|
||||
case 'f':
|
||||
fmt = optarg;
|
||||
break;
|
||||
case 'n': /* don't set network */
|
||||
nflag = 1;
|
||||
break;
|
||||
@@ -109,6 +99,9 @@ main(argc, argv)
|
||||
rflag = 1;
|
||||
tval = atol(optarg);
|
||||
break;
|
||||
case 'u': /* do everything in GMT */
|
||||
(void)setenv("TZ", "GMT0", 1);
|
||||
break;
|
||||
case 't': /* minutes west of GMT */
|
||||
/* error check; don't allow "PST" */
|
||||
tz.tz_minuteswest = strtol(optarg, &endptr, 10);
|
||||
@@ -116,12 +109,6 @@ main(argc, argv)
|
||||
usage();
|
||||
set_timezone = 1;
|
||||
break;
|
||||
case 'u': /* do everything in GMT */
|
||||
(void)setenv("TZ", "GMT0", 1);
|
||||
break;
|
||||
case 'v':
|
||||
v = vary_append(v, optarg);
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
@@ -130,7 +117,7 @@ main(argc, argv)
|
||||
|
||||
/*
|
||||
* If -d or -t, set the timezone or daylight savings time; this
|
||||
* doesn't belong here; the kernel should not know about either.
|
||||
* doesn't belong here, there kernel should not know about either.
|
||||
*/
|
||||
if (set_timezone && settimeofday((struct timeval *)NULL, &tz))
|
||||
err(1, "settimeofday (timezone)");
|
||||
@@ -147,110 +134,78 @@ main(argc, argv)
|
||||
}
|
||||
|
||||
if (*argv) {
|
||||
setthetime(fmt, *argv);
|
||||
setthetime(*argv);
|
||||
++argv;
|
||||
} else if (fmt != NULL)
|
||||
usage();
|
||||
}
|
||||
|
||||
if (*argv && **argv == '+')
|
||||
format = *argv + 1;
|
||||
|
||||
lt = *localtime(&tval);
|
||||
badv = vary_apply(v, <);
|
||||
if (badv) {
|
||||
fprintf(stderr, "%s: Cannot apply date adjustment\n",
|
||||
badv->arg);
|
||||
vary_destroy(v);
|
||||
usage();
|
||||
}
|
||||
vary_destroy(v);
|
||||
(void)strftime(buf, sizeof(buf), format, <);
|
||||
(void)strftime(buf, sizeof(buf), format, localtime(&tval));
|
||||
(void)printf("%s\n", buf);
|
||||
exit(retval);
|
||||
}
|
||||
|
||||
#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2;
|
||||
#define ATOI4(ar) ((ar)[0] - '0') * 1000 + ((ar)[1] - '0') * 100 + \
|
||||
((ar)[2] - '0') * 10 + ((ar)[3] - '0'); (ar) += 4;
|
||||
void
|
||||
setthetime(fmt, p)
|
||||
const char *fmt;
|
||||
register const char *p;
|
||||
setthetime(p)
|
||||
register char *p;
|
||||
{
|
||||
register struct tm *lt;
|
||||
struct timeval tv;
|
||||
const char *dot, *t;
|
||||
char *dot, *t;
|
||||
|
||||
if (fmt != NULL) {
|
||||
lt = localtime(&tval);
|
||||
t = strptime(p, fmt, lt);
|
||||
if (t == NULL) {
|
||||
fprintf(stderr, "Failed conversion of ``%s''"
|
||||
" using format ``%s''\n", p, fmt);
|
||||
badformat();
|
||||
} else if (*t != '\0')
|
||||
fprintf(stderr, "Warning: Ignoring %ld extraneous"
|
||||
" characters in date string (%s)\n",
|
||||
(long) strlen(t), t);
|
||||
} else {
|
||||
for (t = p, dot = NULL; *t; ++t) {
|
||||
if (isdigit(*t))
|
||||
continue;
|
||||
if (*t == '.' && dot == NULL) {
|
||||
dot = t;
|
||||
continue;
|
||||
}
|
||||
badformat();
|
||||
for (t = p, dot = NULL; *t; ++t) {
|
||||
if (isdigit(*t))
|
||||
continue;
|
||||
if (*t == '.' && dot == NULL) {
|
||||
dot = t;
|
||||
continue;
|
||||
}
|
||||
badformat();
|
||||
}
|
||||
|
||||
lt = localtime(&tval);
|
||||
lt = localtime(&tval);
|
||||
|
||||
if (dot != NULL) { /* .ss */
|
||||
dot++; /* *dot++ = '\0'; */
|
||||
if (strlen(dot) != 2)
|
||||
badformat();
|
||||
lt->tm_sec = ATOI2(dot);
|
||||
if (lt->tm_sec > 61)
|
||||
badformat();
|
||||
} else
|
||||
lt->tm_sec = 0;
|
||||
|
||||
/* if p has a ".ss" field then let's pretend it's not there */
|
||||
switch (strlen(p) - ((dot != NULL) ? 3 : 0)) {
|
||||
case 12: /* cc */
|
||||
lt->tm_year = -1900 + ATOI4(p);
|
||||
if (lt->tm_year < 0)
|
||||
badformat();
|
||||
goto year_done;
|
||||
case 10: /* yy */
|
||||
lt->tm_year = ATOI2(p);
|
||||
if (lt->tm_year < 69) /* hack for 2000 ;-} */
|
||||
lt->tm_year += 100;
|
||||
year_done: /* FALLTHROUGH */
|
||||
case 8: /* mm */
|
||||
lt->tm_mon = ATOI2(p);
|
||||
if (lt->tm_mon > 12)
|
||||
badformat();
|
||||
--lt->tm_mon; /* time struct is 0 - 11 */
|
||||
/* FALLTHROUGH */
|
||||
case 6: /* dd */
|
||||
lt->tm_mday = ATOI2(p);
|
||||
if (lt->tm_mday > 31)
|
||||
badformat();
|
||||
/* FALLTHROUGH */
|
||||
case 4: /* HH */
|
||||
lt->tm_hour = ATOI2(p);
|
||||
if (lt->tm_hour > 23)
|
||||
badformat();
|
||||
/* FALLTHROUGH */
|
||||
case 2: /* MM */
|
||||
lt->tm_min = ATOI2(p);
|
||||
if (lt->tm_min > 59)
|
||||
badformat();
|
||||
break;
|
||||
default:
|
||||
if (dot != NULL) { /* .ss */
|
||||
*dot++ = '\0';
|
||||
if (strlen(dot) != 2)
|
||||
badformat();
|
||||
}
|
||||
lt->tm_sec = ATOI2(dot);
|
||||
if (lt->tm_sec > 61)
|
||||
badformat();
|
||||
} else
|
||||
lt->tm_sec = 0;
|
||||
|
||||
switch (strlen(p)) {
|
||||
case 10: /* yy */
|
||||
lt->tm_year = ATOI2(p);
|
||||
if (lt->tm_year < 69) /* hack for 2000 ;-} */
|
||||
lt->tm_year += 100;
|
||||
/* FALLTHROUGH */
|
||||
case 8: /* mm */
|
||||
lt->tm_mon = ATOI2(p);
|
||||
if (lt->tm_mon > 12)
|
||||
badformat();
|
||||
--lt->tm_mon; /* time struct is 0 - 11 */
|
||||
/* FALLTHROUGH */
|
||||
case 6: /* dd */
|
||||
lt->tm_mday = ATOI2(p);
|
||||
if (lt->tm_mday > 31)
|
||||
badformat();
|
||||
/* FALLTHROUGH */
|
||||
case 4: /* hh */
|
||||
lt->tm_hour = ATOI2(p);
|
||||
if (lt->tm_hour > 23)
|
||||
badformat();
|
||||
/* FALLTHROUGH */
|
||||
case 2: /* mm */
|
||||
lt->tm_min = ATOI2(p);
|
||||
if (lt->tm_min > 59)
|
||||
badformat();
|
||||
break;
|
||||
default:
|
||||
badformat();
|
||||
}
|
||||
|
||||
/* convert broken-down time to GMT clock time */
|
||||
@@ -282,10 +237,8 @@ badformat()
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: date [-nu] [-d dst] [-r seconds] [-t west] "
|
||||
"[-v[+|-]val[ymwdHMS]] ... ",
|
||||
" "
|
||||
"[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]");
|
||||
(void)fprintf(stderr,
|
||||
"usage: date [-nu] [-d dst] [-r seconds] [-t west] [+format]\n");
|
||||
(void)fprintf(stderr, " [yy[mm[dd[hh]]]]mm[.ss]]\n");
|
||||
exit(1);
|
||||
}
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)extern.h 8.1 (Berkeley) 5/31/93
|
||||
* $FreeBSD$
|
||||
* $Id: extern.h,v 1.2 1994/09/24 02:54:37 davidg Exp $
|
||||
*/
|
||||
|
||||
int netsettime __P((time_t));
|
||||
+4
-5
@@ -29,14 +29,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: netdate.c,v 1.3.6.1 1997/03/10 19:51:16 guido Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)netdate.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -50,6 +48,7 @@ static const char rcsid[] =
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -117,7 +116,7 @@ netsettime(tval)
|
||||
warn("gethostname");
|
||||
goto bad;
|
||||
}
|
||||
(void)strncpy(msg.tsp_name, hostname, sizeof(msg.tsp_name) - 1);
|
||||
(void)strncpy(msg.tsp_name, hostname, sizeof(msg.tsp_name));
|
||||
msg.tsp_name[sizeof(msg.tsp_name) - 1] = '\0';
|
||||
msg.tsp_seq = htons((u_short)0);
|
||||
msg.tsp_time.tv_sec = htonl((u_long)tval);
|
||||
|
||||
-456
@@ -1,456 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1997 Brian Somers <brian@Awfulhak.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "vary.h"
|
||||
|
||||
struct trans {
|
||||
int val;
|
||||
char *str;
|
||||
};
|
||||
|
||||
static struct trans trans_mon[] = {
|
||||
{ 1, "january" }, { 2, "february" }, { 3, "march" }, { 4, "april" },
|
||||
{ 6, "june" }, { 7, "july" }, { 8, "august" }, { 9, "september" },
|
||||
{ 10, "october" }, { 11, "november" }, { 12, "december" },
|
||||
{ -1, NULL }
|
||||
};
|
||||
|
||||
static struct trans trans_wday[] = {
|
||||
{ 0, "sunday" }, { 1, "monday" }, { 2, "tuesday" }, { 3, "wednesday" },
|
||||
{ 4, "thursday" }, { 5, "friday" }, { 6, "saturday" },
|
||||
{ -1, NULL }
|
||||
};
|
||||
|
||||
static char digits[] = "0123456789";
|
||||
|
||||
static int
|
||||
trans(const struct trans t[], const char *arg)
|
||||
{
|
||||
int f;
|
||||
|
||||
for (f = 0; t[f].val != -1; f++)
|
||||
if (!strncasecmp(t[f].str, arg, 3) ||
|
||||
!strncasecmp(t[f].str, arg, strlen(t[f].str)))
|
||||
return t[f].val;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct vary *
|
||||
vary_append(struct vary *v, char *arg)
|
||||
{
|
||||
struct vary *result, **nextp;
|
||||
|
||||
if (v) {
|
||||
result = v;
|
||||
while (v->next)
|
||||
v = v->next;
|
||||
nextp = &v->next;
|
||||
} else
|
||||
nextp = &result;
|
||||
|
||||
*nextp = (struct vary *)malloc(sizeof(struct vary));
|
||||
(*nextp)->arg = arg;
|
||||
(*nextp)->next = NULL;
|
||||
return result;
|
||||
}
|
||||
|
||||
static int mdays[12] = { 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
|
||||
static int
|
||||
daysinmonth(const struct tm *t)
|
||||
{
|
||||
int year;
|
||||
|
||||
year = t->tm_year + 1900;
|
||||
|
||||
if (t->tm_mon == 1)
|
||||
if (!(year % 400))
|
||||
return 29;
|
||||
else if (!(year % 100))
|
||||
return 28;
|
||||
else if (!(year % 4))
|
||||
return 29;
|
||||
else
|
||||
return 28;
|
||||
else if (t->tm_mon >= 0 && t->tm_mon < 12)
|
||||
return mdays[t->tm_mon];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
adjyear(struct tm *t, char type, int val)
|
||||
{
|
||||
switch (type) {
|
||||
case '+':
|
||||
t->tm_year += val;
|
||||
break;
|
||||
case '-':
|
||||
t->tm_year -= val;
|
||||
break;
|
||||
default:
|
||||
t->tm_year = val;
|
||||
if (t->tm_year < 69)
|
||||
t->tm_year += 100; /* as per date.c */
|
||||
else if (t->tm_year > 1900)
|
||||
t->tm_year -= 1900; /* struct tm holds years since 1900 */
|
||||
break;
|
||||
}
|
||||
return mktime(t) != -1;
|
||||
}
|
||||
|
||||
static int
|
||||
adjmon(struct tm *t, char type, int val, int istext)
|
||||
{
|
||||
if (val < 0)
|
||||
return 0;
|
||||
|
||||
switch (type) {
|
||||
case '+':
|
||||
if (istext)
|
||||
if (val <= t->tm_mon)
|
||||
val += 11 - t->tm_mon; /* early next year */
|
||||
else
|
||||
val -= t->tm_mon + 1; /* later this year */
|
||||
if (!adjyear(t, '+', (t->tm_mon + val) / 12))
|
||||
return 0;
|
||||
val %= 12;
|
||||
t->tm_mon += val;
|
||||
if (t->tm_mon > 11)
|
||||
t->tm_mon -= 12;
|
||||
break;
|
||||
|
||||
case '-':
|
||||
if (istext)
|
||||
if (val-1 > t->tm_mon)
|
||||
val = 13 - val + t->tm_mon; /* later last year */
|
||||
else
|
||||
val = t->tm_mon - val + 1; /* early this year */
|
||||
if (!adjyear(t, '-', val / 12))
|
||||
return 0;
|
||||
val %= 12;
|
||||
if (val > t->tm_mon) {
|
||||
if (!adjyear(t, '-', 1))
|
||||
return 0;
|
||||
val -= 12;
|
||||
}
|
||||
t->tm_mon -= val;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (val > 12 || val < 1)
|
||||
return 0;
|
||||
t->tm_mon = --val;
|
||||
}
|
||||
|
||||
return mktime(t) != -1;
|
||||
}
|
||||
|
||||
static int
|
||||
adjday(struct tm *t, char type, int val)
|
||||
{
|
||||
int mdays;
|
||||
switch (type) {
|
||||
case '+':
|
||||
while (val) {
|
||||
mdays = daysinmonth(t);
|
||||
if (val > mdays - t->tm_mday) {
|
||||
val -= mdays - t->tm_mday + 1;
|
||||
t->tm_mday = 1;
|
||||
if (!adjmon(t, '+', 1, 0))
|
||||
return 0;
|
||||
} else {
|
||||
t->tm_mday += val;
|
||||
val = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case '-':
|
||||
while (val)
|
||||
if (val >= t->tm_mday) {
|
||||
val -= t->tm_mday;
|
||||
t->tm_mday = 1;
|
||||
if (!adjmon(t, '-', 1, 0))
|
||||
return 0;
|
||||
t->tm_mday = daysinmonth(t);
|
||||
} else {
|
||||
t->tm_mday -= val;
|
||||
val = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (val > 0 && val <= daysinmonth(t))
|
||||
t->tm_mday = val;
|
||||
else
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return mktime(t) != -1;
|
||||
}
|
||||
|
||||
static int
|
||||
adjwday(struct tm *t, char type, int val, int istext)
|
||||
{
|
||||
if (val < 0)
|
||||
return 0;
|
||||
|
||||
switch (type) {
|
||||
case '+':
|
||||
if (istext)
|
||||
if (val < t->tm_wday)
|
||||
val = 7 - t->tm_wday + val; /* early next week */
|
||||
else
|
||||
val -= t->tm_wday; /* later this week */
|
||||
else
|
||||
val *= 7; /* "-W +5" == "5 weeks in the future" */
|
||||
return adjday(t, '+', val);
|
||||
case '-':
|
||||
if (istext)
|
||||
if (val > t->tm_wday)
|
||||
val = 7 - val + t->tm_wday; /* later last week */
|
||||
else
|
||||
val = t->tm_wday - val; /* early this week */
|
||||
else
|
||||
val *= 7; /* "-W -5" == "5 weeks ago" */
|
||||
return adjday(t, '-', val);
|
||||
default:
|
||||
if (val < t->tm_wday)
|
||||
return adjday(t, '-', t->tm_wday - val);
|
||||
else if (val > 6)
|
||||
return 0;
|
||||
else if (val > t->tm_wday)
|
||||
return adjday(t, '+', val - t->tm_wday);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
adjhour(struct tm *t, char type, int val)
|
||||
{
|
||||
if (val < 0)
|
||||
return 0;
|
||||
|
||||
switch (type) {
|
||||
case '+':
|
||||
if (!adjday(t, '+', (t->tm_hour + val) / 24))
|
||||
return 0;
|
||||
val %= 24;
|
||||
t->tm_hour += val;
|
||||
if (t->tm_hour > 23)
|
||||
t->tm_hour -= 24;
|
||||
break;
|
||||
|
||||
case '-':
|
||||
if (!adjday(t, '-', val / 24))
|
||||
return 0;
|
||||
val %= 24;
|
||||
if (val > t->tm_hour) {
|
||||
if (!adjday(t, '-', 1))
|
||||
return 0;
|
||||
val -= 24;
|
||||
}
|
||||
t->tm_hour -= val;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (val > 23)
|
||||
return 0;
|
||||
t->tm_hour = val;
|
||||
}
|
||||
|
||||
return mktime(t) != -1;
|
||||
}
|
||||
|
||||
static int
|
||||
adjmin(struct tm *t, char type, int val)
|
||||
{
|
||||
if (val < 0)
|
||||
return 0;
|
||||
|
||||
switch (type) {
|
||||
case '+':
|
||||
if (!adjhour(t, '+', (t->tm_min + val) / 60))
|
||||
return 0;
|
||||
val %= 60;
|
||||
t->tm_min += val;
|
||||
if (t->tm_min > 59)
|
||||
t->tm_min -= 60;
|
||||
break;
|
||||
|
||||
case '-':
|
||||
if (!adjhour(t, '-', val / 60))
|
||||
return 0;
|
||||
val %= 60;
|
||||
if (val > t->tm_min) {
|
||||
if (!adjhour(t, '-', 1))
|
||||
return 0;
|
||||
val -= 60;
|
||||
}
|
||||
t->tm_min -= val;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (val > 59)
|
||||
return 0;
|
||||
t->tm_min = val;
|
||||
}
|
||||
|
||||
return mktime(t) != -1;
|
||||
}
|
||||
|
||||
static int
|
||||
adjsec(struct tm *t, char type, int val)
|
||||
{
|
||||
if (val < 0)
|
||||
return 0;
|
||||
|
||||
switch (type) {
|
||||
case '+':
|
||||
if (!adjmin(t, '+', (t->tm_sec + val) / 60))
|
||||
return 0;
|
||||
val %= 60;
|
||||
t->tm_sec += val;
|
||||
if (t->tm_sec > 59)
|
||||
t->tm_sec -= 60;
|
||||
break;
|
||||
|
||||
case '-':
|
||||
if (!adjmin(t, '-', val / 60))
|
||||
return 0;
|
||||
val %= 60;
|
||||
if (val > t->tm_sec) {
|
||||
if (!adjmin(t, '-', 1))
|
||||
return 0;
|
||||
val -= 60;
|
||||
}
|
||||
t->tm_sec -= val;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (val > 59)
|
||||
return 0;
|
||||
t->tm_sec = val;
|
||||
}
|
||||
|
||||
return mktime(t) != -1;
|
||||
}
|
||||
|
||||
const struct vary *
|
||||
vary_apply(const struct vary *v, struct tm *t)
|
||||
{
|
||||
char type;
|
||||
char which;
|
||||
char *arg;
|
||||
int len;
|
||||
int val;
|
||||
|
||||
for (; v; v = v->next) {
|
||||
type = *v->arg;
|
||||
arg = v->arg;
|
||||
if (type == '+' || type == '-')
|
||||
arg++;
|
||||
else
|
||||
type = '\0';
|
||||
len = strlen(arg);
|
||||
if (len < 2)
|
||||
return v;
|
||||
|
||||
if (strspn(arg, digits) != len-1) {
|
||||
val = trans(trans_wday, arg);
|
||||
if (val != -1) {
|
||||
if (!adjwday(t, type, val, 1))
|
||||
return v;
|
||||
} else {
|
||||
val = trans(trans_mon, arg);
|
||||
if (val != -1) {
|
||||
if (!adjmon(t, type, val, 1))
|
||||
return v;
|
||||
} else
|
||||
return v;
|
||||
}
|
||||
} else {
|
||||
val = atoi(arg);
|
||||
which = arg[len-1];
|
||||
|
||||
switch (which) {
|
||||
case 'S':
|
||||
if (!adjsec(t, type, val))
|
||||
return v;
|
||||
break;
|
||||
case 'M':
|
||||
if (!adjmin(t, type, val))
|
||||
return v;
|
||||
break;
|
||||
case 'H':
|
||||
if (!adjhour(t, type, val))
|
||||
return v;
|
||||
break;
|
||||
case 'd':
|
||||
if (!adjday(t, type, val))
|
||||
return v;
|
||||
break;
|
||||
case 'w':
|
||||
if (!adjwday(t, type, val, 0))
|
||||
return v;
|
||||
break;
|
||||
case 'm':
|
||||
if (!adjmon(t, type, val, 0))
|
||||
return v;
|
||||
break;
|
||||
case 'y':
|
||||
if (!adjyear(t, type, val))
|
||||
return v;
|
||||
break;
|
||||
default:
|
||||
return v;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
vary_destroy(struct vary *v)
|
||||
{
|
||||
struct vary *n;
|
||||
|
||||
while (v) {
|
||||
n = v->next;
|
||||
free(v);
|
||||
v = n;
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1997 Brian Somers <brian@Awfulhak.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
struct vary {
|
||||
char *arg;
|
||||
struct vary *next;
|
||||
};
|
||||
|
||||
extern struct vary *vary_append(struct vary *v, char *arg);
|
||||
extern const struct vary *vary_apply(const struct vary *v, struct tm *t);
|
||||
extern void vary_destroy(struct vary *v);
|
||||
+1
-3
@@ -1,9 +1,7 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile,v 1.2 1994/09/24 02:54:40 davidg Exp $
|
||||
|
||||
PROG= dd
|
||||
SRCS= args.c conv.c conv_tab.c dd.c misc.c position.c
|
||||
|
||||
MAINTAINER= [email protected]
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+61
-104
@@ -33,14 +33,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: args.c,v 1.3.8.1 1996/11/21 16:30:28 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)args.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -48,6 +46,7 @@ static const char rcsid[] =
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -67,11 +66,10 @@ static void f_obs __P((char *));
|
||||
static void f_of __P((char *));
|
||||
static void f_seek __P((char *));
|
||||
static void f_skip __P((char *));
|
||||
static quad_t get_num __P((char *));
|
||||
static off_t get_offset __P((char *));
|
||||
static u_long get_bsz __P((char *));
|
||||
|
||||
static const struct arg {
|
||||
const char *name;
|
||||
static struct arg {
|
||||
char *name;
|
||||
void (*f) __P((char *));
|
||||
u_int set, noset;
|
||||
} args[] = {
|
||||
@@ -103,8 +101,6 @@ jcl(argv)
|
||||
in.dbsz = out.dbsz = 512;
|
||||
|
||||
while ((oper = *++argv) != NULL) {
|
||||
if ((oper = strdup(oper)) == NULL)
|
||||
errx(1, "unable to allocate space for the argument \"%s\"", *argv);
|
||||
if ((arg = strchr(oper, '=')) == NULL)
|
||||
errx(1, "unknown operand %s", oper);
|
||||
*arg++ = '\0';
|
||||
@@ -142,14 +138,14 @@ jcl(argv)
|
||||
* Ascii/ebcdic and cbs implies block/unblock.
|
||||
* Block/unblock requires cbs and vice-versa.
|
||||
*/
|
||||
if (ddflags & (C_BLOCK | C_UNBLOCK)) {
|
||||
if (ddflags & (C_BLOCK|C_UNBLOCK)) {
|
||||
if (!(ddflags & C_CBS))
|
||||
errx(1, "record operations require cbs");
|
||||
if (cbsz == 0)
|
||||
errx(1, "cbs cannot be zero");
|
||||
cfunc = ddflags & C_BLOCK ? block : unblock;
|
||||
} else if (ddflags & C_CBS) {
|
||||
if (ddflags & (C_ASCII | C_EBCDIC)) {
|
||||
if (ddflags & (C_ASCII|C_EBCDIC)) {
|
||||
if (ddflags & C_ASCII) {
|
||||
ddflags |= C_UNBLOCK;
|
||||
cfunc = unblock;
|
||||
@@ -159,14 +155,23 @@ jcl(argv)
|
||||
}
|
||||
} else
|
||||
errx(1, "cbs meaningless if not doing record operations");
|
||||
if (cbsz == 0)
|
||||
errx(1, "cbs cannot be zero");
|
||||
} else
|
||||
cfunc = def;
|
||||
|
||||
if (in.dbsz == 0 || out.dbsz == 0)
|
||||
errx(1, "buffer sizes cannot be zero");
|
||||
|
||||
/*
|
||||
* Bail out if the calculation of a file offset would overflow.
|
||||
* Read, write and seek calls take ints as arguments. Seek sizes
|
||||
* could be larger if we wanted to do it in stages or check only
|
||||
* regular files, but it's probably not worth it.
|
||||
*/
|
||||
if (in.offset > QUAD_MAX / in.dbsz || out.offset > QUAD_MAX / out.dbsz)
|
||||
errx(1, "seek offsets cannot be larger than %qd", QUAD_MAX);
|
||||
if (in.dbsz > INT_MAX || out.dbsz > INT_MAX)
|
||||
errx(1, "buffer sizes cannot be greater than %d", INT_MAX);
|
||||
if (in.offset > INT_MAX / in.dbsz || out.offset > INT_MAX / out.dbsz)
|
||||
errx(1, "seek offsets cannot be larger than %d", INT_MAX);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -174,32 +179,23 @@ c_arg(a, b)
|
||||
const void *a, *b;
|
||||
{
|
||||
|
||||
return (strcmp(((const struct arg *)a)->name,
|
||||
((const struct arg *)b)->name));
|
||||
return (strcmp(((struct arg *)a)->name, ((struct arg *)b)->name));
|
||||
}
|
||||
|
||||
static void
|
||||
f_bs(arg)
|
||||
char *arg;
|
||||
{
|
||||
quad_t res;
|
||||
|
||||
res = get_num(arg);
|
||||
if (res < 1 || res > SSIZE_MAX)
|
||||
errx(1, "bs must be between 1 and %d", SSIZE_MAX);
|
||||
in.dbsz = out.dbsz = (size_t)res;
|
||||
in.dbsz = out.dbsz = (int)get_bsz(arg);
|
||||
}
|
||||
|
||||
static void
|
||||
f_cbs(arg)
|
||||
char *arg;
|
||||
{
|
||||
quad_t res;
|
||||
|
||||
res = get_num(arg);
|
||||
if (res < 1 || res > SSIZE_MAX)
|
||||
errx(1, "cbs must be between 1 and %d", SSIZE_MAX);
|
||||
cbsz = (size_t)res;
|
||||
cbsz = (int)get_bsz(arg);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -207,11 +203,9 @@ f_count(arg)
|
||||
char *arg;
|
||||
{
|
||||
|
||||
cpy_cnt = get_num(arg);
|
||||
if (cpy_cnt < 0)
|
||||
errx(1, "count cannot be negative");
|
||||
if (cpy_cnt == 0)
|
||||
cpy_cnt = -1;
|
||||
cpy_cnt = (u_int)get_bsz(arg);
|
||||
if (!cpy_cnt)
|
||||
terminate(0);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -219,23 +213,16 @@ f_files(arg)
|
||||
char *arg;
|
||||
{
|
||||
|
||||
files_cnt = get_num(arg);
|
||||
if (files_cnt < 1)
|
||||
errx(1, "files must be between 1 and %qd", QUAD_MAX);
|
||||
files_cnt = (int)get_bsz(arg);
|
||||
}
|
||||
|
||||
static void
|
||||
f_ibs(arg)
|
||||
char *arg;
|
||||
{
|
||||
quad_t res;
|
||||
|
||||
if (!(ddflags & C_BS)) {
|
||||
res = get_num(arg);
|
||||
if (res < 1 || res > SSIZE_MAX)
|
||||
errx(1, "ibs must be between 1 and %d", SSIZE_MAX);
|
||||
in.dbsz = (size_t)res;
|
||||
}
|
||||
if (!(ddflags & C_BS))
|
||||
in.dbsz = (int)get_bsz(arg);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -250,14 +237,9 @@ static void
|
||||
f_obs(arg)
|
||||
char *arg;
|
||||
{
|
||||
quad_t res;
|
||||
|
||||
if (!(ddflags & C_BS)) {
|
||||
res = get_num(arg);
|
||||
if (res < 1 || res > SSIZE_MAX)
|
||||
errx(1, "obs must be between 1 and %d", SSIZE_MAX);
|
||||
out.dbsz = (size_t)res;
|
||||
}
|
||||
if (!(ddflags & C_BS))
|
||||
out.dbsz = (int)get_bsz(arg);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -273,7 +255,7 @@ f_seek(arg)
|
||||
char *arg;
|
||||
{
|
||||
|
||||
out.offset = get_offset(arg);
|
||||
out.offset = (u_int)get_bsz(arg);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -281,13 +263,13 @@ f_skip(arg)
|
||||
char *arg;
|
||||
{
|
||||
|
||||
in.offset = get_offset(arg);
|
||||
in.offset = (u_int)get_bsz(arg);
|
||||
}
|
||||
|
||||
static const struct conv {
|
||||
const char *name;
|
||||
static struct conv {
|
||||
char *name;
|
||||
u_int set, noset;
|
||||
const u_char *ctab;
|
||||
u_char *ctab;
|
||||
} clist[] = {
|
||||
{ "ascii", C_ASCII, C_EBCDIC, e2a_POSIX },
|
||||
{ "block", C_BLOCK, C_UNBLOCK, NULL },
|
||||
@@ -300,7 +282,6 @@ static const struct conv {
|
||||
{ "oldebcdic", C_EBCDIC, C_ASCII, a2e_32V },
|
||||
{ "oldibm", C_EBCDIC, C_ASCII, a2ibm_32V },
|
||||
{ "osync", C_OSYNC, C_BS, NULL },
|
||||
{ "sparse", C_SPARSE, 0, NULL },
|
||||
{ "swab", C_SWAB, 0, NULL },
|
||||
{ "sync", C_SYNC, 0, NULL },
|
||||
{ "ucase", C_UCASE, C_LCASE, NULL },
|
||||
@@ -315,9 +296,9 @@ f_conv(arg)
|
||||
|
||||
while (arg != NULL) {
|
||||
tmp.name = strsep(&arg, ",");
|
||||
cp = bsearch(&tmp, clist, sizeof(clist) / sizeof(struct conv),
|
||||
sizeof(struct conv), c_conv);
|
||||
if (cp == NULL)
|
||||
if (!(cp = (struct conv *)bsearch(&tmp, clist,
|
||||
sizeof(clist)/sizeof(struct conv), sizeof(struct conv),
|
||||
c_conv)))
|
||||
errx(1, "unknown conversion %s", tmp.name);
|
||||
if (ddflags & cp->noset)
|
||||
errx(1, "%s: illegal conversion combination", tmp.name);
|
||||
@@ -332,38 +313,34 @@ c_conv(a, b)
|
||||
const void *a, *b;
|
||||
{
|
||||
|
||||
return (strcmp(((const struct conv *)a)->name,
|
||||
((const struct conv *)b)->name));
|
||||
return (strcmp(((struct conv *)a)->name, ((struct conv *)b)->name));
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an expression of the following forms to a quad_t.
|
||||
* Convert an expression of the following forms to an unsigned long.
|
||||
* 1) A positive decimal number.
|
||||
* 2) A positive decimal number followed by a b (mult by 512.)
|
||||
* 3) A positive decimal number followed by a k (mult by 1 << 10.)
|
||||
* 4) A positive decimal number followed by a m (mult by 1 << 20.)
|
||||
* 5) A positive decimal number followed by a g (mult by 1 << 30.)
|
||||
* 5) A positive decimal number followed by a w (mult by sizeof int.)
|
||||
* 6) Two or more positive decimal numbers (with/without [bkmgw])
|
||||
* separated by x (also * for backwards compatibility), specifying
|
||||
* 2) A positive decimal number followed by a b (mult by 512).
|
||||
* 3) A positive decimal number followed by a k (mult by 1024).
|
||||
* 4) A positive decimal number followed by a m (mult by 512).
|
||||
* 5) A positive decimal number followed by a w (mult by sizeof int)
|
||||
* 6) Two or more positive decimal numbers (with/without k,b or w).
|
||||
* seperated by x (also * for backwards compatibility), specifying
|
||||
* the product of the indicated values.
|
||||
*/
|
||||
static quad_t
|
||||
get_num(val)
|
||||
static u_long
|
||||
get_bsz(val)
|
||||
char *val;
|
||||
{
|
||||
quad_t num, t;
|
||||
u_long num, t;
|
||||
char *expr;
|
||||
|
||||
errno = 0;
|
||||
num = strtoq(val, &expr, 0);
|
||||
if (errno != 0) /* Overflow or underflow. */
|
||||
num = strtoul(val, &expr, 0);
|
||||
if (num == ULONG_MAX) /* Overflow. */
|
||||
err(1, "%s", oper);
|
||||
|
||||
if (expr == val) /* No valid digits. */
|
||||
if (expr == val) /* No digits. */
|
||||
errx(1, "%s: illegal numeric value", oper);
|
||||
|
||||
switch (*expr) {
|
||||
switch(*expr) {
|
||||
case 'b':
|
||||
t = num;
|
||||
num *= 512;
|
||||
@@ -373,21 +350,14 @@ get_num(val)
|
||||
break;
|
||||
case 'k':
|
||||
t = num;
|
||||
num *= 1 << 10;
|
||||
num *= 1024;
|
||||
if (t > num)
|
||||
goto erange;
|
||||
++expr;
|
||||
break;
|
||||
case 'm':
|
||||
t = num;
|
||||
num *= 1 << 20;
|
||||
if (t > num)
|
||||
goto erange;
|
||||
++expr;
|
||||
break;
|
||||
case 'g':
|
||||
t = num;
|
||||
num *= 1 << 30;
|
||||
num *= 1048576;
|
||||
if (t > num)
|
||||
goto erange;
|
||||
++expr;
|
||||
@@ -401,31 +371,18 @@ get_num(val)
|
||||
break;
|
||||
}
|
||||
|
||||
switch (*expr) {
|
||||
switch(*expr) {
|
||||
case '\0':
|
||||
break;
|
||||
case '*': /* Backward compatible. */
|
||||
case 'x':
|
||||
t = num;
|
||||
num *= get_num(expr + 1);
|
||||
if (t <= num)
|
||||
break;
|
||||
erange:
|
||||
errx(1, "%s: %s", oper, strerror(ERANGE));
|
||||
num *= get_bsz(expr + 1);
|
||||
if (t > num)
|
||||
erange: errx(1, "%s: %s", oper, strerror(ERANGE));
|
||||
break;
|
||||
default:
|
||||
errx(1, "%s: illegal numeric value", oper);
|
||||
}
|
||||
return (num);
|
||||
}
|
||||
|
||||
static off_t
|
||||
get_offset(val)
|
||||
char *val;
|
||||
{
|
||||
quad_t num;
|
||||
|
||||
num = get_num(val);
|
||||
if (num > QUAD_MAX || num < 0) /* XXX quad_t != off_t */
|
||||
errx(1, "%s: illegal offset", oper); /* Too big/negative. */
|
||||
return ((off_t)num);
|
||||
}
|
||||
+27
-34
@@ -33,14 +33,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: conv.c,v 1.3.8.1 1996/11/21 16:30:30 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)conv.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -60,9 +58,8 @@ static const char rcsid[] =
|
||||
void
|
||||
def()
|
||||
{
|
||||
u_char *inp;
|
||||
const u_char *t;
|
||||
size_t cnt;
|
||||
int cnt;
|
||||
u_char *inp, *t;
|
||||
|
||||
if ((t = ctab) != NULL)
|
||||
for (inp = in.dbp - (cnt = in.dbrcnt); cnt--; ++inp)
|
||||
@@ -104,11 +101,9 @@ def_close()
|
||||
void
|
||||
block()
|
||||
{
|
||||
u_char *inp, *outp;
|
||||
const u_char *t;
|
||||
size_t cnt, maxlen;
|
||||
static int intrunc;
|
||||
int ch;
|
||||
int ch, cnt, maxlen;
|
||||
u_char *inp, *outp, *t;
|
||||
|
||||
/*
|
||||
* Record truncation can cross block boundaries. If currently in a
|
||||
@@ -117,8 +112,8 @@ block()
|
||||
* left empty.
|
||||
*/
|
||||
if (intrunc) {
|
||||
for (inp = in.db, cnt = in.dbrcnt; cnt && *inp++ != '\n'; --cnt)
|
||||
;
|
||||
for (inp = in.db, cnt = in.dbrcnt;
|
||||
cnt && *inp++ != '\n'; --cnt);
|
||||
if (!cnt) {
|
||||
in.dbcnt = 0;
|
||||
in.dbp = in.db;
|
||||
@@ -134,23 +129,23 @@ block()
|
||||
* Copy records (max cbsz size chunks) into the output buffer. The
|
||||
* translation is done as we copy into the output buffer.
|
||||
*/
|
||||
ch = 0;
|
||||
ch = 0; /* Help the compiler. */
|
||||
for (inp = in.dbp - in.dbcnt, outp = out.dbp; in.dbcnt;) {
|
||||
maxlen = MIN(cbsz, in.dbcnt);
|
||||
if ((t = ctab) != NULL)
|
||||
for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n';
|
||||
++cnt)
|
||||
for (cnt = 0;
|
||||
cnt < maxlen && (ch = *inp++) != '\n'; ++cnt)
|
||||
*outp++ = t[ch];
|
||||
else
|
||||
for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n';
|
||||
++cnt)
|
||||
for (cnt = 0;
|
||||
cnt < maxlen && (ch = *inp++) != '\n'; ++cnt)
|
||||
*outp++ = ch;
|
||||
/*
|
||||
* Check for short record without a newline. Reassemble the
|
||||
* input block.
|
||||
*/
|
||||
if (ch != '\n' && in.dbcnt < cbsz) {
|
||||
(void)memmove(in.db, in.dbp - in.dbcnt, in.dbcnt);
|
||||
memmove(in.db, in.dbp - in.dbcnt, in.dbcnt);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -200,9 +195,9 @@ block_close()
|
||||
*/
|
||||
if (in.dbcnt) {
|
||||
++st.trunc;
|
||||
(void)memmove(out.dbp, in.dbp - in.dbcnt, in.dbcnt);
|
||||
(void)memset(out.dbp + in.dbcnt, ctab ? ctab[' '] : ' ',
|
||||
cbsz - in.dbcnt);
|
||||
memmove(out.dbp, in.dbp - in.dbcnt, in.dbcnt);
|
||||
(void)memset(out.dbp + in.dbcnt,
|
||||
ctab ? ctab[' '] : ' ', cbsz - in.dbcnt);
|
||||
out.dbcnt += cbsz;
|
||||
}
|
||||
}
|
||||
@@ -217,9 +212,8 @@ block_close()
|
||||
void
|
||||
unblock()
|
||||
{
|
||||
u_char *inp;
|
||||
const u_char *t;
|
||||
size_t cnt;
|
||||
int cnt;
|
||||
u_char *inp, *t;
|
||||
|
||||
/* Translation and case conversion. */
|
||||
if ((t = ctab) != NULL)
|
||||
@@ -231,36 +225,35 @@ unblock()
|
||||
* spaces.
|
||||
*/
|
||||
for (inp = in.db; in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) {
|
||||
for (t = inp + cbsz - 1; t >= inp && *t == ' '; --t)
|
||||
;
|
||||
for (t = inp + cbsz - 1; t >= inp && *t == ' '; --t);
|
||||
if (t >= inp) {
|
||||
cnt = t - inp + 1;
|
||||
(void)memmove(out.dbp, inp, cnt);
|
||||
memmove(out.dbp, inp, cnt);
|
||||
out.dbp += cnt;
|
||||
out.dbcnt += cnt;
|
||||
}
|
||||
++out.dbcnt;
|
||||
*out.dbp++ = '\n';
|
||||
if (++out.dbcnt >= out.dbsz)
|
||||
if (out.dbcnt >= out.dbsz)
|
||||
dd_out(0);
|
||||
}
|
||||
if (in.dbcnt)
|
||||
(void)memmove(in.db, in.dbp - in.dbcnt, in.dbcnt);
|
||||
memmove(in.db, in.dbp - in.dbcnt, in.dbcnt);
|
||||
in.dbp = in.db + in.dbcnt;
|
||||
}
|
||||
|
||||
void
|
||||
unblock_close()
|
||||
{
|
||||
int cnt;
|
||||
u_char *t;
|
||||
size_t cnt;
|
||||
|
||||
if (in.dbcnt) {
|
||||
warnx("%s: short input record", in.name);
|
||||
for (t = in.db + in.dbcnt - 1; t >= in.db && *t == ' '; --t)
|
||||
;
|
||||
for (t = in.db + in.dbcnt - 1; t >= in.db && *t == ' '; --t);
|
||||
if (t >= in.db) {
|
||||
cnt = t - in.db + 1;
|
||||
(void)memmove(out.dbp, in.db, cnt);
|
||||
memmove(out.dbp, in.db, cnt);
|
||||
out.dbp += cnt;
|
||||
out.dbcnt += cnt;
|
||||
}
|
||||
|
||||
+17
-12
@@ -33,20 +33,21 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: conv_tab.c,v 1.3 1995/01/17 23:04:28 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)conv_tab.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
* There are currently six tables:
|
||||
* There are currently eight tables:
|
||||
*
|
||||
* lower-case -> upper-case conv=upper
|
||||
* upper-case -> lower-case conv=lower
|
||||
*
|
||||
* ebcdic -> ascii 32V conv=oldascii
|
||||
* ascii -> ebcdic 32V conv=oldebcdic
|
||||
@@ -69,10 +70,14 @@ static const char rcsid[] =
|
||||
* ACM, Volume 11, Number 11, November 1968, pp. 783-789.
|
||||
*/
|
||||
|
||||
u_char casetab[256];
|
||||
/* Lower-case to upper-case */
|
||||
u_char l2u[256];
|
||||
|
||||
/* Upper-case to lower-case */
|
||||
u_char u2l[256];
|
||||
|
||||
/* EBCDIC to ASCII -- 32V compatible. */
|
||||
const u_char e2a_32V[] = {
|
||||
u_char e2a_32V[] = {
|
||||
0000, 0001, 0002, 0003, 0234, 0011, 0206, 0177, /* 0000 */
|
||||
0227, 0215, 0216, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0235, 0205, 0010, 0207, /* 0020 */
|
||||
@@ -108,7 +113,7 @@ const u_char e2a_32V[] = {
|
||||
};
|
||||
|
||||
/* ASCII to EBCDIC -- 32V compatible. */
|
||||
const u_char a2e_32V[] = {
|
||||
u_char a2e_32V[] = {
|
||||
0000, 0001, 0002, 0003, 0067, 0055, 0056, 0057, /* 0000 */
|
||||
0026, 0005, 0045, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0074, 0075, 0062, 0046, /* 0020 */
|
||||
@@ -144,7 +149,7 @@ const u_char a2e_32V[] = {
|
||||
};
|
||||
|
||||
/* ASCII to IBM EBCDIC -- 32V compatible. */
|
||||
const u_char a2ibm_32V[] = {
|
||||
u_char a2ibm_32V[] = {
|
||||
0000, 0001, 0002, 0003, 0067, 0055, 0056, 0057, /* 0000 */
|
||||
0026, 0005, 0045, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0074, 0075, 0062, 0046, /* 0020 */
|
||||
@@ -180,7 +185,7 @@ const u_char a2ibm_32V[] = {
|
||||
};
|
||||
|
||||
/* EBCDIC to ASCII -- POSIX and System V compatible. */
|
||||
const u_char e2a_POSIX[] = {
|
||||
u_char e2a_POSIX[] = {
|
||||
0000, 0001, 0002, 0003, 0234, 0011, 0206, 0177, /* 0000 */
|
||||
0227, 0215, 0216, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0235, 0205, 0010, 0207, /* 0020 */
|
||||
@@ -216,7 +221,7 @@ const u_char e2a_POSIX[] = {
|
||||
};
|
||||
|
||||
/* ASCII to EBCDIC -- POSIX and System V compatible. */
|
||||
const u_char a2e_POSIX[] = {
|
||||
u_char a2e_POSIX[] = {
|
||||
0000, 0001, 0002, 0003, 0067, 0055, 0056, 0057, /* 0000 */
|
||||
0026, 0005, 0045, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0074, 0075, 0062, 0046, /* 0020 */
|
||||
@@ -252,7 +257,7 @@ const u_char a2e_POSIX[] = {
|
||||
};
|
||||
|
||||
/* ASCII to IBM EBCDIC -- POSIX and System V compatible. */
|
||||
const u_char a2ibm_POSIX[] = {
|
||||
u_char a2ibm_POSIX[] = {
|
||||
0000, 0001, 0002, 0003, 0067, 0055, 0056, 0057, /* 0000 */
|
||||
0026, 0005, 0045, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0074, 0075, 0062, 0046, /* 0020 */
|
||||
|
||||
+19
-28
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)dd.1 8.2 (Berkeley) 1/13/94
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: dd.1,v 1.2.8.1 1997/02/28 07:54:33 mpp Exp $
|
||||
.\"
|
||||
.Dd January 13, 1994
|
||||
.Dt DD 1
|
||||
@@ -52,16 +52,14 @@ Input data is read and written in 512-byte blocks.
|
||||
If input reads are short, input from multiple reads are aggregated
|
||||
to form the output block.
|
||||
When finished,
|
||||
.Nm
|
||||
.Nm dd
|
||||
displays the number of complete and partial input and output blocks
|
||||
and truncated input records to the standard error output.
|
||||
.Pp
|
||||
The following operands are available:
|
||||
.Bl -tag -width of=file
|
||||
.It Cm bs= Ns Ar n
|
||||
Set both input and output block size to
|
||||
.Va n
|
||||
bytes, superseding the
|
||||
Set both input and output block size, superseding the
|
||||
.Cm ibs
|
||||
and
|
||||
.Cm obs
|
||||
@@ -109,13 +107,13 @@ Any regular output file is truncated unless the
|
||||
conversion value is specified.
|
||||
If an initial portion of the output file is skipped (see the
|
||||
.Cm seek
|
||||
operand),
|
||||
operand)
|
||||
the output file is truncated at that point.
|
||||
.It Cm seek= Ns Ar n
|
||||
Seek
|
||||
.Va n
|
||||
blocks from the beginning of the output before copying.
|
||||
On non-tape devices, an
|
||||
On non-tape devices, a
|
||||
.Xr lseek 2
|
||||
operation is used.
|
||||
Otherwise, existing blocks are read and the data discarded.
|
||||
@@ -131,7 +129,7 @@ bytes.
|
||||
Skip
|
||||
.Va n
|
||||
blocks from the beginning of the input before copying.
|
||||
On input which supports seeks, an
|
||||
On input which supports seeks, a
|
||||
.Xr lseek 2
|
||||
operation is used.
|
||||
Otherwise, input data is read and discarded.
|
||||
@@ -150,7 +148,7 @@ is one of the symbols from the following list.
|
||||
The same as the
|
||||
.Cm unblock
|
||||
value except that characters are translated from
|
||||
.Tn EBCDIC
|
||||
.Tn ECBDIC
|
||||
to
|
||||
.Tn ASCII
|
||||
before the
|
||||
@@ -239,7 +237,7 @@ will be positioned past the block in which the error occurred using
|
||||
Do not truncate the output file.
|
||||
This will preserve any blocks in the output file not explicitly written
|
||||
by
|
||||
.Nm Ns .
|
||||
.Nm dd .
|
||||
The
|
||||
.Cm notrunc
|
||||
value is not supported for tapes.
|
||||
@@ -252,13 +250,6 @@ regularly sized blocks to be written.
|
||||
This option is incompatible with use of the
|
||||
.Cm bs= Ns Ar n
|
||||
block size specification.
|
||||
.It Cm sparse
|
||||
If one or more output blocks would consist solely of
|
||||
.Tn NUL
|
||||
bytes, try to seek the output file by the required space instead of
|
||||
filling them with
|
||||
.Tn NULs ,
|
||||
resulting in a sparse file.
|
||||
.It Cm swab
|
||||
Swap every pair of input bytes.
|
||||
If an input buffer has an odd number of bytes, the last byte will be
|
||||
@@ -283,13 +274,13 @@ appended.
|
||||
.El
|
||||
.Pp
|
||||
Where sizes are specified, a decimal number of bytes is expected.
|
||||
If the number ends with a ``b'', ``k'', ``m'', ``g'', or ``w'', the
|
||||
number is multiplied by 512, 1024 (1K), 1048576 (1M), 1073741824 (1G)
|
||||
or the number of bytes in an integer, respectively.
|
||||
If the number ends with a ``b'', ``k'', ``m'' or ``w'', the number
|
||||
is multiplied by 512, 1024 (1K), 1048576 (1M) or the number of bytes
|
||||
in an integer, respectively.
|
||||
Two or more numbers may be separated by an ``x'' to indicate a product.
|
||||
.Pp
|
||||
When finished,
|
||||
.Nm
|
||||
.Nm dd
|
||||
displays the number of complete and partial input and output blocks,
|
||||
truncated input records and odd-length byte-swapping blocks to the
|
||||
standard error output.
|
||||
@@ -312,7 +303,7 @@ This means that the final output block may be shorter than the output
|
||||
block size.
|
||||
.Pp
|
||||
If
|
||||
.Nm
|
||||
.Nm dd
|
||||
receives a
|
||||
.Dv SIGINFO
|
||||
(see the ``status'' argument for
|
||||
@@ -321,25 +312,25 @@ signal, the current input and output block counts will
|
||||
be written to the standard error output
|
||||
in the same format as the standard completion message.
|
||||
If
|
||||
.Nm
|
||||
.Nm dd
|
||||
receives a
|
||||
.Dv SIGINT
|
||||
signal, the current input and output block counts will
|
||||
be written to the standard error output
|
||||
in the same format as the standard completion message and
|
||||
.Nm
|
||||
.Nm dd
|
||||
will exit.
|
||||
.Sh DIAGNOSTICS
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
utility exits 0 on success or >0 if an error occurs.
|
||||
.Nm dd
|
||||
utility exits 0 on success and >0 if an error occurred.
|
||||
.Sh SEE ALSO
|
||||
.Xr cp 1 ,
|
||||
.Xr mt 1 ,
|
||||
.Xr tr 1
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm dd
|
||||
utility is expected to be a superset of the
|
||||
.St -p1003.2
|
||||
standard.
|
||||
|
||||
+74
-118
@@ -33,26 +33,23 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: dd.c,v 1.5.2.1 1996/11/21 16:30:32 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char const copyright[] =
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1991, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mtio.h>
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -60,6 +57,7 @@ static const char rcsid[] =
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <locale.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -76,12 +74,11 @@ static void setup __P((void));
|
||||
IO in, out; /* input/output state */
|
||||
STAT st; /* statistics */
|
||||
void (*cfunc) __P((void)); /* conversion function */
|
||||
quad_t cpy_cnt; /* # of blocks to copy */
|
||||
off_t pending = 0; /* pending seek if sparse */
|
||||
u_long cpy_cnt; /* # of blocks to copy */
|
||||
u_int ddflags; /* conversion options */
|
||||
size_t cbsz; /* conversion block size */
|
||||
quad_t files_cnt = 1; /* # of files to copy */
|
||||
const u_char *ctab; /* conversion table */
|
||||
u_int cbsz; /* conversion block size */
|
||||
u_int files_cnt = 1; /* # of files to copy */
|
||||
u_char *ctab; /* conversion table */
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
@@ -115,7 +112,7 @@ setup()
|
||||
in.fd = STDIN_FILENO;
|
||||
} else {
|
||||
in.fd = open(in.name, O_RDONLY, 0);
|
||||
if (in.fd == -1)
|
||||
if (in.fd < 0)
|
||||
err(1, "%s", in.name);
|
||||
}
|
||||
|
||||
@@ -137,11 +134,11 @@ setup()
|
||||
* Without read we may have a problem if output also does
|
||||
* not support seeks.
|
||||
*/
|
||||
if (out.fd == -1) {
|
||||
if (out.fd < 0) {
|
||||
out.fd = open(out.name, O_WRONLY | OFLAGS, DEFFILEMODE);
|
||||
out.flags |= NOREAD;
|
||||
}
|
||||
if (out.fd == -1)
|
||||
if (out.fd < 0)
|
||||
err(1, "%s", out.name);
|
||||
}
|
||||
|
||||
@@ -151,13 +148,14 @@ setup()
|
||||
* Allocate space for the input and output buffers. If not doing
|
||||
* record oriented I/O, only need a single buffer.
|
||||
*/
|
||||
if (!(ddflags & (C_BLOCK | C_UNBLOCK))) {
|
||||
if (!(ddflags & (C_BLOCK|C_UNBLOCK))) {
|
||||
if ((in.db = malloc(out.dbsz + in.dbsz - 1)) == NULL)
|
||||
err(1, "input buffer");
|
||||
err(1, NULL);
|
||||
out.db = in.db;
|
||||
} else if ((in.db = malloc(MAX(in.dbsz, cbsz) + cbsz)) == NULL ||
|
||||
(out.db = malloc(out.dbsz + cbsz)) == NULL)
|
||||
err(1, "output buffer");
|
||||
} else if ((in.db =
|
||||
malloc((u_int)(MAX(in.dbsz, cbsz) + cbsz))) == NULL ||
|
||||
(out.db = malloc((u_int)(out.dbsz + cbsz))) == NULL)
|
||||
err(1, NULL);
|
||||
in.dbp = in.db;
|
||||
out.dbp = out.db;
|
||||
|
||||
@@ -171,35 +169,51 @@ setup()
|
||||
* Truncate the output file; ignore errors because it fails on some
|
||||
* kinds of output files, tapes, for example.
|
||||
*/
|
||||
if ((ddflags & (C_OF | C_SEEK | C_NOTRUNC)) == (C_OF | C_SEEK))
|
||||
(void)ftruncate(out.fd, out.offset * out.dbsz);
|
||||
if (ddflags & (C_OF | C_SEEK | C_NOTRUNC) == (C_OF | C_SEEK))
|
||||
(void)ftruncate(out.fd, (off_t)out.offset * out.dbsz);
|
||||
|
||||
/*
|
||||
* If converting case at the same time as another conversion, build a
|
||||
* table that does both at once. If just converting case, use the
|
||||
* built-in tables.
|
||||
*/
|
||||
if (ddflags & (C_LCASE | C_UCASE)) {
|
||||
if (ddflags & (C_ASCII | C_EBCDIC)) {
|
||||
if (ddflags & (C_LCASE|C_UCASE))
|
||||
if (ddflags & C_ASCII)
|
||||
if (ddflags & C_LCASE) {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
casetab[cnt] = tolower(ctab[cnt]);
|
||||
if (isupper(ctab[cnt]))
|
||||
ctab[cnt] = tolower(ctab[cnt]);
|
||||
} else {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
casetab[cnt] = toupper(ctab[cnt]);
|
||||
if (islower(ctab[cnt]))
|
||||
ctab[cnt] = toupper(ctab[cnt]);
|
||||
}
|
||||
} else {
|
||||
else if (ddflags & C_EBCDIC)
|
||||
if (ddflags & C_LCASE) {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
casetab[cnt] = tolower(cnt);
|
||||
if (isupper(cnt))
|
||||
ctab[cnt] = ctab[tolower(cnt)];
|
||||
} else {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
casetab[cnt] = toupper(cnt);
|
||||
if (islower(cnt))
|
||||
ctab[cnt] = ctab[toupper(cnt)];
|
||||
}
|
||||
else {
|
||||
ctab = ddflags & C_LCASE ? u2l : l2u;
|
||||
if (ddflags & C_LCASE) {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
if (isupper(cnt))
|
||||
ctab[cnt] = tolower(cnt);
|
||||
else
|
||||
ctab[cnt] = cnt;
|
||||
} else {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
if (islower(cnt))
|
||||
ctab[cnt] = toupper(cnt);
|
||||
else
|
||||
ctab[cnt] = cnt;
|
||||
}
|
||||
}
|
||||
ctab = casetab;
|
||||
}
|
||||
|
||||
(void)gettimeofday(&tv, (struct timezone *)NULL);
|
||||
st.start = tv.tv_sec + tv.tv_usec * 1e-6;
|
||||
}
|
||||
@@ -208,59 +222,36 @@ static void
|
||||
getfdtype(io)
|
||||
IO *io;
|
||||
{
|
||||
struct stat sb;
|
||||
struct disklabel dkl;
|
||||
struct mtget mt;
|
||||
int type;
|
||||
struct stat sb;
|
||||
|
||||
if (fstat(io->fd, &sb) == -1)
|
||||
if (fstat(io->fd, &sb))
|
||||
err(1, "%s", io->name);
|
||||
if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) {
|
||||
if (ioctl(io->fd, DIOCGDINFO, &dkl) == 0 ||
|
||||
/* XXX {,k}mem hack: This sucks. */
|
||||
(major(sb.st_rdev) == 2 &&
|
||||
(minor(sb.st_rdev) == 0 || minor(sb.st_rdev) == 1)))
|
||||
io->flags |= ISSEEK;
|
||||
else if (ioctl(io->fd, MTIOCGET, &mt) == 0)
|
||||
io->flags |= ISTAPE;
|
||||
if (S_ISCHR(sb.st_mode) && (io->flags & ISTAPE) == 0)
|
||||
io->flags |= ISCHR;
|
||||
return;
|
||||
}
|
||||
errno = 0;
|
||||
if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE)
|
||||
io->flags |= ISPIPE;
|
||||
else
|
||||
io->flags |= ISSEEK;
|
||||
if (S_ISCHR(sb.st_mode))
|
||||
io->flags |= ioctl(io->fd, MTIOCGET, &mt) ? ISCHR : ISTAPE;
|
||||
else if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE)
|
||||
io->flags |= ISPIPE; /* XXX fixed in 4.4BSD */
|
||||
}
|
||||
|
||||
static void
|
||||
dd_in()
|
||||
{
|
||||
ssize_t n;
|
||||
int flags, n;
|
||||
|
||||
for (;;) {
|
||||
switch (cpy_cnt) {
|
||||
case -1: /* count=0 was specified */
|
||||
for (flags = ddflags;;) {
|
||||
if (cpy_cnt && (st.in_full + st.in_part) >= cpy_cnt)
|
||||
return;
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
if (st.in_full + st.in_part >= cpy_cnt)
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Zero the buffer first if sync; if doing block operations,
|
||||
* Zero the buffer first if trying to recover from errors so
|
||||
* lose the minimum amount of data. If doing block operations
|
||||
* use spaces.
|
||||
*/
|
||||
if (ddflags & C_SYNC) {
|
||||
if (ddflags & (C_BLOCK | C_UNBLOCK))
|
||||
if ((flags & (C_NOERROR|C_SYNC)) == (C_NOERROR|C_SYNC))
|
||||
if (flags & (C_BLOCK|C_UNBLOCK))
|
||||
memset(in.dbp, ' ', in.dbsz);
|
||||
else
|
||||
memset(in.dbp, 0, in.dbsz);
|
||||
}
|
||||
|
||||
n = read(in.fd, in.dbp, in.dbsz);
|
||||
if (n == 0) {
|
||||
@@ -269,23 +260,23 @@ dd_in()
|
||||
}
|
||||
|
||||
/* Read error. */
|
||||
if (n == -1) {
|
||||
if (n < 0) {
|
||||
/*
|
||||
* If noerror not specified, die. POSIX requires that
|
||||
* the warning message be followed by an I/O display.
|
||||
*/
|
||||
if (!(ddflags & C_NOERROR))
|
||||
if (!(flags & C_NOERROR))
|
||||
err(1, "%s", in.name);
|
||||
warn("%s", in.name);
|
||||
summary();
|
||||
|
||||
/*
|
||||
* If it's a seekable file descriptor, seek past the
|
||||
* If it's not a tape drive or a pipe, seek past the
|
||||
* error. If your OS doesn't do the right thing for
|
||||
* raw disks this section should be modified to re-read
|
||||
* in sector size chunks.
|
||||
*/
|
||||
if (in.flags & ISSEEK &&
|
||||
if (!(in.flags & (ISPIPE|ISTAPE)) &&
|
||||
lseek(in.fd, (off_t)in.dbsz, SEEK_CUR))
|
||||
warn("%s", in.name);
|
||||
|
||||
@@ -325,7 +316,7 @@ dd_in()
|
||||
}
|
||||
|
||||
if (ddflags & C_SWAB) {
|
||||
if ((n = in.dbrcnt) & 1) {
|
||||
if ((n = in.dbcnt) & 1) {
|
||||
++st.swab;
|
||||
--n;
|
||||
}
|
||||
@@ -338,7 +329,7 @@ dd_in()
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean up any remaining I/O and flush output. If necessary, the output file
|
||||
* Cleanup any remaining I/O and flush output. If necesssary, output file
|
||||
* is truncated.
|
||||
*/
|
||||
static void
|
||||
@@ -350,14 +341,11 @@ dd_close()
|
||||
block_close();
|
||||
else if (cfunc == unblock)
|
||||
unblock_close();
|
||||
if (ddflags & C_OSYNC && out.dbcnt && out.dbcnt < out.dbsz) {
|
||||
if (ddflags & (C_BLOCK | C_UNBLOCK))
|
||||
memset(out.dbp, ' ', out.dbsz - out.dbcnt);
|
||||
else
|
||||
memset(out.dbp, 0, out.dbsz - out.dbcnt);
|
||||
if (ddflags & C_OSYNC && out.dbcnt < out.dbsz) {
|
||||
memset(out.dbp, 0, out.dbsz - out.dbcnt);
|
||||
out.dbcnt = out.dbsz;
|
||||
}
|
||||
if (out.dbcnt || pending)
|
||||
if (out.dbcnt)
|
||||
dd_out(1);
|
||||
}
|
||||
|
||||
@@ -365,11 +353,9 @@ void
|
||||
dd_out(force)
|
||||
int force;
|
||||
{
|
||||
u_char *outp;
|
||||
size_t cnt, i, n;
|
||||
ssize_t nw;
|
||||
static int warned;
|
||||
int sparse;
|
||||
int cnt, n, nw;
|
||||
u_char *outp;
|
||||
|
||||
/*
|
||||
* Write one or more blocks out. The common case is writing a full
|
||||
@@ -390,36 +376,7 @@ dd_out(force)
|
||||
outp = out.db;
|
||||
for (n = force ? out.dbcnt : out.dbsz;; n = out.dbsz) {
|
||||
for (cnt = n;; cnt -= nw) {
|
||||
sparse = 0;
|
||||
if (ddflags & C_SPARSE) {
|
||||
sparse = 1; /* Is buffer sparse? */
|
||||
for (i = 0; i < cnt; i++)
|
||||
if (outp[i] != 0) {
|
||||
sparse = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sparse && !force) {
|
||||
pending += cnt;
|
||||
nw = cnt;
|
||||
} else {
|
||||
if (pending != 0) {
|
||||
if (force)
|
||||
pending--;
|
||||
if (lseek(out.fd, pending, SEEK_CUR) ==
|
||||
-1)
|
||||
err(2, "%s: seek error creating sparse file",
|
||||
out.name);
|
||||
if (force)
|
||||
write(out.fd, outp, 1);
|
||||
pending = 0;
|
||||
}
|
||||
if (cnt)
|
||||
nw = write(out.fd, outp, cnt);
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
nw = write(out.fd, outp, cnt);
|
||||
if (nw <= 0) {
|
||||
if (nw == 0)
|
||||
errx(1, "%s: end of device", out.name);
|
||||
@@ -439,14 +396,13 @@ dd_out(force)
|
||||
++st.out_part;
|
||||
if (nw == cnt)
|
||||
break;
|
||||
if (out.flags & ISTAPE)
|
||||
errx(1, "%s: short write on tape device",
|
||||
out.name);
|
||||
if (out.flags & ISCHR && !warned) {
|
||||
warned = 1;
|
||||
warnx("%s: short write on character device",
|
||||
out.name);
|
||||
}
|
||||
if (out.flags & ISTAPE)
|
||||
errx(1, "%s: short write on tape device", out.name);
|
||||
}
|
||||
if ((out.dbcnt -= n) < out.dbsz)
|
||||
break;
|
||||
@@ -454,6 +410,6 @@ dd_out(force)
|
||||
|
||||
/* Reassemble the output block. */
|
||||
if (out.dbcnt)
|
||||
(void)memmove(out.db, out.dbp - out.dbcnt, out.dbcnt);
|
||||
memmove(out.db, out.dbp - out.dbcnt, out.dbcnt);
|
||||
out.dbp = out.db + out.dbcnt;
|
||||
}
|
||||
+25
-28
@@ -35,44 +35,42 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)dd.h 8.3 (Berkeley) 4/2/94
|
||||
* $FreeBSD$
|
||||
* $Id: dd.h,v 1.2.8.1 1996/11/21 16:30:33 phk Exp $
|
||||
*/
|
||||
|
||||
/* Input/output stream state. */
|
||||
typedef struct {
|
||||
u_char *db; /* buffer address */
|
||||
u_char *dbp; /* current buffer I/O address */
|
||||
/* XXX ssize_t? */
|
||||
size_t dbcnt; /* current buffer byte count */
|
||||
size_t dbrcnt; /* last read byte count */
|
||||
size_t dbsz; /* buffer size */
|
||||
u_char *db; /* buffer address */
|
||||
u_char *dbp; /* current buffer I/O address */
|
||||
u_long dbcnt; /* current buffer byte count */
|
||||
int dbrcnt; /* last read byte count */
|
||||
u_long dbsz; /* buffer size */
|
||||
|
||||
#define ISCHR 0x01 /* character device (warn on short) */
|
||||
#define ISPIPE 0x02 /* pipe-like (not truncatable) */
|
||||
#define ISTAPE 0x04 /* tape */
|
||||
#define ISSEEK 0x08 /* valid to seek on */
|
||||
#define NOREAD 0x10 /* not readable */
|
||||
u_int flags;
|
||||
#define ISPIPE 0x02 /* pipe (not truncatable) */
|
||||
#define ISTAPE 0x04 /* tape (not seekable) */
|
||||
#define NOREAD 0x08 /* not readable */
|
||||
u_int flags;
|
||||
|
||||
char *name; /* name */
|
||||
int fd; /* file descriptor */
|
||||
off_t offset; /* # of blocks to skip */
|
||||
char *name; /* name */
|
||||
int fd; /* file descriptor */
|
||||
u_long offset; /* # of blocks to skip */
|
||||
|
||||
u_quad_t f_stats; /* # of full blocks processed */
|
||||
u_quad_t p_stats; /* # of partial blocks processed */
|
||||
u_quad_t s_stats; /* # of odd swab blocks */
|
||||
u_quad_t t_stats; /* # of truncations */
|
||||
u_long f_stats; /* # of full blocks processed */
|
||||
u_long p_stats; /* # of partial blocks processed */
|
||||
u_long s_stats; /* # of odd swab blocks */
|
||||
u_long t_stats; /* # of truncations */
|
||||
} IO;
|
||||
|
||||
typedef struct {
|
||||
u_quad_t in_full; /* # of full input blocks */
|
||||
u_quad_t in_part; /* # of partial input blocks */
|
||||
u_quad_t out_full; /* # of full output blocks */
|
||||
u_quad_t out_part; /* # of partial output blocks */
|
||||
u_quad_t trunc; /* # of truncated records */
|
||||
u_quad_t swab; /* # of odd-length swab blocks */
|
||||
u_quad_t bytes; /* # of bytes written */
|
||||
double start; /* start time of dd */
|
||||
u_long in_full; /* # of full input blocks */
|
||||
u_long in_part; /* # of partial input blocks */
|
||||
u_long out_full; /* # of full output blocks */
|
||||
u_long out_part; /* # of partial output blocks */
|
||||
u_long trunc; /* # of truncated records */
|
||||
u_long swab; /* # of odd-length swab blocks */
|
||||
u_long bytes; /* # of bytes written */
|
||||
double start; /* start time of dd */
|
||||
} STAT;
|
||||
|
||||
/* Flags (in ddflags). */
|
||||
@@ -97,4 +95,3 @@ typedef struct {
|
||||
#define C_UCASE 0x40000
|
||||
#define C_UNBLOCK 0x80000
|
||||
#define C_OSYNC 0x100000
|
||||
#define C_SPARSE 0x200000
|
||||
+7
-9
@@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)extern.h 8.3 (Berkeley) 4/2/94
|
||||
* $FreeBSD$
|
||||
* $Id: extern.h,v 1.2 1994/09/24 02:54:57 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
@@ -57,12 +57,10 @@ void unblock_close __P((void));
|
||||
extern IO in, out;
|
||||
extern STAT st;
|
||||
extern void (*cfunc)();
|
||||
extern quad_t cpy_cnt;
|
||||
extern size_t cbsz;
|
||||
extern u_long cpy_cnt;
|
||||
extern u_int cbsz;
|
||||
extern u_int ddflags;
|
||||
extern quad_t files_cnt;
|
||||
extern const u_char *ctab;
|
||||
extern const u_char a2e_32V[], a2e_POSIX[];
|
||||
extern const u_char e2a_32V[], e2a_POSIX[];
|
||||
extern const u_char a2ibm_32V[], a2ibm_POSIX[];
|
||||
extern u_char casetab[];
|
||||
extern u_int files_cnt;
|
||||
extern u_char *ctab;
|
||||
extern u_char a2e_32V[], a2e_POSIX[], a2ibm_32V[], a2ibm_POSIX[], e2a_32V[];
|
||||
extern u_char e2a_POSIX[], l2u[], u2l[];
|
||||
+13
-15
@@ -33,21 +33,22 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: misc.c,v 1.2.8.1 1996/11/21 16:30:35 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <err.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "dd.h"
|
||||
@@ -66,21 +67,21 @@ summary()
|
||||
secs = 1e-6;
|
||||
/* Use snprintf(3) so that we don't reenter stdio(3). */
|
||||
(void)snprintf(buf, sizeof(buf),
|
||||
"%qu+%qu records in\n%qu+%qu records out\n",
|
||||
"%u+%u records in\n%u+%u records out\n",
|
||||
st.in_full, st.in_part, st.out_full, st.out_part);
|
||||
(void)write(STDERR_FILENO, buf, strlen(buf));
|
||||
if (st.swab) {
|
||||
(void)snprintf(buf, sizeof(buf), "%qu odd length swab %s\n",
|
||||
(void)snprintf(buf, sizeof(buf), "%u odd length swab %s\n",
|
||||
st.swab, (st.swab == 1) ? "block" : "blocks");
|
||||
(void)write(STDERR_FILENO, buf, strlen(buf));
|
||||
}
|
||||
if (st.trunc) {
|
||||
(void)snprintf(buf, sizeof(buf), "%qu truncated %s\n",
|
||||
(void)snprintf(buf, sizeof(buf), "%u truncated %s\n",
|
||||
st.trunc, (st.trunc == 1) ? "block" : "blocks");
|
||||
(void)write(STDERR_FILENO, buf, strlen(buf));
|
||||
}
|
||||
(void)snprintf(buf, sizeof(buf),
|
||||
"%qu bytes transferred in %.6f secs (%.0f bytes/sec)\n",
|
||||
"%u bytes transferred in %.6f secs (%.0f bytes/sec)\n",
|
||||
st.bytes, secs, st.bytes / secs);
|
||||
(void)write(STDERR_FILENO, buf, strlen(buf));
|
||||
}
|
||||
@@ -90,18 +91,15 @@ void
|
||||
summaryx(notused)
|
||||
int notused;
|
||||
{
|
||||
int save_errno = errno;
|
||||
|
||||
summary();
|
||||
errno = save_errno;
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
terminate(sig)
|
||||
int sig;
|
||||
terminate(notused)
|
||||
int notused;
|
||||
{
|
||||
|
||||
/* XXX exit() shouldn't call exit() from a signal handler. */
|
||||
exit(sig == 0 ? 0 : 1);
|
||||
exit(0);
|
||||
}
|
||||
+14
-20
@@ -33,21 +33,22 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: position.c,v 1.2 1994/09/24 02:55:03 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)position.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mtio.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "dd.h"
|
||||
@@ -62,16 +63,11 @@ static const char rcsid[] =
|
||||
void
|
||||
pos_in()
|
||||
{
|
||||
off_t cnt;
|
||||
int warned;
|
||||
ssize_t nr;
|
||||
size_t bcnt;
|
||||
int bcnt, cnt, nr, warned;
|
||||
|
||||
/* If known to be seekable, try to seek on it. */
|
||||
if (in.flags & ISSEEK) {
|
||||
errno = 0;
|
||||
if (lseek(in.fd, in.offset * in.dbsz, SEEK_CUR) == -1 &&
|
||||
errno != 0)
|
||||
/* If not a character, pipe or tape device, try to seek on it. */
|
||||
if (!(in.flags & (ISCHR|ISPIPE|ISTAPE))) {
|
||||
if (lseek(in.fd, (off_t)(in.offset * in.dbsz), SEEK_CUR) == -1)
|
||||
err(1, "%s", in.name);
|
||||
return;
|
||||
}
|
||||
@@ -122,8 +118,7 @@ void
|
||||
pos_out()
|
||||
{
|
||||
struct mtop t_op;
|
||||
off_t cnt;
|
||||
ssize_t n;
|
||||
int cnt, n;
|
||||
|
||||
/*
|
||||
* If not a tape, try seeking on the file. Seeking on a pipe is
|
||||
@@ -131,9 +126,8 @@ pos_out()
|
||||
* have specified the seek operand.
|
||||
*/
|
||||
if (!(out.flags & ISTAPE)) {
|
||||
errno = 0;
|
||||
if (lseek(out.fd, out.offset * out.dbsz, SEEK_CUR) == -1 &&
|
||||
errno != 0)
|
||||
if (lseek(out.fd,
|
||||
(off_t)out.offset * out.dbsz, SEEK_SET) == -1)
|
||||
err(1, "%s", out.name);
|
||||
return;
|
||||
}
|
||||
@@ -143,7 +137,7 @@ pos_out()
|
||||
t_op.mt_op = MTFSR;
|
||||
t_op.mt_count = out.offset;
|
||||
|
||||
if (ioctl(out.fd, MTIOCTOP, &t_op) == -1)
|
||||
if (ioctl(out.fd, MTIOCTOP, &t_op) < 0)
|
||||
err(1, "%s", out.name);
|
||||
return;
|
||||
}
|
||||
@@ -153,7 +147,7 @@ pos_out()
|
||||
if ((n = read(out.fd, out.db, out.dbsz)) > 0)
|
||||
continue;
|
||||
|
||||
if (n == -1)
|
||||
if (n < 0)
|
||||
err(1, "%s", out.name);
|
||||
|
||||
/*
|
||||
|
||||
+2
-7
@@ -1,13 +1,8 @@
|
||||
# $FreeBSD$
|
||||
# @(#)Makefile 8.3 (Berkeley) 5/8/95
|
||||
# @(#)Makefile 8.2 (Berkeley) 4/1/94
|
||||
# $Id: Makefile,v 1.2 1994/09/24 02:55:06 davidg Exp $
|
||||
|
||||
PROG= df
|
||||
SRCS= df.c vfslist.c
|
||||
BINGRP= operator
|
||||
BINMODE=2555
|
||||
|
||||
MOUNT= ${.CURDIR}/../../sbin/mount
|
||||
CFLAGS+= -I${MOUNT}
|
||||
.PATH: ${MOUNT}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+28
-32
@@ -29,10 +29,10 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)df.1 8.3 (Berkeley) 5/8/95
|
||||
.\" $FreeBSD$
|
||||
.\" @(#)df.1 8.2 (Berkeley) 1/13/94
|
||||
.\" $Id: df.1,v 1.4.2.1 1996/12/13 17:15:10 joerg Exp $
|
||||
.\"
|
||||
.Dd May 8, 1995
|
||||
.Dd January 13, 1994
|
||||
.Dt DF 1
|
||||
.Os BSD 4
|
||||
.Sh NAME
|
||||
@@ -40,7 +40,7 @@
|
||||
.Nd display free disk space
|
||||
.Sh SYNOPSIS
|
||||
.Nm df
|
||||
.Op Fl ikn
|
||||
.Op Fl ink
|
||||
.Op Fl t Ar type
|
||||
.Op Ar file | Ar filesystem ...
|
||||
.Sh DESCRIPTION
|
||||
@@ -50,7 +50,7 @@ displays statistics about the amount of free disk space on the specified
|
||||
or on the filesystem of which
|
||||
.Ar file
|
||||
is a part.
|
||||
Values are displayed in 512-byte per block counts.
|
||||
Values are displayed in 512-byte per block block counts.
|
||||
If neither a file or a filesystem operand is specified,
|
||||
statistics for all mounted filesystems are displayed
|
||||
(subject to the
|
||||
@@ -72,37 +72,34 @@ This option should be used if it is possible that one or more
|
||||
filesystems are in a state such that they will not be able to provide
|
||||
statistics without a long delay.
|
||||
When this option is specified,
|
||||
.Nm
|
||||
.Nm df
|
||||
will not request new statistics from the filesystems, but will respond
|
||||
with the possibly stale statistics that were previously obtained.
|
||||
.It Fl t
|
||||
Only print out statistics for filesystems of the specified types.
|
||||
More than one type may be specified in a comma separated list.
|
||||
The list of filesystem types can be prefixed with
|
||||
.Dq no
|
||||
to specify the filesystem types for which action should
|
||||
.Em not
|
||||
be taken.
|
||||
For example, the
|
||||
.Nm
|
||||
command:
|
||||
.Bd -literal -offset indent
|
||||
df -t nonfs,mfs
|
||||
.Ed
|
||||
.Pp
|
||||
lists all filesystems except those of type
|
||||
.Tn NFS
|
||||
and
|
||||
.Tn MFS .
|
||||
The
|
||||
.Xr lsvfs 1
|
||||
command can be used to find out the types of filesystems
|
||||
that are available on the system.
|
||||
The recognized types are:
|
||||
ufs, nfs, mfs, lfs, msdos, fdesc, portal, kernfs, procfs, afs, isofs,
|
||||
iso9660fs, cdfs, and cd9660,
|
||||
along with the aggregates:
|
||||
all (the default),
|
||||
local (ufs, mfs, lfs, msdos, cd9660),
|
||||
and misc (fdesc, portal, kernfs, procfs).
|
||||
The names isofs, iso9660fs, cdfs, and cd9660 are aliases to each other
|
||||
all of them refering to the same type of file system.
|
||||
The string ``no'' may be prepending to a type to get its complement
|
||||
(e.g. ``nonfs'' to get non-NFS filesystems). The first
|
||||
.Fl t
|
||||
option overrides the default, additional such options will add to
|
||||
(or subtract from) the current set of types; e.g. either
|
||||
``df -t ufs -t lfs''
|
||||
or
|
||||
``df -t local -t nomfs''
|
||||
will display statistics for UFS and LFS filesystems.
|
||||
.El
|
||||
.Sh ENVIRONMENT
|
||||
.Sh ENVIRONMENTAL VARIABLES
|
||||
.Bl -tag -width BLOCKSIZE
|
||||
.It Ev BLOCKSIZE
|
||||
If the environment variable
|
||||
If the environmental variable
|
||||
.Ev BLOCKSIZE
|
||||
is set, the block counts will be displayed in units of that size block.
|
||||
.El
|
||||
@@ -113,17 +110,16 @@ and
|
||||
.Fl t
|
||||
flags are ignored if a file or filesystem is specified.
|
||||
.Sh SEE ALSO
|
||||
.Xr lsvfs 1 ,
|
||||
.Xr quota 1 ,
|
||||
.Xr statfs 2 ,
|
||||
.Xr fstatfs 2 ,
|
||||
.Xr getfsstat 2 ,
|
||||
.Xr statfs 2 ,
|
||||
.Xr getmntinfo 3 ,
|
||||
.Xr fstab 5 ,
|
||||
.Xr mount 8 ,
|
||||
.Xr quot 8
|
||||
.Sh HISTORY
|
||||
A
|
||||
.Nm
|
||||
.Nm df
|
||||
command appeared in
|
||||
.At v1 .
|
||||
+121
-74
@@ -34,27 +34,23 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: df.c,v 1.8.2.1 1996/12/13 17:15:11 joerg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char copyright[] =
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1980, 1990, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)df.c 8.9 (Berkeley) 5/8/95";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
static char sccsid[] = "@(#)df.c 8.7 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mount.h>
|
||||
#include <ufs/ufs/ufsmount.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
@@ -64,16 +60,59 @@ static const char rcsid[] =
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int checkvfsname __P((const char *, char **));
|
||||
char **makevfslist __P((char *));
|
||||
long regetmntinfo __P((struct statfs **, long, char **));
|
||||
int bread __P((off_t, void *, int));
|
||||
char *getmntpt __P((char *));
|
||||
void prtstat __P((struct statfs *, int));
|
||||
int ufs_df __P((char *, int));
|
||||
void usage __P((void));
|
||||
/* XXX assumes MOUNT_MAXTYPE < 32 */
|
||||
#define MT(m) (1 << (m))
|
||||
|
||||
int iflag, nflag;
|
||||
/* fixed values */
|
||||
#define MT_NONE (0)
|
||||
#define MT_ALL (MT(MOUNT_MAXTYPE+1)-1)
|
||||
|
||||
/* subject to change */
|
||||
#define MT_LOCAL \
|
||||
(MT(MOUNT_UFS)|MT(MOUNT_MFS)|MT(MOUNT_LFS)|MT(MOUNT_MSDOS)|MT(MOUNT_CD9660))
|
||||
#define MT_DEFAULT MT_ALL
|
||||
|
||||
struct typetab {
|
||||
char *str;
|
||||
long types;
|
||||
} typetab[] = {
|
||||
{"ufs", MT(MOUNT_UFS)},
|
||||
{"local", MT_LOCAL},
|
||||
{"all", MT_ALL},
|
||||
{"nfs", MT(MOUNT_NFS)},
|
||||
{"mfs", MT(MOUNT_MFS)},
|
||||
{"lfs", MT(MOUNT_LFS)},
|
||||
{"msdos", MT(MOUNT_MSDOS)},
|
||||
{"fdesc", MT(MOUNT_FDESC)},
|
||||
{"portal", MT(MOUNT_PORTAL)},
|
||||
#if 0
|
||||
/* return fsid of underlying FS */
|
||||
{"lofs", MT(MOUNT_LOFS)},
|
||||
{"null", MT(MOUNT_NULL)},
|
||||
{"umap", MT(MOUNT_UMAP)},
|
||||
#endif
|
||||
{"kernfs", MT(MOUNT_KERNFS)},
|
||||
{"procfs", MT(MOUNT_PROCFS)},
|
||||
{"afs", MT(MOUNT_AFS)},
|
||||
{"iso9660fs", MT(MOUNT_CD9660)},
|
||||
{"isofs", MT(MOUNT_CD9660)},
|
||||
{"cd9660", MT(MOUNT_CD9660)},
|
||||
{"cdfs", MT(MOUNT_CD9660)},
|
||||
{"misc", MT(MOUNT_LOFS)|MT(MOUNT_FDESC)|MT(MOUNT_PORTAL)|
|
||||
MT(MOUNT_KERNFS)|MT(MOUNT_PROCFS)},
|
||||
{NULL, 0}
|
||||
|
||||
};
|
||||
|
||||
long addtype __P((long, char *));
|
||||
long regetmntinfo __P((struct statfs **, long, long));
|
||||
int bread __P((off_t, void *, int));
|
||||
char *getmntpt __P((char *));
|
||||
void prtstat __P((struct statfs *, int));
|
||||
void ufs_df __P((char *, int));
|
||||
void usage __P((void));
|
||||
|
||||
int iflag, nflag, tflag;
|
||||
struct ufs_args mdev;
|
||||
|
||||
int
|
||||
@@ -83,12 +122,14 @@ main(argc, argv)
|
||||
{
|
||||
struct stat stbuf;
|
||||
struct statfs statfsbuf, *mntbuf;
|
||||
long mntsize;
|
||||
int ch, err, i, maxwidth, rv, width;
|
||||
char *mntpt, *mntpath, **vfslist;
|
||||
long fsmask, mntsize;
|
||||
int ch, err, i, maxwidth, width;
|
||||
char *mntpt;
|
||||
|
||||
vfslist = NULL;
|
||||
while ((ch = getopt(argc, argv, "iknt:")) != -1)
|
||||
iflag = nflag = tflag = 0;
|
||||
fsmask = MT_NONE;
|
||||
|
||||
while ((ch = getopt(argc, argv, "iknt:")) != EOF)
|
||||
switch (ch) {
|
||||
case 'i':
|
||||
iflag = 1;
|
||||
@@ -100,9 +141,8 @@ main(argc, argv)
|
||||
nflag = 1;
|
||||
break;
|
||||
case 't':
|
||||
if (vfslist != NULL)
|
||||
errx(1, "only one -t option may be specified.");
|
||||
vfslist = makevfslist(optarg);
|
||||
fsmask = addtype(fsmask, optarg);
|
||||
tflag = 1;
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
@@ -119,10 +159,11 @@ main(argc, argv)
|
||||
maxwidth = width;
|
||||
}
|
||||
|
||||
rv = 0;
|
||||
if (!*argv) {
|
||||
mntsize = regetmntinfo(&mntbuf, mntsize, vfslist);
|
||||
if (vfslist != NULL) {
|
||||
if (!tflag)
|
||||
fsmask = MT_DEFAULT;
|
||||
mntsize = regetmntinfo(&mntbuf, mntsize, fsmask);
|
||||
if (fsmask != MT_ALL) {
|
||||
maxwidth = 0;
|
||||
for (i = 0; i < mntsize; i++) {
|
||||
width = strlen(mntbuf[i].f_mntfromname);
|
||||
@@ -132,7 +173,7 @@ main(argc, argv)
|
||||
}
|
||||
for (i = 0; i < mntsize; i++)
|
||||
prtstat(&mntbuf[i], maxwidth);
|
||||
exit(rv);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
for (; *argv; argv++) {
|
||||
@@ -140,44 +181,31 @@ main(argc, argv)
|
||||
err = errno;
|
||||
if ((mntpt = getmntpt(*argv)) == 0) {
|
||||
warn("%s", *argv);
|
||||
rv = 1;
|
||||
continue;
|
||||
}
|
||||
} else if ((stbuf.st_mode & S_IFMT) == S_IFCHR) {
|
||||
rv = ufs_df(*argv, maxwidth) || rv;
|
||||
ufs_df(*argv, maxwidth);
|
||||
continue;
|
||||
} else if ((stbuf.st_mode & S_IFMT) == S_IFBLK) {
|
||||
if ((mntpt = getmntpt(*argv)) == 0) {
|
||||
mntpt = mktemp(strdup("/tmp/df.XXXXXX"));
|
||||
mdev.fspec = *argv;
|
||||
mntpath = strdup("/tmp/df.XXXXXX");
|
||||
if (mntpath == NULL) {
|
||||
warn("strdup failed");
|
||||
rv = 1;
|
||||
if (mkdir(mntpt, DEFFILEMODE) != 0) {
|
||||
warn("%s", mntpt);
|
||||
continue;
|
||||
}
|
||||
mntpt = mkdtemp(mntpath);
|
||||
if (mntpt == NULL) {
|
||||
warn("mkdtemp(\"%s\") failed", mntpath);
|
||||
rv = 1;
|
||||
free(mntpath);
|
||||
continue;
|
||||
}
|
||||
if (mount("ufs", mntpt, MNT_RDONLY,
|
||||
if (mount(MOUNT_UFS, mntpt, MNT_RDONLY,
|
||||
&mdev) != 0) {
|
||||
rv = ufs_df(*argv, maxwidth) || rv;
|
||||
ufs_df(*argv, maxwidth);
|
||||
(void)rmdir(mntpt);
|
||||
free(mntpath);
|
||||
continue;
|
||||
} else if (statfs(mntpt, &statfsbuf) == 0) {
|
||||
} else if (statfs(mntpt, &statfsbuf)) {
|
||||
statfsbuf.f_mntonname[0] = '\0';
|
||||
prtstat(&statfsbuf, maxwidth);
|
||||
} else {
|
||||
} else
|
||||
warn("%s", *argv);
|
||||
rv = 1;
|
||||
}
|
||||
(void)unmount(mntpt, 0);
|
||||
(void)rmdir(mntpt);
|
||||
free(mntpath);
|
||||
continue;
|
||||
}
|
||||
} else
|
||||
@@ -188,14 +216,13 @@ main(argc, argv)
|
||||
*/
|
||||
if (statfs(mntpt, &statfsbuf) < 0) {
|
||||
warn("%s", mntpt);
|
||||
rv = 1;
|
||||
continue;
|
||||
}
|
||||
if (argc == 1)
|
||||
maxwidth = strlen(statfsbuf.f_mntfromname) + 1;
|
||||
prtstat(&statfsbuf, maxwidth);
|
||||
}
|
||||
return (rv);
|
||||
return (0);
|
||||
}
|
||||
|
||||
char *
|
||||
@@ -213,32 +240,55 @@ getmntpt(name)
|
||||
return (0);
|
||||
}
|
||||
|
||||
long
|
||||
addtype(omask, str)
|
||||
long omask;
|
||||
char *str;
|
||||
{
|
||||
struct typetab *tp;
|
||||
|
||||
/*
|
||||
* If it is one of our known types, add it to the current mask
|
||||
*/
|
||||
for (tp = typetab; tp->str; tp++)
|
||||
if (strcmp(str, tp->str) == 0)
|
||||
return (tp->types | (tflag ? omask : MT_NONE));
|
||||
/*
|
||||
* See if it is the negation of one of the known values
|
||||
*/
|
||||
if (strlen(str) > 2 && str[0] == 'n' && str[1] == 'o')
|
||||
for (tp = typetab; tp->str; tp++)
|
||||
if (strcmp(str+2, tp->str) == 0)
|
||||
return (~tp->types & (tflag ? omask : MT_ALL));
|
||||
errx(1, "unknown type `%s'", str);
|
||||
}
|
||||
|
||||
/*
|
||||
* Make a pass over the filesystem info in ``mntbuf'' filtering out
|
||||
* filesystem types not in vfslist and possibly re-stating to get
|
||||
* filesystem types not in ``fsmask'' and possibly re-stating to get
|
||||
* current (not cached) info. Returns the new count of valid statfs bufs.
|
||||
*/
|
||||
long
|
||||
regetmntinfo(mntbufp, mntsize, vfslist)
|
||||
regetmntinfo(mntbufp, mntsize, fsmask)
|
||||
struct statfs **mntbufp;
|
||||
long mntsize;
|
||||
char **vfslist;
|
||||
long mntsize, fsmask;
|
||||
{
|
||||
int i, j;
|
||||
struct statfs *mntbuf;
|
||||
|
||||
if (vfslist == NULL)
|
||||
if (fsmask == MT_ALL)
|
||||
return (nflag ? mntsize : getmntinfo(mntbufp, MNT_WAIT));
|
||||
|
||||
mntbuf = *mntbufp;
|
||||
for (j = 0, i = 0; i < mntsize; i++) {
|
||||
if (checkvfsname(mntbuf[i].f_fstypename, vfslist))
|
||||
continue;
|
||||
if (!nflag)
|
||||
(void)statfs(mntbuf[i].f_mntonname,&mntbuf[j]);
|
||||
else if (i != j)
|
||||
mntbuf[j] = mntbuf[i];
|
||||
j++;
|
||||
j = 0;
|
||||
for (i = 0; i < mntsize; i++) {
|
||||
if (fsmask & MT(mntbuf[i].f_type)) {
|
||||
if (!nflag)
|
||||
(void)statfs(mntbuf[i].f_mntonname,&mntbuf[j]);
|
||||
else if (i != j)
|
||||
mntbuf[j] = mntbuf[i];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
return (j);
|
||||
}
|
||||
@@ -297,7 +347,6 @@ prtstat(sfsp, maxwidth)
|
||||
* This code constitutes the pre-system call Berkeley df code for extracting
|
||||
* information from filesystem superblocks.
|
||||
*/
|
||||
#include <ufs/ufs/dinode.h>
|
||||
#include <ufs/ffs/fs.h>
|
||||
#include <errno.h>
|
||||
#include <fstab.h>
|
||||
@@ -310,7 +359,7 @@ union {
|
||||
|
||||
int rfd;
|
||||
|
||||
int
|
||||
void
|
||||
ufs_df(file, maxwidth)
|
||||
char *file;
|
||||
int maxwidth;
|
||||
@@ -325,15 +374,14 @@ ufs_df(file, maxwidth)
|
||||
|
||||
if ((rfd = open(file, O_RDONLY)) < 0) {
|
||||
warn("%s", file);
|
||||
return (1);
|
||||
return;
|
||||
}
|
||||
if (bread((off_t)SBOFF, &sblock, SBSIZE) == 0) {
|
||||
(void)close(rfd);
|
||||
return (1);
|
||||
return;
|
||||
}
|
||||
sfsp = &statfsbuf;
|
||||
sfsp->f_type = 1;
|
||||
strcpy(sfsp->f_fstypename, "ufs");
|
||||
sfsp->f_type = MOUNT_UFS;
|
||||
sfsp->f_flags = 0;
|
||||
sfsp->f_bsize = sblock.fs_fsize;
|
||||
sfsp->f_iosize = sblock.fs_bsize;
|
||||
@@ -351,7 +399,6 @@ ufs_df(file, maxwidth)
|
||||
memmove(&sfsp->f_mntfromname[0], file, MNAMELEN);
|
||||
prtstat(sfsp, maxwidth);
|
||||
(void)close(rfd);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -376,7 +423,7 @@ bread(off, buf, cnt)
|
||||
void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
"usage: df [-ikn] [-t type] [file | filesystem ...]\n");
|
||||
fprintf(stderr,
|
||||
"usage: df [-ikn] [-t fstype] [file | file_system ...]\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile,v 1.1 1994/09/18 21:23:35 wollman Exp $
|
||||
|
||||
PROG= domainname
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" From: @(#)hostname.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: domainname.1,v 1.2 1995/01/14 17:02:33 ats Exp $
|
||||
.\"
|
||||
.Dd September 18, 1994
|
||||
.Dt DOMAINNAME 1
|
||||
.Os FreeBSD 2.0
|
||||
.Os "FreeBSD 2.0"
|
||||
.Sh NAME
|
||||
.Nm domainname
|
||||
.Nd set or print name of current YP/NIS domain
|
||||
@@ -42,11 +42,11 @@
|
||||
.Nm domainname
|
||||
.Op Ar ypdomain
|
||||
.Sh DESCRIPTION
|
||||
.Nm Domainname
|
||||
.Nm domainname
|
||||
prints the name of the current YP/NIS domain. The super-user can
|
||||
set the domain name by supplying an argument; this is usually done in the
|
||||
network initialization script
|
||||
.Pa /etc/rc.network ,
|
||||
.Pa /etc/netstart ,
|
||||
normally run at boot
|
||||
time.
|
||||
.Sh NOTA BENE
|
||||
|
||||
@@ -32,17 +32,15 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char const copyright[] =
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1988, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char const sccsid[] = "From: @(#)hostname.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif
|
||||
/*static char sccsid[] = "From: @(#)hostname.c 8.1 (Berkeley) 5/31/93"; */
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
"$Id: domainname.c,v 1.5 1995/03/19 13:28:17 joerg Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -53,26 +51,14 @@ static const char rcsid[] =
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void usage __P((void));
|
||||
|
||||
int
|
||||
main(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
int ch;
|
||||
char domainname[MAXHOSTNAMELEN];
|
||||
|
||||
while ((ch = getopt(argc, argv, "")) != -1)
|
||||
switch (ch) {
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc > 1)
|
||||
usage();
|
||||
argc--, argv++;
|
||||
|
||||
if (*argv) {
|
||||
if (setdomainname(*argv, strlen(*argv)))
|
||||
@@ -84,10 +70,3 @@ main(argc,argv)
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr, "usage: domainname [ypdomain]\n");
|
||||
exit(1);
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile,v 1.2 1994/09/24 02:55:15 davidg Exp $
|
||||
|
||||
PROG= echo
|
||||
|
||||
|
||||
+5
-5
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)echo.1 8.1 (Berkeley) 7/22/93
|
||||
.\" $FreeBSD$
|
||||
.\" $Id: echo.1,v 1.3 1995/08/31 17:25:54 jkh Exp $
|
||||
.\"
|
||||
.Dd July 22, 1993
|
||||
.Dt ECHO 1
|
||||
@@ -47,7 +47,7 @@
|
||||
.Op "string ..."
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm echo
|
||||
utility writes any specified operands, separated by single blank (`` '')
|
||||
characters and followed by a newline (``\en'') character, to the standard
|
||||
output.
|
||||
@@ -59,15 +59,15 @@ Do not print the trailing newline character. This may also be
|
||||
achieved by appending `\ec' to the end of the string, as is done
|
||||
by iBCS2 compatible systems.
|
||||
.El
|
||||
.Sh DIAGNOSTICS
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm echo
|
||||
utility exits 0 on success, and >0 if an error occurs.
|
||||
.Sh SEE ALSO
|
||||
.Xr printf 1
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm echo
|
||||
utility is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
+3
-5
@@ -29,20 +29,18 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: echo.c,v 1.3 1995/08/31 17:25:55 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char const copyright[] =
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1989, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)echo.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
# $FreeBSD$
|
||||
# $Id: Makefile,v 1.13 1995/10/22 20:14:13 ache Exp $
|
||||
|
||||
PROG= ed
|
||||
SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
|
||||
LINKS= ${BINDIR}/ed ${BINDIR}/red
|
||||
MLINKS= ed.1 red.1
|
||||
LINKS= ${BINDIR}/ed ${BINDIR}/red
|
||||
MLINKS= ed.1 red.1
|
||||
|
||||
.if exists(${.CURDIR}/../../secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
.if exists(../../secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
DISTRIBUTION=des
|
||||
CFLAGS+=-DDES
|
||||
LDADD+= -L${CIPHEROBJDIR} -lcipher
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
$FreeBSD$
|
||||
$Id: POSIX,v 1.4 1994/09/24 02:55:20 davidg Exp $
|
||||
|
||||
This version of ed(1) is not strictly POSIX compliant, as described in
|
||||
the POSIX 1003.2 document. The following is a summary of the omissions,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
$FreeBSD$
|
||||
$Id: README,v 1.4 1994/09/24 02:55:21 davidg Exp $
|
||||
|
||||
ed is an 8-bit-clean, POSIX-compliant line editor. It should work with
|
||||
any regular expression package that conforms to the POSIX interface
|
||||
|
||||
+4
-12
@@ -1,4 +1,4 @@
|
||||
/* buf.c: This file contains the scratch-file buffer routines for the
|
||||
/* buf.c: This file contains the scratch-file buffer rountines for the
|
||||
ed line editor. */
|
||||
/*-
|
||||
* Copyright (c) 1993 Andrew Moore, Talke Studio.
|
||||
@@ -24,15 +24,11 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: buf.c,v 1.7.6.1 1997/03/24 05:46:18 imp Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char * const rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
|
||||
#else
|
||||
static char * const rcsid =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
static char *rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/file.h>
|
||||
@@ -268,10 +264,6 @@ init_buffers()
|
||||
hello, world
|
||||
EOF */
|
||||
setbuffer(stdin, stdinbuf, 1);
|
||||
|
||||
/* Ensure stdout is line buffered. This avoids bogus delays
|
||||
of output if stdout is piped through utilities to a terminal. */
|
||||
setvbuf(stdout, NULL, _IOLBF, 0);
|
||||
if (open_sbuf() < 0)
|
||||
quit(2);
|
||||
REQUE(&buffer_head, &buffer_head);
|
||||
|
||||
+3
-10
@@ -35,23 +35,16 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)bdes.c 5.5 (Berkeley) 6/27/91
|
||||
* $Id: cbc.c,v 1.6 1996/08/11 16:48:11 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char * const rcsid = "@(#)cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp";
|
||||
#else
|
||||
static char * const rcsid =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
static char *rcsid = "@(#)cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <pwd.h>
|
||||
#ifdef DES
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
@@ -124,7 +117,7 @@ init_des_cipher()
|
||||
/* initialize the initialization vector */
|
||||
MEMZERO(ivec, 8);
|
||||
|
||||
/* initialize the padding vector */
|
||||
/* intialize the padding vector */
|
||||
srand((unsigned) time((time_t *) 0));
|
||||
for (i = 0; i < 8; i++)
|
||||
CHAR(pvec, i) = (char) (rand()/RAND_DIV);
|
||||
|
||||
+550
-442
File diff suppressed because it is too large.
Load diff
+3
-2
@@ -25,9 +25,10 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ed.h,v 1.5 1994/02/01 00:34:39 alm Exp
|
||||
* $FreeBSD$
|
||||
* $Id: ed.h,v 1.8 1994/11/03 21:46:55 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h> /* for MAXPATHLEN */
|
||||
#include <errno.h>
|
||||
#if defined(sun) || defined(__NetBSD__)
|
||||
@@ -214,7 +215,7 @@ long exec_global __P((int, int));
|
||||
void expand_des_key __P((char *, char *));
|
||||
int extract_addr_range __P((void));
|
||||
char *extract_pattern __P((int));
|
||||
int extract_subst_tail __P((int *, long *));
|
||||
int extract_subst_tail __P((int *, int *));
|
||||
char *extract_subst_template __P((void));
|
||||
int filter_lines __P((long, long, char *));
|
||||
int flush_des_file __P((FILE *));
|
||||
|
||||
+3
-6
@@ -24,15 +24,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: glbl.c,v 1.4 1995/05/30 00:06:46 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char * const rcsid = "@(#)glob.c,v 1.1 1994/02/01 00:34:40 alm Exp";
|
||||
#else
|
||||
static char * const rcsid =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
static char *rcsid = "@(#)glob.c,v 1.1 1994/02/01 00:34:40 alm Exp";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
+3
-6
@@ -23,15 +23,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: io.c,v 1.5 1996/05/23 06:36:34 tg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char * const rcsid = "@(#)io.c,v 1.1 1994/02/01 00:34:41 alm Exp";
|
||||
#else
|
||||
static char * const rcsid =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
static char *rcsid = "@(#)io.c,v 1.1 1994/02/01 00:34:41 alm Exp";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
+14
-23
@@ -24,21 +24,18 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: main.c,v 1.6 1996/08/11 16:48:11 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char * const copyright =
|
||||
char *copyright =
|
||||
"@(#) Copyright (c) 1993 Andrew Moore, Talke Studio. \n\
|
||||
All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char * const rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp";
|
||||
#else
|
||||
static char * const rcsid =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@@ -60,9 +57,9 @@ static char * const rcsid =
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <ctype.h>
|
||||
#include <locale.h>
|
||||
#include <pwd.h>
|
||||
#include <setjmp.h>
|
||||
#include <pwd.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
@@ -103,6 +100,10 @@ char *dps = "*"; /* default command-line prompt */
|
||||
|
||||
char *usage = "usage: %s [-] [-sx] [-p string] [name]\n";
|
||||
|
||||
extern char errmsg[];
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
|
||||
/* ed: line editor */
|
||||
int
|
||||
main(argc, argv)
|
||||
@@ -111,17 +112,12 @@ main(argc, argv)
|
||||
{
|
||||
int c, n;
|
||||
long status = 0;
|
||||
#if __GNUC__
|
||||
/* Avoid longjmp clobbering */
|
||||
(void) &argc;
|
||||
(void) &argv;
|
||||
#endif
|
||||
|
||||
(void)setlocale(LC_ALL, "");
|
||||
|
||||
red = (n = strlen(argv[0])) > 2 && argv[0][n - 3] == 'r';
|
||||
top:
|
||||
while ((c = getopt(argc, argv, "p:sx")) != -1)
|
||||
while ((c = getopt(argc, argv, "p:sx")) != EOF)
|
||||
switch(c) {
|
||||
case 'p': /* set prompt */
|
||||
prompt = optarg;
|
||||
@@ -452,7 +448,7 @@ exec_command()
|
||||
|
||||
static pattern_t *pat = NULL;
|
||||
static int sgflag = 0;
|
||||
static long sgnum = 0;
|
||||
static int sgnum = 0;
|
||||
|
||||
pattern_t *tpat;
|
||||
char *fnp;
|
||||
@@ -1358,8 +1354,7 @@ signal_hup(signo)
|
||||
{
|
||||
if (mutex)
|
||||
sigflags |= (1 << (signo - 1));
|
||||
else
|
||||
handle_hup(signo);
|
||||
else handle_hup(signo);
|
||||
}
|
||||
|
||||
|
||||
@@ -1369,8 +1364,7 @@ signal_int(signo)
|
||||
{
|
||||
if (mutex)
|
||||
sigflags |= (1 << (signo - 1));
|
||||
else
|
||||
handle_int(signo);
|
||||
else handle_int(signo);
|
||||
}
|
||||
|
||||
|
||||
@@ -1420,8 +1414,6 @@ void
|
||||
handle_winch(signo)
|
||||
int signo;
|
||||
{
|
||||
int save_errno = errno;
|
||||
|
||||
struct winsize ws; /* window size structure */
|
||||
|
||||
sigflags &= ~(1 << (signo - 1));
|
||||
@@ -1429,7 +1421,6 @@ handle_winch(signo)
|
||||
if (ws.ws_row > 2) rows = ws.ws_row - 2;
|
||||
if (ws.ws_col > 8) cols = ws.ws_col - 8;
|
||||
}
|
||||
errno = save_errno;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-6
@@ -24,15 +24,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: re.c,v 1.10 1995/05/30 00:06:47 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char * const rcsid = "@(#)re.c,v 1.6 1994/02/01 00:34:43 alm Exp";
|
||||
#else
|
||||
static char * const rcsid =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
static char *rcsid = "@(#)re.c,v 1.6 1994/02/01 00:34:43 alm Exp";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
Loaded 100 of 16658 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user