mirror of
https://github.com/reactos/reactos
synced 2025-10-06 16:32:42 +02:00
Compare commits
1904 Commits
backups/un
...
ReactOS-0.
Author | SHA1 | Date | |
---|---|---|---|
|
eeff2a1e2c | ||
|
0a549d94c9 | ||
|
265859b2aa | ||
|
558200355f | ||
|
14f393cb80 | ||
|
e21b78b3e3 | ||
|
fc7aea5826 | ||
|
e8082ff034 | ||
|
8393800e76 | ||
|
19ad3d7a30 | ||
|
e858ec1801 | ||
|
ad8ae0a2f5 | ||
|
4e9d91b819 | ||
|
40a007aba1 | ||
|
46cef7fc9b | ||
|
be9ed281e0 | ||
|
d1cfd4ffdb | ||
|
c9d3381474 | ||
|
3ea1b601d2 | ||
|
409ce02fa7 | ||
|
9ca5a97711 | ||
|
67d2ffb153 | ||
|
40910fe910 | ||
|
b90a7afc42 | ||
|
252d2dbf1d | ||
|
f57567e347 | ||
|
7a5ecf6515 | ||
|
bfe7eb862e | ||
|
7115aab674 | ||
|
59c5e836e1 | ||
|
0ce194ac1a | ||
|
0fdb820f0b | ||
|
430a416722 | ||
|
effa2fbabb | ||
|
bfa03497ad | ||
|
1cc5bd55b6 | ||
|
565837d1f1 | ||
|
168b55e958 | ||
|
1d0d9fbf9f | ||
|
52d2359910 | ||
|
b95ed3ddf1 | ||
|
48fa361844 | ||
|
916157c159 | ||
|
5d67a14618 | ||
|
1815855fb6 | ||
|
2a7825f502 | ||
|
14a6c7e57d | ||
|
9808ba2cb8 | ||
|
1768fa6632 | ||
|
09ce94865b | ||
|
246369a31b | ||
|
95410deae9 | ||
|
cca6500c93 | ||
|
01ab93badd | ||
|
ccaafe31cf | ||
|
51357bf8aa | ||
|
c64bcfabad | ||
|
a5549b5653 | ||
|
f17ca2d3d9 | ||
|
8e5647c51a | ||
|
8acb48f0de | ||
|
ae35748cfa | ||
|
760f3874ca | ||
|
1cdf4f9806 | ||
|
c331ef4c1b | ||
|
8d8acf54de | ||
|
23b672891b | ||
|
87b5401bff | ||
|
e8e9853e27 | ||
|
ae77777da5 | ||
|
c8abcc5cb4 | ||
|
b80ba17572 | ||
|
130144b797 | ||
|
c34c3cfae4 | ||
|
0f6c1e0177 | ||
|
7d915349e5 | ||
|
f48e849f05 | ||
|
8dff4a88dc | ||
|
c4a09186d3 | ||
|
eea1010947 | ||
|
b2f22718cc | ||
|
6be4e2ac3a | ||
|
1a131779a2 | ||
|
aebf70e07f | ||
|
b51e21217f | ||
|
26c5adcb95 | ||
|
35fb40b8b7 | ||
|
8779eb9ec7 | ||
|
48908e14cc | ||
|
72e047dd5b | ||
|
6c0fa06e39 | ||
|
12359f4a27 | ||
|
8d8fea751b | ||
|
5850033b27 | ||
|
ab6e9ba7b7 | ||
|
5f282abf99 | ||
|
56275af6c3 | ||
|
148e40a24e | ||
|
5a6adb4f13 | ||
|
198a544138 | ||
|
fd75e7d985 | ||
|
4694f10044 | ||
|
f853dfb8a1 | ||
|
905afd86d0 | ||
|
e5d54247ac | ||
|
57bf0a56e5 | ||
|
63546989b5 | ||
|
f32fe94b88 | ||
|
8a8f132dbf | ||
|
b4ee5e08ee | ||
|
28c174051d | ||
|
88650ed55e | ||
|
656f7cb1f4 | ||
|
e031e6192e | ||
|
b26dfc9d77 | ||
|
a2760cfdd4 | ||
|
5db0abce79 | ||
|
c5c65dd160 | ||
|
c78f940a00 | ||
|
41e1df9977 | ||
|
b80569cee7 | ||
|
ec2583c6d5 | ||
|
ff0495900e | ||
|
e5d9890c6c | ||
|
43348bb6dc | ||
|
035f768d4a | ||
|
550ffd05d5 | ||
|
b438e48231 | ||
|
3595be74a5 | ||
|
793bbe0455 | ||
|
e136b71248 | ||
|
0267a0a1c8 | ||
|
2aceac7176 | ||
|
f36ace9e25 | ||
|
d2b345f07d | ||
|
13b04f00b5 | ||
|
f541fc1ccf | ||
|
b25339ac84 | ||
|
89ff8f7de2 | ||
|
47910ad286 | ||
|
43b2190795 | ||
|
a600e78a7a | ||
|
2c1c5c45b1 | ||
|
fd4d47ccfc | ||
|
25c85c7dfe | ||
|
1208d849d0 | ||
|
17b74887c6 | ||
|
fe7d926068 | ||
|
3a8ce6bf63 | ||
|
8cb9f1dd16 | ||
|
b93878d368 | ||
|
5e182b5ed0 | ||
|
da2423a49a | ||
|
a9c89818ae | ||
|
598cb0cb4c | ||
|
cc47e7056e | ||
|
fa8eafcb38 | ||
|
fae2e4844a | ||
|
6837f9c4ef | ||
|
0d5652813b | ||
|
f376a8013e | ||
|
e2bd4b9b87 | ||
|
c79d00b49a | ||
|
059a7a0f64 | ||
|
041c7d16a5 | ||
|
1806f623e7 | ||
|
3221f88ce3 | ||
|
a4178da184 | ||
|
09bfe41894 | ||
|
7a30c6749a | ||
|
00aa97da88 | ||
|
ab4a7cd152 | ||
|
6ade027031 | ||
|
3273c93173 | ||
|
e5a34ef337 | ||
|
3ea11463b3 | ||
|
36214fbd89 | ||
|
ab18809029 | ||
|
0dd9d2664c | ||
|
5d7f30939a | ||
|
a155c42316 | ||
|
02e3483cf5 | ||
|
5dc19ca3d1 | ||
|
87e06102cd | ||
|
c98929fa7e | ||
|
f0c5d1e87f | ||
|
e5c0c7185e | ||
|
2a2768dea3 | ||
|
4a95d5eee9 | ||
|
86bda6b3d9 | ||
|
289a784eef | ||
|
b3486a5605 | ||
|
0c57ecc79f | ||
|
4a13352942 | ||
|
78f37dc93e | ||
|
2ee9a6c165 | ||
|
3d9541523b | ||
|
f355097ad2 | ||
|
174bb8c3d3 | ||
|
3fd3d008eb | ||
|
2fbbe48059 | ||
|
5a38010118 | ||
|
d6278aba2a | ||
|
aee376797f | ||
|
47ba969751 | ||
|
48149a428f | ||
|
ff9a3a9a79 | ||
|
515231623e | ||
|
de04b33937 | ||
|
cc824ce464 | ||
|
cbd8e654dc | ||
|
3edb1beb95 | ||
|
a7d526433d | ||
|
8c97b5dd72 | ||
|
074449ffe5 | ||
|
485cee30c2 | ||
|
e27c5fbd2f | ||
|
8c29563890 | ||
|
10231d15e7 | ||
|
1ba52efab8 | ||
|
a5208b8fca | ||
|
d36ee56715 | ||
|
ef93b48310 | ||
|
8c3f4003e7 | ||
|
909d916ca5 | ||
|
116270d2e0 | ||
|
64ebe91f78 | ||
|
eaf3de3006 | ||
|
fc1ce2a0d3 | ||
|
7a15ff20db | ||
|
b7f6ddaf9a | ||
|
87d07db47c | ||
|
6be5fe1285 | ||
|
3684c3d179 | ||
|
c157992a67 | ||
|
45422998d5 | ||
|
ad6cb832a4 | ||
|
12e0be217f | ||
|
d4d6b6dbf7 | ||
|
d3b8d085e2 | ||
|
16e5929c1c | ||
|
7a1bc8eaca | ||
|
0aee7968ad | ||
|
8fd78223cb | ||
|
2ddebe867f | ||
|
3c7c6e909d | ||
|
396df5ce12 | ||
|
d1d89cd409 | ||
|
f1ea6d86e7 | ||
|
94048a055d | ||
|
c900b97902 | ||
|
5f56974966 | ||
|
229104bb31 | ||
|
b981b14821 | ||
|
0e27bfa7dd | ||
|
303f10c6fd | ||
|
57300d2523 | ||
|
189a5e8404 | ||
|
5d289c12b2 | ||
|
60a1a5d26d | ||
|
228ec52af6 | ||
|
dfd00972c9 | ||
|
3662f1f720 | ||
|
709cd514ab | ||
|
0de577f6cd | ||
|
a36b062468 | ||
|
c23a2d7aee | ||
|
cdd8ad011c | ||
|
51f2c2d3d0 | ||
|
af8dfb404f | ||
|
7ab413e8de | ||
|
a122417a8a | ||
|
1355fed119 | ||
|
679c19d7f8 | ||
|
01009ce267 | ||
|
7a232306cc | ||
|
7e8fb651af | ||
|
18992fbe14 | ||
|
e0308e50e8 | ||
|
156f7ec157 | ||
|
558496bca6 | ||
|
5db2a7d92d | ||
|
547896ce6f | ||
|
c2c9804f47 | ||
|
75bfca5f83 | ||
|
b5e7b94ea7 | ||
|
2723d14c06 | ||
|
ab19671382 | ||
|
c0ddd03a2f | ||
|
b639c5def9 | ||
|
286d73f7e6 | ||
|
ec23fa085b | ||
|
91540343f5 | ||
|
66b3542076 | ||
|
ae482ce24e | ||
|
24f81ff1c1 | ||
|
287fa79a6a | ||
|
dbf14d8c26 | ||
|
1dafd03c3d | ||
|
998550e404 | ||
|
6d21eb028c | ||
|
af347caa8c | ||
|
7e2973b768 | ||
|
2179744c2c | ||
|
6efd918a8b | ||
|
2a1ac328ed | ||
|
4f6b97db87 | ||
|
03c7fccace | ||
|
f475b72c8c | ||
|
a69fa0c124 | ||
|
5b13cb7208 | ||
|
f238a86a0b | ||
|
7cb3efcca8 | ||
|
75ebd197fa | ||
|
f611cbbe42 | ||
|
26090a1b08 | ||
|
096c6a9c99 | ||
|
0356076d35 | ||
|
f81d856c00 | ||
|
fc27cfa0c9 | ||
|
145c90c778 | ||
|
20bec3cf6b | ||
|
32ec8c6868 | ||
|
bafcaf58e4 | ||
|
84114428d7 | ||
|
f89bf61ed5 | ||
|
718510b28a | ||
|
34fca92d6d | ||
|
ee9ea15fe0 | ||
|
0a88910738 | ||
|
061fadc77a | ||
|
ef4b8d4947 | ||
|
78869da85f | ||
|
644d1f6676 | ||
|
20625a2073 | ||
|
12f5d25024 | ||
|
6df323c21b | ||
|
068a4a38d5 | ||
|
069a01eede | ||
|
a23989370d | ||
|
b61f55deae | ||
|
1e43cf0d82 | ||
|
5004973b9a | ||
|
937606fd25 | ||
|
535721b797 | ||
|
93742336bb | ||
|
74be6cd705 | ||
|
a92ab23917 | ||
|
4bda2fbdb1 | ||
|
4fd4a97760 | ||
|
a1d321e7b8 | ||
|
767a20760d | ||
|
d3a9cfe663 | ||
|
ae6141ba18 | ||
|
0f0199f381 | ||
|
9df4133568 | ||
|
e446466964 | ||
|
3c655e1278 | ||
|
decca5781a | ||
|
387d128462 | ||
|
c0589a9fec | ||
|
6e4a29babf | ||
|
9a6d677db3 | ||
|
0948ab6596 | ||
|
2eb7adef67 | ||
|
09237b9213 | ||
|
9baaca2418 | ||
|
1ea7189ed9 | ||
|
dcc3b51487 | ||
|
c4cd9be8de | ||
|
3ad515a2de | ||
|
a8a4e37cba | ||
|
1689533ef4 | ||
|
5ee0bf283e | ||
|
aebc047c8c | ||
|
d9975bf64a | ||
|
ef3bb24149 | ||
|
8fd176384c | ||
|
9e9c096bed | ||
|
0c257f84a5 | ||
|
3920464d8e | ||
|
bdea50f54c | ||
|
0c901951af | ||
|
b62d5e3184 | ||
|
cf1883980d | ||
|
fc64f4511b | ||
|
64fe62dd6d | ||
|
008868b972 | ||
|
6cb5e548e2 | ||
|
1701b0b02f | ||
|
3fa6827bcd | ||
|
0cb3991a23 | ||
|
63d1ecea6e | ||
|
c997de334b | ||
|
df39763241 | ||
|
750b45e5a3 | ||
|
97771b1487 | ||
|
0bb08690eb | ||
|
145dc8c01d | ||
|
c6548b080f | ||
|
247c229fc0 | ||
|
301b03bb9b | ||
|
787bcc5f53 | ||
|
b83d417811 | ||
|
17897f7c03 | ||
|
e9276ee142 | ||
|
b837fe0841 | ||
|
6ad77c02b3 | ||
|
a28f736301 | ||
|
68ceda5ada | ||
|
7cd6d8936d | ||
|
bb328ae107 | ||
|
a5d8a7ac82 | ||
|
dffb0e9a7a | ||
|
888fe38dca | ||
|
0c52657980 | ||
|
5a73b65484 | ||
|
b3ab3efa96 | ||
|
20f65a3fb9 | ||
|
a9a6bae87b | ||
|
c276551b2b | ||
|
9934c830e0 | ||
|
d094202f91 | ||
|
a50141ac65 | ||
|
5d518a1695 | ||
|
c5d8547022 | ||
|
aa20d5b1d5 | ||
|
b36ed4b1fc | ||
|
1b9adb989a | ||
|
356f44b7de | ||
|
d6107fdbb1 | ||
|
be1ee02554 | ||
|
36402e5aa4 | ||
|
3f69ca4cc4 | ||
|
aaada25107 | ||
|
ec838a6880 | ||
|
a004822e63 | ||
|
5b66798cd7 | ||
|
bf4cedbfce | ||
|
55000d5cf0 | ||
|
73cbc9cc37 | ||
|
3869ce90e5 | ||
|
5a9b7bebbc | ||
|
f293bda38a | ||
|
7ee896cad1 | ||
|
41e8ef1540 | ||
|
d0f2100e07 | ||
|
cc2e3f0806 | ||
|
52a23385a1 | ||
|
1f36dc8a8a | ||
|
b0c7df1b9a | ||
|
25f3f80f1e | ||
|
9dd23174c8 | ||
|
8eeb1a96b8 | ||
|
c0cbc28359 | ||
|
0af72b1ead | ||
|
65d55d8863 | ||
|
2e249e1b26 | ||
|
cc7a62391e | ||
|
d32f7b5e5b | ||
|
1b761836a3 | ||
|
e163d9c89c | ||
|
6167160a26 | ||
|
6d07d7107b | ||
|
8fa2bb273a | ||
|
ae35912b3a | ||
|
34b4c8f40b | ||
|
b4a4e5c0be | ||
|
4073da2472 | ||
|
4b420ec7f6 | ||
|
27346f997d | ||
|
de97756973 | ||
|
6fc5560247 | ||
|
e183b6028f | ||
|
e2e13b71ce | ||
|
3208a93c26 | ||
|
10b469cbd4 | ||
|
933eb642dd | ||
|
1c6b3f753a | ||
|
a33633bdad | ||
|
a252566666 | ||
|
7e4a551cd5 | ||
|
5e85eb7d8e | ||
|
f1a3075ad7 | ||
|
a798ec1a86 | ||
|
130bddfe9f | ||
|
cad3eb8c42 | ||
|
4032632974 | ||
|
7034b49d22 | ||
|
d87b450266 | ||
|
a44f8b0d7a | ||
|
e439100646 | ||
|
aaa8d41666 | ||
|
fe1d0d581a | ||
|
5d5aba0812 | ||
|
f478c3bb18 | ||
|
8d40c0f964 | ||
|
a305fad232 | ||
|
a600af1a27 | ||
|
ab405511d9 | ||
|
4ae9a4b859 | ||
|
0d7487a18c | ||
|
ab529dfd67 | ||
|
818f6c4bfc | ||
|
920ae420ee | ||
|
2f5809598e | ||
|
3de844a224 | ||
|
28f723e21e | ||
|
85a1907ad6 | ||
|
d50f7d2496 | ||
|
5cd5457f10 | ||
|
db88524e4f | ||
|
c98b85ff40 | ||
|
c0333e56cd | ||
|
2da14243ee | ||
|
6bad760721 | ||
|
5844ee0a81 | ||
|
cf6085206f | ||
|
8d6a03b3eb | ||
|
74893f61fb | ||
|
b8cfaa435e | ||
|
7b23bdc4ac | ||
|
6c6bb5f62e | ||
|
72a83f69ee | ||
|
1a42d9ea1c | ||
|
e604d7b0fe | ||
|
c0eef82d19 | ||
|
2f246b69d1 | ||
|
066d5b9dda | ||
|
3df0bbbfce | ||
|
9859f23c21 | ||
|
062243bc91 | ||
|
6429b16f0a | ||
|
97aa97fdd0 | ||
|
5e6df71477 | ||
|
5cb7155212 | ||
|
4ed1b71717 | ||
|
b4a32f4a4c | ||
|
ee0e06c2c1 | ||
|
b8ec1f6a56 | ||
|
75d57b4fa1 | ||
|
7192939c7d | ||
|
d24d5849fe | ||
|
20a0131534 | ||
|
e6063f185b | ||
|
1481663f41 | ||
|
c65dea5060 | ||
|
3edae5c9c1 | ||
|
5cb6979b1a | ||
|
ccf31892a1 | ||
|
f488ede562 | ||
|
5c2ae92c47 | ||
|
1f7f2ec88f | ||
|
5ce255ed4c | ||
|
ac38bc6706 | ||
|
8e8502cc51 | ||
|
20da260a3c | ||
|
5b04ae25a4 | ||
|
372a3cc161 | ||
|
889f9e3c01 | ||
|
6d64efee46 | ||
|
b03d2d1155 | ||
|
562836fa81 | ||
|
e9f2e019b1 | ||
|
577c72f5b0 | ||
|
6f0b5babc4 | ||
|
17dc9b5270 | ||
|
e575ed9544 | ||
|
af1605f6f6 | ||
|
4eca28a7a6 | ||
|
aa234d8870 | ||
|
10cde64c1f | ||
|
131f7804ab | ||
|
d152260ffa | ||
|
e5e74911b3 | ||
|
3bba37d64a | ||
|
0e53a7424f | ||
|
208eecc0f4 | ||
|
52ead14335 | ||
|
3a9de284ad | ||
|
df84ec15d8 | ||
|
eed177f191 | ||
|
d46de4a28a | ||
|
bd74b6b30a | ||
|
357a89921a | ||
|
a6f8fd2f79 | ||
|
83e63dc11b | ||
|
0bbf23c333 | ||
|
49ad46d964 | ||
|
8dacbd3ab0 | ||
|
8cd4cde19c | ||
|
a9be5303eb | ||
|
e9ff4263ca | ||
|
b7239a157c | ||
|
93bd949df5 | ||
|
b1cc45efd9 | ||
|
965c424c85 | ||
|
b6da4ac7a1 | ||
|
29b5ab4122 | ||
|
8a477f58d7 | ||
|
c967887093 | ||
|
5eb89e0c5a | ||
|
b8e0d46292 | ||
|
edd3aa06a7 | ||
|
25138c970a | ||
|
3454082412 | ||
|
d450a93214 | ||
|
6e9bf90969 | ||
|
b9689b04fa | ||
|
4a45379380 | ||
|
b5686dbcd2 | ||
|
db9f10747e | ||
|
71f7e0cad5 | ||
|
1dfc10a465 | ||
|
a4356344c9 | ||
|
0514d0e92b | ||
|
a25e9783d7 | ||
|
770c504a74 | ||
|
3e22e847c2 | ||
|
4eb1d89866 | ||
|
932eaef816 | ||
|
294fa73123 | ||
|
9a56bea334 | ||
|
5efafbf03e | ||
|
c280651aa2 | ||
|
93eeaf2b3e | ||
|
c79b121347 | ||
|
76f1b8fa3c | ||
|
439bc219e0 | ||
|
d28ae7e82f | ||
|
a504708d4e | ||
|
16588f8362 | ||
|
a49c07b8f2 | ||
|
045f617089 | ||
|
35b12b3d8c | ||
|
c4b00c80d8 | ||
|
ab5917c0c7 | ||
|
fdbabc8ad9 | ||
|
1731f27560 | ||
|
c4bb1e256b | ||
|
5a58cc8836 | ||
|
ae8ba926ce | ||
|
9d72cf785d | ||
|
9d04225d93 | ||
|
a3ba68ae58 | ||
|
ae87e6af46 | ||
|
2f3eb30871 | ||
|
e180745ffa | ||
|
d8f25b3cb8 | ||
|
dbb696c65d | ||
|
8eba21d917 | ||
|
db931ec021 | ||
|
bc8b4c3210 | ||
|
b0f6cfbe69 | ||
|
4750bc0160 | ||
|
35850562c1 | ||
|
e8c61143ed | ||
|
d1c18ff4e4 | ||
|
4c892bc4e7 | ||
|
bf1b360a1e | ||
|
80f8038f24 | ||
|
dc36f333cf | ||
|
1d9101d6ea | ||
|
4c1911c2ca | ||
|
18b431ed17 | ||
|
624e3335e1 | ||
|
a68d65df79 | ||
|
77fa055814 | ||
|
6d96f0e0cc | ||
|
51c0ed06fe | ||
|
4531d3752a | ||
|
49e30c043c | ||
|
f105303a7b | ||
|
465823fcc7 | ||
|
514cb6a689 | ||
|
3d24d1f443 | ||
|
b6af1f6bab | ||
|
c3b862d61d | ||
|
4ce8aabb3c | ||
|
a9d9714a23 | ||
|
7d15b82aa0 | ||
|
efe6366a22 | ||
|
553aab4bb7 | ||
|
2c92d6e39b | ||
|
8c8de10906 | ||
|
5a12816c16 | ||
|
f821d295ad | ||
|
94fe75aeb4 | ||
|
eb7f6b07c8 | ||
|
4790ca37b0 | ||
|
803636da4a | ||
|
f9384f3cf8 | ||
|
4c125c3021 | ||
|
2262d67ef2 | ||
|
c6287c59d3 | ||
|
9726e9950b | ||
|
a91a0d77da | ||
|
02e9af8bda | ||
|
73b9ac6994 | ||
|
caae64da4b | ||
|
0f9dfab704 | ||
|
ca61cc2444 | ||
|
56ab538abe | ||
|
1d63ef67f5 | ||
|
5fda84ce39 | ||
|
079339b3b8 | ||
|
48da1fcf14 | ||
|
afdf923c65 | ||
|
bbf48f20aa | ||
|
7d0f1e3433 | ||
|
4c5a154f4d | ||
|
9cfc87e333 | ||
|
3c986c6d3a | ||
|
432ae66313 | ||
|
fc6a12de18 | ||
|
3694ebf507 | ||
|
7398918d11 | ||
|
cbcc365a25 | ||
|
a975142a8d | ||
|
96a0d04b3b | ||
|
8efef1784a | ||
|
ba2a8ca045 | ||
|
efc93e5ae8 | ||
|
6fb7445d87 | ||
|
a0fe0d14a0 | ||
|
3f98a7dd14 | ||
|
4304c92e6e | ||
|
d13046ca0f | ||
|
f7d5d08e6e | ||
|
7c469f9c46 | ||
|
ab494baccd | ||
|
ac9d3e30fb | ||
|
d9776acd0c | ||
|
278ce6bf50 | ||
|
53de047b71 | ||
|
87f05689bc | ||
|
96a826ad92 | ||
|
973bed37c6 | ||
|
4be50fdc7e | ||
|
9f1e5ac42c | ||
|
ff2adbb728 | ||
|
7de8ff7c3c | ||
|
a4a7d78546 | ||
|
ce4ce9b5e9 | ||
|
66044c37fd | ||
|
98fc0115be | ||
|
f5a5752043 | ||
|
02184a83d4 | ||
|
979adb975e | ||
|
5ee6fc75ae | ||
|
c84d5016d1 | ||
|
b27e3264a9 | ||
|
1a4b287958 | ||
|
69a45c48b1 | ||
|
6be44d6e81 | ||
|
4167bc8912 | ||
|
83352970a1 | ||
|
be9bb3fb3c | ||
|
38afc0ac8b | ||
|
87589daf4e | ||
|
58e60b3092 | ||
|
f98bbb1df7 | ||
|
1debf1a12d | ||
|
72c2af4ca7 | ||
|
8d5c635a36 | ||
|
1afd43b049 | ||
|
13eef5cc24 | ||
|
d73834ea4f | ||
|
b76211b20a | ||
|
dabd23ba77 | ||
|
fdfb9053d9 | ||
|
7e0bfac662 | ||
|
59e33e46af | ||
|
8701c47012 | ||
|
56d6a0c2b1 | ||
|
39b80bfefd | ||
|
a1f93462d3 | ||
|
51ca2e3c1a | ||
|
4420d9e0cb | ||
|
18f8e8da80 | ||
|
af3325ef66 | ||
|
6de9186661 | ||
|
dff9686ea0 | ||
|
50f5d0807c | ||
|
9b3a488664 | ||
|
595a5bad20 | ||
|
21cbb4fcc1 | ||
|
dc3c360885 | ||
|
197fe0acf4 | ||
|
05a5575ff1 | ||
|
5ac5ed1e37 | ||
|
f57fc2af90 | ||
|
a9dc0b739e | ||
|
4fc0783845 | ||
|
fa71c1ff6c | ||
|
40ef0ef8e2 | ||
|
cb2396496c | ||
|
71d0b655ac | ||
|
6b9f511801 | ||
|
f0e807621f | ||
|
e344bc3faa | ||
|
6dd0418c50 | ||
|
d41145488c | ||
|
f29036d97b | ||
|
2cfadf3b41 | ||
|
2dfc5cfcd4 | ||
|
85f85e8462 | ||
|
add5e2d89f | ||
|
2957aa4ce5 | ||
|
368db861e4 | ||
|
7f0a6dcd48 | ||
|
2b246092f3 | ||
|
616e4d5242 | ||
|
aeb62db2e8 | ||
|
65b55ec6c6 | ||
|
bdfcd5630a | ||
|
8c8d19c080 | ||
|
262859736d | ||
|
e8fc884c37 | ||
|
1648d6ba62 | ||
|
2c11752216 | ||
|
a70a5e92d0 | ||
|
94309de6e4 | ||
|
33408fe398 | ||
|
c21076a36c | ||
|
db0d247af0 | ||
|
33267a7bd2 | ||
|
78232dab8b | ||
|
6a0be77508 | ||
|
3a788d44ee | ||
|
e40a4953f2 | ||
|
bd5d1d2adf | ||
|
db0e348770 | ||
|
de935b3cf0 | ||
|
9b90a6532b | ||
|
b2a5aa012c | ||
|
b7437fe01a | ||
|
8d1e0c87b3 | ||
|
b63d768a18 | ||
|
0858e6f0fb | ||
|
9dfa505536 | ||
|
da6d4130c3 | ||
|
6ca8f2a32b | ||
|
c53353dfcb | ||
|
fd1d23c72f | ||
|
c48815ca85 | ||
|
0d87c04fdb | ||
|
c321566c86 | ||
|
fac82fed75 | ||
|
57dfac271e | ||
|
a758924464 | ||
|
137c93f9c6 | ||
|
f56e6b7e9e | ||
|
f22ea77911 | ||
|
d8538e9795 | ||
|
6b46ea08e7 | ||
|
f3b6ab3603 | ||
|
389375c4ee | ||
|
14c634ca97 | ||
|
a934fd1c24 | ||
|
4e81d099cf | ||
|
5907d91e41 | ||
|
d135a77c67 | ||
|
381057612c | ||
|
74412de062 | ||
|
fbb680dffd | ||
|
877f965575 | ||
|
ca5d9b1a2d | ||
|
d9925196f3 | ||
|
bde0898ab5 | ||
|
eca8ca8582 | ||
|
b20a5f12ed | ||
|
09ad24f08c | ||
|
634bb6b997 | ||
|
988ec8cb30 | ||
|
8c86bcfe89 | ||
|
51a205bc71 | ||
|
b1601c09d8 | ||
|
cf4a06ff33 | ||
|
e065bf41ff | ||
|
9b95a9991c | ||
|
99a644a366 | ||
|
c2d9004a56 | ||
|
51f1b4ac50 | ||
|
9b3c1a2a1d | ||
|
5bbfcbdcde | ||
|
61c860daf7 | ||
|
547f4b4197 | ||
|
0f3822bfb9 | ||
|
0b3adffd26 | ||
|
591d955230 | ||
|
7a86200cdc | ||
|
04c0aa0853 | ||
|
e3b61f2e00 | ||
|
486ce0ad1a | ||
|
32e24ab35e | ||
|
cebfcd7c5e | ||
|
ffca6e4a0a | ||
|
f8ad495ac2 | ||
|
f907dc6e87 | ||
|
7e2c26824a | ||
|
1e02a7d8d9 | ||
|
d60628a01b | ||
|
01846dd237 | ||
|
5d2401e39c | ||
|
1a0448a35b | ||
|
58fc2c8cf8 | ||
|
6fbeba1e7c | ||
|
2a613a30c4 | ||
|
9926c78c7f | ||
|
18015b2244 | ||
|
18f3b6c58b | ||
|
22dc9e2a5e | ||
|
3744b5d4cf | ||
|
549cb5b03d | ||
|
2eb05bdbc5 | ||
|
7244e5bac9 | ||
|
e7f98c9000 | ||
|
be2ca4fccd | ||
|
a068c65d79 | ||
|
c3c30d0692 | ||
|
6fc1bdc912 | ||
|
d12635ff66 | ||
|
5e5862c7fe | ||
|
fc5f4ae9a5 | ||
|
f7186d4cc3 | ||
|
fba831e913 | ||
|
efbd594370 | ||
|
33702a0775 | ||
|
47ea39add9 | ||
|
c20f2479b6 | ||
|
7853be9c86 | ||
|
6ea1527cfc | ||
|
d520a12907 | ||
|
6e9d388644 | ||
|
6e89a9d21c | ||
|
03e327f37f | ||
|
c5cdaa420a | ||
|
c706428a2b | ||
|
05428a2fea | ||
|
3073e95ed9 | ||
|
f665b3f2f4 | ||
|
29552067b3 | ||
|
870a302f96 | ||
|
9e66717a35 | ||
|
43038e9c15 | ||
|
e87e6d58ee | ||
|
971b171d02 | ||
|
044ab2b0df | ||
|
2d5f3d1c74 | ||
|
de10767975 | ||
|
2ec9eaf736 | ||
|
d5d8d819b8 | ||
|
afe0e9f601 | ||
|
d3e61a64dd | ||
|
5149f0d29a | ||
|
bf9d9a12e7 | ||
|
574a1b82f4 | ||
|
a2329a46e9 | ||
|
c9a6908fb9 | ||
|
ea6cacb6ed | ||
|
80ec0821f8 | ||
|
327980fe31 | ||
|
85e1649fc4 | ||
|
c3dc053ba2 | ||
|
3121974d42 | ||
|
c1c75ffd5e | ||
|
15445cf1c8 | ||
|
ac82b90278 | ||
|
24fea578c1 | ||
|
209d2a0bdd | ||
|
835e5e69e5 | ||
|
dae0efdd4a | ||
|
fd25f6dae0 | ||
|
c57a9b4991 | ||
|
2b3a1f40c1 | ||
|
689a632cf7 | ||
|
b65738db8d | ||
|
4546061999 | ||
|
20612fed4c | ||
|
99529fbb93 | ||
|
e9143b26d7 | ||
|
3d4886b292 | ||
|
349ae0c799 | ||
|
f827a8f124 | ||
|
d458692c89 | ||
|
65a803db11 | ||
|
0e40521339 | ||
|
9f2db0a1d2 | ||
|
beae346469 | ||
|
727b62c27f | ||
|
07142de752 | ||
|
933ff9a467 | ||
|
b91cda60d8 | ||
|
9359db14a0 | ||
|
29c4727f7a | ||
|
6922d2a9e5 | ||
|
af68ad91d4 | ||
|
03fd77240f | ||
|
b611b79b36 | ||
|
37361ed1e8 | ||
|
41280eeeb5 | ||
|
c87bd2d365 | ||
|
c93d52a405 | ||
|
ae14d5ffc6 | ||
|
501fee0d15 | ||
|
bcc1b4e9a5 | ||
|
b2fe7525bf | ||
|
076c1c6ac3 | ||
|
ae6b859854 | ||
|
fef0ed0d35 | ||
|
543839bcee | ||
|
2a2b027dc1 | ||
|
62d9e11763 | ||
|
a7772a9954 | ||
|
a34348ef4e | ||
|
47f77fa056 | ||
|
766ded4e0f | ||
|
ec9ef6951c | ||
|
5f529d5a90 | ||
|
65249c23ae | ||
|
c8f92d26a9 | ||
|
51c7c6091a | ||
|
3c5287c859 | ||
|
ed2b81a1b5 | ||
|
2965b6c9d7 | ||
|
79c82716fa | ||
|
20916cab69 | ||
|
b93435c7db | ||
|
1416a36841 | ||
|
7bfcc9b94c | ||
|
17b93d7d9b | ||
|
c06ef435fb | ||
|
6c726dfe40 | ||
|
9331d6391e | ||
|
d4850da19d | ||
|
ff1de6a212 | ||
|
5786d70e39 | ||
|
dc0568827a | ||
|
2d87dedf3e | ||
|
fb75aa1293 | ||
|
03832de6e4 | ||
|
12e9069480 | ||
|
98414449d5 | ||
|
dee175afca | ||
|
74e0c4a781 | ||
|
a6a0f5ae18 | ||
|
1ec1a6741c | ||
|
a9527291d6 | ||
|
3943df51ea | ||
|
89e2e7a616 | ||
|
207393f045 | ||
|
42d7089e72 | ||
|
6579aafa03 | ||
|
b6593ffc1b | ||
|
e6c8459347 | ||
|
782b28151b | ||
|
10f230ae0a | ||
|
3f694e507f | ||
|
f353289fba | ||
|
5d6f1d7dfa | ||
|
5c0fb84170 | ||
|
b360ee177d | ||
|
0f09a6d59c | ||
|
03be08974e | ||
|
300201892a | ||
|
86c7503953 | ||
|
3676b49d28 | ||
|
703924d130 | ||
|
e443f083f2 | ||
|
fd4c82a289 | ||
|
a8660c1f02 | ||
|
3116ca9df2 | ||
|
d2833af32c | ||
|
20ee4eb9a7 | ||
|
7863eef29d | ||
|
d6e19c5407 | ||
|
a1da8a3ac2 | ||
|
efd7d3cbd8 | ||
|
394b6b568c | ||
|
824df27238 | ||
|
fcca9be111 | ||
|
7a3409d80c | ||
|
695a57cff6 | ||
|
0d8b4e3da6 | ||
|
7b0b7c5396 | ||
|
643441de17 | ||
|
25dc208536 | ||
|
7887cc9965 | ||
|
352d348f09 | ||
|
2faa9c1b95 | ||
|
db38d666da | ||
|
a04660d2b0 | ||
|
01531797b4 | ||
|
4a354f1128 | ||
|
a3a116651b | ||
|
52f51dc4b9 | ||
|
05ccbb2696 | ||
|
2dd3473a90 | ||
|
eaeab91ab2 | ||
|
7efa62275f | ||
|
36c7b523ee | ||
|
eda06227b3 | ||
|
51772d486a | ||
|
bf1b057da3 | ||
|
15491f14dd | ||
|
df75bd846f | ||
|
5d04b18c15 | ||
|
d2b9b6d912 | ||
|
e371c33d76 | ||
|
1c655ae05a | ||
|
1688a8d7c5 | ||
|
48b5533bd5 | ||
|
21c3a954d0 | ||
|
624869c3c3 | ||
|
8fe6e74b25 | ||
|
b12b25cd3d | ||
|
e4b73aa914 | ||
|
66aa4c41db | ||
|
83463a35cc | ||
|
58f7f41275 | ||
|
240c9da1da | ||
|
9e386e114c | ||
|
138b30dd40 | ||
|
ed20b9b6ba | ||
|
1f1ae27105 | ||
|
380b1db222 | ||
|
65c77b52d6 | ||
|
66f91ccbf9 | ||
|
7bd40a855a | ||
|
43999c2a2d | ||
|
7a974c0294 | ||
|
0fc13a01ee | ||
|
7f10630ab4 | ||
|
390fd4f1fb | ||
|
3b50cd9ca9 | ||
|
8445b12452 | ||
|
b6c91b703e | ||
|
91bcb7413f | ||
|
64ba922c19 | ||
|
90beca63cb | ||
|
c6010e401e | ||
|
72e967e710 | ||
|
a391eec94c | ||
|
488f0ac078 | ||
|
4ac4987dd2 | ||
|
6d9f357735 | ||
|
1439a96e69 | ||
|
7235c776e4 | ||
|
6faae58d64 | ||
|
b2b12a1d09 | ||
|
8bdd137c8f | ||
|
af9693f4da | ||
|
d3f5f7862f | ||
|
4dc42b4202 | ||
|
2af149a27c | ||
|
07127c18af | ||
|
3d521d0a20 | ||
|
02d3c2cb72 | ||
|
d8748695f2 | ||
|
3ab0b1f9a2 | ||
|
e69d5f4655 | ||
|
a7d8f1c9ab | ||
|
564101ab11 | ||
|
c40c9f88c1 | ||
|
d4ae36c1c5 | ||
|
f01dd17793 | ||
|
a9828950fe | ||
|
b7a9c63dad | ||
|
9deb8f01da | ||
|
55feb47d30 | ||
|
45fcd58321 | ||
|
7cdd9a1c62 | ||
|
bd1cb1e820 | ||
|
c07ef00211 | ||
|
e53fb528db | ||
|
565277e563 | ||
|
cf1b2d1b6c | ||
|
716fa2a717 | ||
|
d456e5b838 | ||
|
a703d88253 | ||
|
41ac59fb91 | ||
|
885e8a3344 | ||
|
bd08f2070e | ||
|
4b0dec4293 | ||
|
143ef3c5b1 | ||
|
575c0c896a | ||
|
fb51b0f647 | ||
|
93647509cc | ||
|
3f82e28a32 | ||
|
e7f86f45fb | ||
|
55a9a7623e | ||
|
a248f1e7c3 | ||
|
2a81cebc82 | ||
|
b60489a76a | ||
|
1c236a2886 | ||
|
dab151f2f1 | ||
|
9267a79b9e | ||
|
1db1c12cf3 | ||
|
382d5a76c2 | ||
|
a83fd9fd73 | ||
|
201009ddd9 | ||
|
14b2a471ce | ||
|
77d9f6fb99 | ||
|
bb44d63a00 | ||
|
3f76d0e8a9 | ||
|
76ba7eadb1 | ||
|
06bf88e073 | ||
|
d17678ebd0 | ||
|
e9b7a9a972 | ||
|
9ab512dafc | ||
|
e7214e13b1 | ||
|
3199989397 | ||
|
3b8acca85c | ||
|
e224120546 | ||
|
d996724891 | ||
|
26aa5fb4dd | ||
|
69afd5910f | ||
|
8a74f96a65 | ||
|
8d1034c5fa | ||
|
9e2f41853a | ||
|
4e21487a31 | ||
|
a2d079723b | ||
|
5bea9979e8 | ||
|
f1096bb7f0 | ||
|
fe87b12edd | ||
|
a254e64d73 | ||
|
15b935ba7c | ||
|
4a5bc9edc8 | ||
|
bd44cd188f | ||
|
0a2b580710 | ||
|
6e63676205 | ||
|
aa5a575bd0 | ||
|
beaf6eac44 | ||
|
619ad3483b | ||
|
a1b7c80868 | ||
|
ae69a8e1e4 | ||
|
f3632d15b8 | ||
|
31f697ce8f | ||
|
bd6afcb8ba | ||
|
99434057af | ||
|
0ea51977f6 | ||
|
08982a387e | ||
|
572b3bf901 | ||
|
56cd5f816c | ||
|
37d6d2f97f | ||
|
7ec7480d5c | ||
|
734dbaddef | ||
|
b7eaee833c | ||
|
ab2b4e0924 | ||
|
2a734dfd02 | ||
|
b0a3240f8e | ||
|
522110434e | ||
|
ad66ea993a | ||
|
ee426ef891 | ||
|
79753f70ea | ||
|
192a6b11b4 | ||
|
f452b24998 | ||
|
380f53e057 | ||
|
7a86d15add | ||
|
cfa0bfd3f1 | ||
|
28d86222cd | ||
|
e7a0c9b4eb | ||
|
f6975e3ad4 | ||
|
18fb33cd77 | ||
|
4b34e5c2de | ||
|
16625529a2 | ||
|
6320160bea | ||
|
d7d755265d | ||
|
e7365f8b00 | ||
|
11c7a09174 | ||
|
b9d500fbd4 | ||
|
c76d475edb | ||
|
4ca3269e59 | ||
|
8dba8b5f8b | ||
|
5df884f1d2 | ||
|
991be350f7 | ||
|
90a17ecf05 | ||
|
fbac67d372 | ||
|
19e205fb97 | ||
|
ed32877e90 | ||
|
c0159ad5c8 | ||
|
3004e5b9bd | ||
|
df314ce26e | ||
|
dd7e38a19d | ||
|
8e0014c64b | ||
|
3b94410c8a | ||
|
3f36421f86 | ||
|
7550af7e4d | ||
|
8293c58f61 | ||
|
acaf5099d7 | ||
|
5c58f80d97 | ||
|
9a1e13b7d8 | ||
|
33252ab449 | ||
|
abd30f9819 | ||
|
24d06e9f82 | ||
|
1a10e72f31 | ||
|
6c2d255207 | ||
|
495a30cb8e | ||
|
c27ed38f21 | ||
|
e7dc6b7c4b | ||
|
6f1d7ad00c | ||
|
8434fc42db | ||
|
7c29439d2b | ||
|
1aa74074a2 | ||
|
ddfa2017c7 | ||
|
f7d76fbc5b | ||
|
cc22ad9378 | ||
|
375b8055e3 | ||
|
7b9adffa48 | ||
|
b4cd061025 | ||
|
f2e0104287 | ||
|
47dfd4feaa | ||
|
6f6219e903 | ||
|
3ae3b46dcd | ||
|
70a09d673c | ||
|
97b05ef460 | ||
|
6db1a5193f | ||
|
891b9b74ee | ||
|
c6c624ebe3 | ||
|
df3c817b6b | ||
|
71ea66b0b8 | ||
|
f55fec7c32 | ||
|
7a8a2f9e95 | ||
|
c65edfad92 | ||
|
65ecb0b98b | ||
|
66d2f292ef | ||
|
a859ee0c1e | ||
|
b5ff23bb2f | ||
|
792773e953 | ||
|
2c41cbbe57 | ||
|
83f94cade6 | ||
|
afde198a7d | ||
|
07b9585e22 | ||
|
768ab2e5dc | ||
|
c3d5ea4e9b | ||
|
6041051d6a | ||
|
fb416bf8e2 | ||
|
cc05ca5acb | ||
|
041f614e06 | ||
|
510af07f3c | ||
|
85c3d3799b | ||
|
b4f80cb2e6 | ||
|
a6613e4b6f | ||
|
f48fc3a954 | ||
|
e97ef012de | ||
|
68375602c1 | ||
|
fb7b00bd59 | ||
|
0afbea5a1c | ||
|
8353127423 | ||
|
25557b0457 | ||
|
8689a5cfe9 | ||
|
0ea1d03808 | ||
|
a20a2dd801 | ||
|
b81629c2a0 | ||
|
4568d2fd4c | ||
|
96e4bf5c1f | ||
|
418efd5de8 | ||
|
aa9ca10d75 | ||
|
21489b923a | ||
|
61ed9441a3 | ||
|
a1ff5576a5 | ||
|
001c73ed14 | ||
|
3ca24a2c2a | ||
|
db1ccdf290 | ||
|
84f943edc6 | ||
|
67d46de5d3 | ||
|
10c1321106 | ||
|
7bf98ea309 | ||
|
2b37b9beea | ||
|
194e86b860 | ||
|
2f1d0bf882 | ||
|
017479a5f0 | ||
|
d26222f310 | ||
|
671c1bc412 | ||
|
bea48dda7a | ||
|
2946fd90c7 | ||
|
f801003a51 | ||
|
d351d182ef | ||
|
9caffc49ae | ||
|
bad7efb0e7 | ||
|
add4b2d35b | ||
|
73437d2939 | ||
|
ed53dc2acc | ||
|
83e4b66c10 | ||
|
6abd233802 | ||
|
95f8770ae2 | ||
|
f3e6819471 | ||
|
cc95f73421 | ||
|
109fef6e75 | ||
|
17e1656941 | ||
|
fcf9dcd627 | ||
|
6e00280f38 | ||
|
a8ed3ed57e | ||
|
3d2ca25cb4 | ||
|
57fc573524 | ||
|
88cf03e85b | ||
|
5b2343f9f1 | ||
|
539b0a1259 | ||
|
9f1e56d438 | ||
|
44bdd793c1 | ||
|
e3b8762528 | ||
|
943db2de5a | ||
|
dd085499e8 | ||
|
991cde2c53 | ||
|
669a590c02 | ||
|
b441b2ed03 | ||
|
9d3cd59f17 | ||
|
e6bcb9741d | ||
|
4e91635e4a | ||
|
274c4db921 | ||
|
ea455bcfce | ||
|
8eb69e31d4 | ||
|
a32b900658 | ||
|
ea1da2be56 | ||
|
efd7fbb22e | ||
|
a25a8e2e02 | ||
|
77ef48e705 | ||
|
0b34b1b746 | ||
|
94c0c4bab2 | ||
|
fb6c04efbd | ||
|
19e66992de | ||
|
65a13ef159 | ||
|
3cd7d0dcd3 | ||
|
0aac416a18 | ||
|
d40e55b4e1 | ||
|
64c33bb910 | ||
|
077ac93718 | ||
|
9464b7005d | ||
|
6d5e353126 | ||
|
ceed9a079e | ||
|
abc6758e63 | ||
|
8123995861 | ||
|
7fbe844acc | ||
|
f53d713f9a | ||
|
3918e5583d | ||
|
279b8390a0 | ||
|
06784b2b11 | ||
|
9f7a5635de | ||
|
97f4345422 | ||
|
232a66904f | ||
|
1410c2b0a4 | ||
|
dd76e08c86 | ||
|
3e519811c4 | ||
|
1001fb267c | ||
|
6bd8ebc9e2 | ||
|
0726ddaa11 | ||
|
f5c8f9fdab | ||
|
d7b4fba550 | ||
|
598c0f3b1f | ||
|
d173c588c7 | ||
|
1d034b8c4e | ||
|
3086566400 | ||
|
17e86aad5d | ||
|
bb665e58b7 | ||
|
5c644fe59b | ||
|
a3160d79cd | ||
|
34010a1fcb | ||
|
78a6c60acd | ||
|
fdf480d262 | ||
|
32ea00da50 | ||
|
537f82fd1a | ||
|
b13b811b5f | ||
|
b3ea65f0e4 | ||
|
0c4a5f1e06 | ||
|
5fea099598 | ||
|
23b59ecccb | ||
|
cbf17cd791 | ||
|
0bb8878fc1 | ||
|
0d569ee50b | ||
|
de82241cb1 | ||
|
7928fc621a | ||
|
cdd3a57119 | ||
|
4f6c860da3 | ||
|
6ac6c50282 | ||
|
66780d1d02 | ||
|
ee3307e21d | ||
|
b01b3e0e97 | ||
|
8b7920f796 | ||
|
86a1100180 | ||
|
4542601468 | ||
|
99fb26fc8b | ||
|
7910a00791 | ||
|
93d95d8063 | ||
|
04a84d5ab8 | ||
|
5b7a3113d5 | ||
|
db593a0fb7 | ||
|
51db0e6fed | ||
|
55c5bbf0be | ||
|
4be5d21243 | ||
|
fe9a733457 | ||
|
654c8e7d00 | ||
|
53e0232c6c | ||
|
e3ce7008d7 | ||
|
9d90e8c107 | ||
|
48c46844eb | ||
|
05bf1339f9 | ||
|
d54e68673b | ||
|
eb1f2f9bd1 | ||
|
3b0f32720d | ||
|
fccf1c26a7 | ||
|
b8d0ffaf38 | ||
|
49f35db9e8 | ||
|
1fc2971156 | ||
|
cdbe762497 | ||
|
248fe1f79d | ||
|
9d6388ae05 | ||
|
3bd2a11130 | ||
|
1be4f77bcb | ||
|
758ba695e1 | ||
|
79eff41abb | ||
|
0bd4cf0cbf | ||
|
a1c9a520cf | ||
|
dc3956d8ac | ||
|
802301d861 | ||
|
9887130ab7 | ||
|
d4fc70afdc | ||
|
bd02ee978f | ||
|
bc30557a61 | ||
|
56132bfb44 | ||
|
c4ecfc894c | ||
|
d6f6aad9e7 | ||
|
5e7a2202d1 | ||
|
2c6fae9c20 | ||
|
1042f1ae27 | ||
|
753cb16c91 | ||
|
5d99a8740a | ||
|
1ba7343b1c | ||
|
2adbc636a8 | ||
|
c404283ff4 | ||
|
d9d3272dc6 | ||
|
690a781452 | ||
|
e1d6086025 | ||
|
40ee84e997 | ||
|
ef5f880bac | ||
|
6088637c5e | ||
|
0344745e30 | ||
|
337952bfb9 | ||
|
15c9809105 | ||
|
b820741431 | ||
|
67200bd4f9 | ||
|
b2eb99d9f7 | ||
|
9658579d48 | ||
|
1c5d2b7204 | ||
|
fbfce3bc03 | ||
|
045a3dfdd2 | ||
|
2ef0c4177b | ||
|
6865b783cc | ||
|
15094179f1 | ||
|
d9a0a586a8 | ||
|
afa23cb264 | ||
|
9488b3031c | ||
|
a665da497e | ||
|
f1d9e95a84 | ||
|
91d68b2e7b | ||
|
200afa376d | ||
|
836456a97d | ||
|
10f82cf988 | ||
|
bf4806c502 | ||
|
89871935c1 | ||
|
c3f375c672 | ||
|
267e86b00e | ||
|
b129b2caea | ||
|
3da0b018e5 | ||
|
e2eb8c1697 | ||
|
a12836346f | ||
|
1eed2a945a | ||
|
79d0e047eb | ||
|
2634e901be | ||
|
9eac680002 | ||
|
51df161b78 | ||
|
2b0d467176 | ||
|
92857818cb | ||
|
fd304f0ef5 | ||
|
ef5b0066c7 | ||
|
395fb3c86f | ||
|
76f55a8a93 | ||
|
d53eeb0cee | ||
|
c37b4fd7f1 | ||
|
c0ad0d9b02 | ||
|
853d9d4ae2 | ||
|
6eb7010078 | ||
|
48db9468eb | ||
|
fa81b6d260 | ||
|
012968e3dc | ||
|
debfec7180 | ||
|
4b80eae220 | ||
|
ad382b39b3 | ||
|
89875c3a44 | ||
|
8f1ea8477c | ||
|
26253d8e9b | ||
|
0723b7c345 | ||
|
ac8c87276f | ||
|
00a4935163 | ||
|
9dc1aa60cb | ||
|
9f87d15938 | ||
|
d7de328d0c | ||
|
6165746875 | ||
|
7b02da36f7 | ||
|
f8fe1ea0b1 | ||
|
213e8b569c | ||
|
5db4e55264 | ||
|
7cb2e823a0 | ||
|
d1341007cf | ||
|
151f2f646e | ||
|
7d3fded0ba | ||
|
b9bb1744aa | ||
|
e632116bee | ||
|
f28a023c99 | ||
|
b0780ae5d6 | ||
|
6bea08705e | ||
|
6708f0b87e | ||
|
f0175145d6 | ||
|
3cd2fc22d7 | ||
|
b49921cb96 | ||
|
c110a36a78 | ||
|
ca7bca8f84 | ||
|
5f71c29e2c | ||
|
326a3cd58b | ||
|
18c0c85dd8 | ||
|
480136bdf4 | ||
|
16ef6ef2af | ||
|
33258c166f | ||
|
f09ef9894a | ||
|
19e258120e | ||
|
7c3e6e80c1 | ||
|
5dc3ee0414 | ||
|
90579ae67f | ||
|
5dff1d9789 | ||
|
337692832a | ||
|
d633bd8168 | ||
|
980d94c760 | ||
|
d24a48cd94 | ||
|
52404fd1c8 | ||
|
3a18299c0f | ||
|
c41488b99a | ||
|
3cd7e191a4 | ||
|
185d2be0f1 | ||
|
55bb357489 | ||
|
65a742ceaa | ||
|
1220167730 | ||
|
2001008199 | ||
|
74131ebded | ||
|
5415f6f333 | ||
|
0ab77c8e74 | ||
|
51445f2db1 | ||
|
4d393f112a | ||
|
a706ca2b64 | ||
|
e4008de214 | ||
|
2a24d175bf | ||
|
b6c944afcc | ||
|
90617da53d | ||
|
b6de29fefb | ||
|
8b078f86ae | ||
|
1b92b852eb | ||
|
072eed4ad3 | ||
|
75f2f5b22e | ||
|
90e1f4cbf9 | ||
|
921363d647 | ||
|
8234dea660 | ||
|
88cb154d19 | ||
|
faac123528 | ||
|
e857e97df1 | ||
|
d508a1f0bf | ||
|
013fc117b8 | ||
|
3d1f2d98ba | ||
|
de66c40007 | ||
|
6cc53dd4b3 | ||
|
fb7f4582cd | ||
|
a11a76eaef | ||
|
be132afdf2 | ||
|
686387f8e0 | ||
|
492a608e06 | ||
|
fd411d8b8c | ||
|
6f3d53f751 | ||
|
462fe323eb | ||
|
4d8c6a710b | ||
|
623093eaaa | ||
|
453f513ed3 | ||
|
57919a833e | ||
|
e6b5c8bfc7 | ||
|
974095c413 | ||
|
a8ca53d761 | ||
|
c54d897571 | ||
|
17afcb4dfd | ||
|
2284e742b3 | ||
|
c7580dacf3 | ||
|
9446011fc1 | ||
|
586433918e | ||
|
b9579544e7 | ||
|
005106acbb | ||
|
38d1018911 | ||
|
ea5959a772 | ||
|
6b50f46c2f | ||
|
4d5643a96a | ||
|
128cfc8af0 | ||
|
a7a23b4dc3 | ||
|
dbd051cad4 | ||
|
1667a4589a | ||
|
6a617736e9 | ||
|
d832a87f14 | ||
|
13541861b1 | ||
|
dfa5f04c63 | ||
|
cc5dc64c30 | ||
|
8abc09ec0d | ||
|
5b86e3a918 | ||
|
e5b9e13d59 | ||
|
bfaef27782 | ||
|
4e94397e24 | ||
|
683932b845 | ||
|
4ce5c9d3b4 | ||
|
6b53b3acea | ||
|
81547d8842 | ||
|
1b0b103796 | ||
|
98a6084104 | ||
|
96aed594a2 | ||
|
ca6a107ee2 | ||
|
414cd229d9 | ||
|
a09b668be6 | ||
|
7f63532d94 | ||
|
8bbcdc3d4a | ||
|
43d5d0b2f0 | ||
|
a409988b36 | ||
|
33009b967e | ||
|
4c2f15bfb9 | ||
|
c40b27bbc4 | ||
|
ac7a3aa542 | ||
|
90e6a2244e | ||
|
8c2f4d55e3 | ||
|
9a22766e36 | ||
|
53b1677997 | ||
|
2cecd9846d | ||
|
f822a2a9d9 | ||
|
a590b25e46 | ||
|
5d2dc4de65 | ||
|
55fef42029 | ||
|
0ce89e21d9 | ||
|
910f27a570 | ||
|
14ac854378 | ||
|
e0e40991af | ||
|
db262c9a74 | ||
|
81310b4307 | ||
|
77c8585f1c | ||
|
43f46ed4f8 | ||
|
66f738dbd1 | ||
|
45043db6ff | ||
|
b14104f1e7 | ||
|
424d757107 | ||
|
a1c7df6990 | ||
|
c7b7c5b0b6 | ||
|
815a52debe | ||
|
dbf662da37 | ||
|
5d99e9003a | ||
|
ec235d7468 | ||
|
f09720f7d7 | ||
|
258912bf48 | ||
|
9d84d82bd7 | ||
|
904da6e474 | ||
|
915ff9328d | ||
|
61c3984818 | ||
|
4a02ce0c1e | ||
|
f30ade19b8 | ||
|
9530a7d656 | ||
|
5716745a13 | ||
|
680589c149 | ||
|
2efd99afb2 | ||
|
b001203a86 | ||
|
09edfdc32f | ||
|
ae12418822 | ||
|
f9d4545552 | ||
|
bb25ff0f3a | ||
|
4b70175e11 | ||
|
ba58b241e5 | ||
|
7c574c2d6e | ||
|
47551b9846 | ||
|
d0c1e25256 | ||
|
d4c340c696 | ||
|
43014d0391 | ||
|
e28f90e740 | ||
|
ead0eeacdd | ||
|
cf693462e6 | ||
|
67ad8387f3 | ||
|
eae47571c9 | ||
|
2ea8bb5aa4 | ||
|
13436cd7f7 | ||
|
3bee100dae | ||
|
2eccd28b8f | ||
|
d2c016b5ab | ||
|
b72dc46819 | ||
|
e2e5efb9d7 | ||
|
6d3a97eb5e | ||
|
0d630c9ee3 | ||
|
8b829113cb | ||
|
c18e7f06ce | ||
|
dfa8364302 | ||
|
ed3ca3d52c | ||
|
e77c8000db | ||
|
05a567fce3 | ||
|
9b614b887d | ||
|
1a0765f6c5 | ||
|
ec4a27aeb7 | ||
|
b986ce1cac | ||
|
e510811de7 | ||
|
a7e6e9c1f8 | ||
|
64915d3ebe | ||
|
c8689122b1 | ||
|
e0c1e02c47 | ||
|
b09592bf32 | ||
|
174adb3955 | ||
|
8a20ddc7d4 | ||
|
82a0c31208 | ||
|
d25098ba0c | ||
|
aba30a453f | ||
|
fde8b62215 | ||
|
e04faee634 | ||
|
0d7b93783b | ||
|
b361e13fab | ||
|
44744d8d36 | ||
|
614f99e406 | ||
|
6e605e712e | ||
|
96d5e2c715 | ||
|
6767fd7f43 | ||
|
85a3f3844c | ||
|
c114003cb5 | ||
|
c52cbf8517 | ||
|
abd233d61a | ||
|
b0ff680e0e | ||
|
1a8f8005ae | ||
|
5bc02dd95a | ||
|
44866ccf87 | ||
|
d431c0fa6d | ||
|
58b907b668 | ||
|
761e03c5a1 | ||
|
ea4204ce87 | ||
|
eae6fb6efc | ||
|
157d5b3fa2 | ||
|
63665d54ed | ||
|
eb2d1c2110 | ||
|
dbbb7e41f0 | ||
|
6758f479ef | ||
|
18a01fd10d | ||
|
cfb22d72df | ||
|
83c2d22a5e | ||
|
96c9969a90 | ||
|
f0f8791763 | ||
|
31c5b7839f | ||
|
dabbe50e39 | ||
|
68fbd54f2c | ||
|
766e6a262e | ||
|
c1795e9778 | ||
|
f886c2b9d6 | ||
|
7d45bbd5da | ||
|
8d87ab9d07 | ||
|
95fcdd0943 | ||
|
11d7e1e18c | ||
|
863afe8930 | ||
|
788e4dc053 | ||
|
125a62f79a | ||
|
99d62b4808 | ||
|
3c1e76b027 | ||
|
2bd986927c | ||
|
ad5e850736 | ||
|
6cc79a481e | ||
|
c0b2b118a0 | ||
|
a53e883bb0 | ||
|
bb0715f8e7 | ||
|
bc08c68af9 | ||
|
28df2503d3 | ||
|
a5dd3430d6 | ||
|
36f33622cc | ||
|
583a7209da | ||
|
727671f12a | ||
|
13e2e79e44 | ||
|
0300e2a9d1 | ||
|
ec16aa4c44 | ||
|
e6f624f0e7 | ||
|
7228dc135c | ||
|
d2e85caa9e | ||
|
bff71dc524 | ||
|
a0570e7cbe | ||
|
ff9ce85a65 | ||
|
f3d9743503 | ||
|
a66a6e5dba | ||
|
8690858184 | ||
|
9e4fec3838 | ||
|
8001413b88 | ||
|
bae73138e8 | ||
|
dad291cf6f | ||
|
22b26024cd | ||
|
3e6e6c12ee | ||
|
93a0fa88d2 | ||
|
9b2fc03fc7 | ||
|
7975fc7fe7 | ||
|
a23adc0492 | ||
|
36e229b42f | ||
|
29812be566 | ||
|
4551dfba1e | ||
|
babfe77ea9 | ||
|
81a9f1c4b0 | ||
|
74031c2379 | ||
|
348ccdd39f | ||
|
1d4d689bf2 | ||
|
8578ba8ac6 | ||
|
a77eef4a53 |
33
posix/apps/baresh/Makefile
Normal file
33
posix/apps/baresh/Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
# $Id: Makefile,v 1.1 2002/01/20 21:22:29 ea Exp $
|
||||
#
|
||||
# Tu run it in Win32 console mode, undefine __SUBSYSTEM_WINDOWS__
|
||||
# and pass "console" in the ld's --subsystem option.
|
||||
#
|
||||
#
|
||||
PATH_TO_TOP=../../../..
|
||||
|
||||
PATH_TO_PSX_TOP=../..
|
||||
|
||||
TARGET_NAME=sh
|
||||
|
||||
CFLAGS=-D__SUBSYSTEM_WINDOWS__
|
||||
|
||||
OBJECTS=$(TARGET_NAME).o
|
||||
|
||||
LIBRARIES=\
|
||||
$(PATH_TO_PSX_TOP)/lib/crt0w32.o \
|
||||
$(PATH_TO_PSX_TOP)/lib/psxdll/psxdll.a
|
||||
|
||||
$(TARGET_NAME): $(OBJECTS) $(LIBRARIES)
|
||||
$(CC) \
|
||||
$(CFLAGS) \
|
||||
$(OBJECTS) \
|
||||
$(LIBRARIES)\
|
||||
-o $@ \
|
||||
-Wl,--subsystem,windows\
|
||||
-nostartfiles \
|
||||
-nostdlib
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
# EOF
|
60
posix/apps/baresh/sh.c
Normal file
60
posix/apps/baresh/sh.c
Normal file
@@ -0,0 +1,60 @@
|
||||
/* $Id: sh.c,v 1.1 2002/01/20 21:22:29 ea Exp $
|
||||
*
|
||||
* baresh - Bare Shell for the PSX subsystem.
|
||||
* Copyright (c) 2002 Emanuele Aliberti
|
||||
* License: GNU GPL v2
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#define INPUT_BUFFER_SIZE 128
|
||||
|
||||
int run=1;
|
||||
|
||||
void cmd_exit(char*buf)
|
||||
{
|
||||
run=0;
|
||||
}
|
||||
|
||||
void cmd_pwd(char * buf)
|
||||
{
|
||||
char pwd[1024];
|
||||
|
||||
getcwd(pwd,sizeof pwd);
|
||||
printf("%s\n",pwd);
|
||||
}
|
||||
|
||||
void cmd_ls(char*buf)
|
||||
{
|
||||
char pwd[1024];
|
||||
DIR * dir;
|
||||
struct dirent * entry;
|
||||
|
||||
getcwd(pwd,sizeof pwd);
|
||||
dir=opendir(pwd);
|
||||
while (NULL!=(entry=readdir(dir)))
|
||||
{
|
||||
printf("%s\n",entry->d_name);
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
|
||||
int main(int argc,char*argv[])
|
||||
{
|
||||
char buf[INPUT_BUFFER_SIZE];
|
||||
|
||||
while (run)
|
||||
{
|
||||
printf("# ");
|
||||
if (gets(buf))
|
||||
{
|
||||
if (!strcmp("exit",buf)) cmd_exit(buf);
|
||||
else if (!strcmp("pwd",buf)) cmd_pwd(buf);
|
||||
else if (!strcmp("ls",buf)) cmd_ls(buf);
|
||||
else printf("%s: unknown command\n",argv[0]);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* EOF */
|
74
posix/include/aio.h
Normal file
74
posix/include/aio.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/* $Id: aio.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* aio.h
|
||||
*
|
||||
* asynchronous input and output (REALTIME). Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __AIO_H_INCLUDED__
|
||||
#define __AIO_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
typedef struct _tag_aiocb
|
||||
{
|
||||
int aio_fildes; /* file descriptor */
|
||||
off_t aio_offset; /* file offset */
|
||||
volatile void* aio_buf; /* location of buffer */
|
||||
size_t aio_nbytes; /* length of transfer */
|
||||
int aio_reqprio; /* request priority offset */
|
||||
struct sigevent aio_sigevent; /* signal number and value */
|
||||
int aio_lio_opcode; /* operation to be performed */
|
||||
} aiocb;
|
||||
|
||||
/* CONSTANTS */
|
||||
#define AIO_CANCELED 0
|
||||
#define AIO_NOTCANCELED 1
|
||||
#define AIO_ALLDONE 2
|
||||
|
||||
#define LIO_WAIT 0
|
||||
#define LIO_NOWAIT 1
|
||||
#define LIO_READ 2
|
||||
#define LIO_WRITE 3
|
||||
#define LIO_NOP 4
|
||||
|
||||
/* PROTOTYPES */
|
||||
int aio_cancel(int, struct aiocb *);
|
||||
int aio_error(const struct aiocb *);
|
||||
int aio_fsync(int, struct aiocb *);
|
||||
int aio_read(struct aiocb *);
|
||||
ssize_t aio_return(struct aiocb *);
|
||||
int aio_suspend(const struct aiocb *const[], int, const struct timespec *);
|
||||
int aio_write(struct aiocb *);
|
||||
int lio_listio(int, struct aiocb *const[], int, struct sigevent *);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __AIO_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
56
posix/include/arpa/inet.h
Normal file
56
posix/include/arpa/inet.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* $Id: inet.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* arpa/inet.h
|
||||
*
|
||||
* definitions for internet operations. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __ARPA_INET_H_INCLUDED__
|
||||
#define __ARPA_INET_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <netinet/in.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
uint32_t htonl(uint32_t hostlong);
|
||||
uint16_t htons(uint16_t hostshort);
|
||||
uint32_t ntohl(uint32_t netlong);
|
||||
uint16_t ntohs(uint16_t netshort);
|
||||
|
||||
in_addr_t inet_addr(const char *cp);
|
||||
in_addr_t inet_lnaof(struct in_addr in);
|
||||
struct in_addr inet_makeaddr(in_addr_t net, in_addr_t lna);
|
||||
in_addr_t inet_netof(struct in_addr in);
|
||||
in_addr_t inet_network(const char *cp);
|
||||
char *inet_ntoa(struct in_addr in);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __ARPA_INET_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
65
posix/include/assert.h
Normal file
65
posix/include/assert.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/* $Id: assert.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* assert.h
|
||||
*
|
||||
* verify program assertion. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __ASSERT_H_INCLUDED__
|
||||
#define __ASSERT_H_INCLUDED__
|
||||
|
||||
/* types */
|
||||
|
||||
/* constants */
|
||||
|
||||
/* prototypes */
|
||||
|
||||
/* macros */
|
||||
#ifdef NDEBUG
|
||||
#define assert(ignore) ((void) 0)
|
||||
#else /* !NDEBUG */
|
||||
|
||||
#define assert(expression) \
|
||||
#ifdef __PSXDLL__
|
||||
|
||||
/* headers for internal usage by psxdll.dll and ReactOS */
|
||||
#include <psxdll/stdio.h>
|
||||
#include <psxdll/stdlib.h>
|
||||
|
||||
#else /* ! __PSXDLL__ */
|
||||
|
||||
/* standard POSIX headers */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#endif
|
||||
|
||||
if(!(expression)) \
|
||||
{ \
|
||||
fputs("__FILE__, line __LINE__: assertion \"expression\" failed\n", stderr); \
|
||||
abort(); \
|
||||
}
|
||||
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#endif /* __ASSERT_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
63
posix/include/cpio.h
Normal file
63
posix/include/cpio.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/* $Id: cpio.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* cpio.h
|
||||
*
|
||||
* cpio archive values. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __CPIO_H_INCLUDED__
|
||||
#define __CPIO_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
#define C_IRUSR (0000400) /* read by owner */
|
||||
#define C_IWUSR (0000200) /* write by owner */
|
||||
#define C_IXUSR (0000100) /* execute by owner */
|
||||
#define C_IRGRP (0000040) /* read by group */
|
||||
#define C_IWGRP (0000020) /* write by group */
|
||||
#define C_IXGRP (0000010) /* execute by group */
|
||||
#define C_IROTH (0000004) /* read by others */
|
||||
#define C_IWOTH (0000002) /* write by others */
|
||||
#define C_IXOTH (0000001) /* execute by others */
|
||||
#define C_ISUID (0004000) /* set user ID */
|
||||
#define C_ISGID (0002000) /* set group ID */
|
||||
#define C_ISVTX (0001000) /* on directories, restricted deletion flag */
|
||||
#define C_ISDIR (0040000) /* directory */
|
||||
#define C_ISFIFO (0010000) /* FIFO */
|
||||
#define C_ISREG (0100000) /* regular file */
|
||||
#define C_ISBLK (0060000) /* block special */
|
||||
#define C_ISCHR (0020000) /* character special */
|
||||
#define C_ISCTG (0110000) /* reserved */
|
||||
#define C_ISLNK (0120000) /* symbolic link */
|
||||
#define C_ISSOCK (0140000) /* socket */
|
||||
|
||||
#define MAGIC "070707"
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __CPIO_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
61
posix/include/ctype.h
Normal file
61
posix/include/ctype.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/* $Id: ctype.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* ctype.h
|
||||
*
|
||||
* character types. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __CTYPE_H_INCLUDED__
|
||||
#define __CTYPE_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int isalnum(int);
|
||||
int isalpha(int);
|
||||
int isascii(int);
|
||||
int iscntrl(int);
|
||||
int isdigit(int);
|
||||
int isgraph(int);
|
||||
int islower(int);
|
||||
int isprint(int);
|
||||
int ispunct(int);
|
||||
int isspace(int);
|
||||
int isupper(int);
|
||||
int isxdigit(int);
|
||||
int toascii(int);
|
||||
int tolower(int);
|
||||
int toupper(int);
|
||||
|
||||
/* MACROS */
|
||||
/* FIXME: the standard isn't clear about these */
|
||||
#define _toupper(c) (toupper(c))
|
||||
#define _tolower(c) (tolower(c))
|
||||
|
||||
#endif /* __CTYPE_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
70
posix/include/dirent.h
Normal file
70
posix/include/dirent.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/* $Id: dirent.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* dirent.h
|
||||
*
|
||||
* format of directory entries. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __DIRENT_H_INCLUDED__
|
||||
#define __DIRENT_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <sys/types.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/* TYPES */
|
||||
typedef void DIR;
|
||||
|
||||
struct dirent
|
||||
{
|
||||
ino_t d_ino; /* file serial number */
|
||||
char *d_name; /* name of entry */
|
||||
};
|
||||
|
||||
/* for Unicode filenames */
|
||||
struct _Wdirent
|
||||
{
|
||||
ino_t d_ino; /* file serial number */
|
||||
wchar_t *d_name; /* name of entry */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int closedir(DIR *);
|
||||
DIR *opendir(const char *);
|
||||
struct dirent *readdir(DIR *);
|
||||
int readdir_r(DIR *, struct dirent *, struct dirent **);
|
||||
void rewinddir(DIR *);
|
||||
void seekdir(DIR *, long int);
|
||||
long int telldir(DIR *);
|
||||
|
||||
/* for Unicode filenames */
|
||||
DIR *_Wopendir(const wchar_t *);
|
||||
struct _Wdirent *_Wreaddir(DIR *);
|
||||
int _Wreaddir_r(DIR *, struct _Wdirent *, struct _Wdirent **);
|
||||
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __DIRENT_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
58
posix/include/dlfcn.h
Normal file
58
posix/include/dlfcn.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/* $Id: dlfcn.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* dlfcn.h
|
||||
*
|
||||
* dynamic linking. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __DLFCN_H_INCLUDED__
|
||||
#define __DLFCN_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
#define RTLD_LAZY (0x00000000) /* Relocations are performed at an \
|
||||
implementation-dependent time. */
|
||||
#define RTLD_NOW (0x00000001) /* Relocations are performed when \
|
||||
the object is loaded. */
|
||||
|
||||
#define RTLD_GLOBAL (0x00000010) /* All symbols are available for \
|
||||
relocation processing of other \
|
||||
modules. */
|
||||
#define RTLD_LOCAL (0x00000020) /* All symbols are not made available \
|
||||
for relocation processing by other \
|
||||
modules. */
|
||||
|
||||
#define RTLD_NEXT ((void *)(-1))
|
||||
|
||||
/* PROTOTYPES */
|
||||
void *dlopen(const char *, int);
|
||||
void *dlsym(void *, const char *);
|
||||
int dlclose(void *);
|
||||
char *dlerror(void);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __DLFCN_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
123
posix/include/errno.h
Normal file
123
posix/include/errno.h
Normal file
@@ -0,0 +1,123 @@
|
||||
/* $Id: errno.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* errno.h
|
||||
*
|
||||
* system error numbers. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __ERRNO_H_INCLUDED__
|
||||
#define __ERRNO_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
#define E2BIG ( 1) /* Argument list too long. */
|
||||
#define EACCES ( 2) /* Permission denied. */
|
||||
#define EADDRINUSE ( 3) /* Address in use. */
|
||||
#define EADDRNOTAVAIL ( 4) /* Address not available. */
|
||||
#define EAFNOSUPPORT ( 5) /* Address family not supported. */
|
||||
#define EAGAIN ( 6) /* Resource unavailable, try again */
|
||||
#define EALREADY ( 7) /* Connection already in progress. */
|
||||
#define EBADF ( 8) /* Bad file descriptor. */
|
||||
#define EBADMSG ( 9) /* Bad message. */
|
||||
#define EBUSY (10) /* Device or resource busy. */
|
||||
#define ECANCELED (11) /* Operation canceled. */
|
||||
#define ECHILD (12) /* No child processes. */
|
||||
#define ECONNABORTED (13) /* Connection aborted. */
|
||||
#define ECONNREFUSED (14) /* Connection refused. */
|
||||
#define ECONNRESET (15) /* Connection reset. */
|
||||
#define EDEADLK (16) /* Resource deadlock would occur. */
|
||||
#define EDESTADDRREQ (17) /* Destination address required. */
|
||||
#define EDOM (18) /* Mathematics argument out of domain of function. */
|
||||
#define EDQUOT (19) /* Reserved. */
|
||||
#define EEXIST (20) /* File exists. */
|
||||
#define EFAULT (21) /* Bad address. */
|
||||
#define EFBIG (22) /* File too large. */
|
||||
#define EHOSTUNREACH (23) /* Host is unreachable. */
|
||||
#define EIDRM (24) /* Identifier removed. */
|
||||
#define EILSEQ (25) /* Illegal byte sequence. */
|
||||
#define EINPROGRESS (26) /* Operation in progress. */
|
||||
#define EINTR (27) /* Interrupted function. */
|
||||
#define EINVAL (28) /* Invalid argument. */
|
||||
#define EIO (29) /* I/O error. */
|
||||
#define EISCONN (30) /* Socket is connected. */
|
||||
#define EISDIR (31) /* Is a directory. */
|
||||
#define ELOOP (32) /* Too many levels of symbolic links. */
|
||||
#define EMFILE (33) /* Too many open files. */
|
||||
#define EMLINK (34) /* Too many links. */
|
||||
#define EMSGSIZE (35) /* Message too large. */
|
||||
#define EMULTIHOP (36) /* Reserved. */
|
||||
#define ENAMETOOLONG (37) /* Filename too long. */
|
||||
#define ENETDOWN (38) /* Network is down. */
|
||||
#define ENETUNREACH (39) /* Network unreachable. */
|
||||
#define ENFILE (40) /* Too many files open in system. */
|
||||
#define ENOBUFS (41) /* No buffer space available. */
|
||||
#define ENODATA (42) /* No message is available on the STREAM head read queue. */
|
||||
#define ENODEV (43) /* No such device. */
|
||||
#define ENOENT (44) /* No such file or directory. */
|
||||
#define ENOEXEC (45) /* Executable file format error. */
|
||||
#define ENOLCK (46) /* No locks available. */
|
||||
#define ENOLINK (47) /* Reserved. */
|
||||
#define ENOMEM (48) /* Not enough space. */
|
||||
#define ENOMSG (49) /* No message of the desired type. */
|
||||
#define ENOPROTOOPT (50) /* Protocol not available. */
|
||||
#define ENOSPC (51) /* No space left on device. */
|
||||
#define ENOSR (52) /* No STREAM resources. */
|
||||
#define ENOSTR (53) /* Not a STREAM. */
|
||||
#define ENOSYS (54) /* Function not supported. */
|
||||
#define ENOTCONN (55) /* The socket is not connected. */
|
||||
#define ENOTDIR (56) /* Not a directory. */
|
||||
#define ENOTEMPTY (57) /* Directory not empty. */
|
||||
#define ENOTSOCK (58) /* Not a socket. */
|
||||
#define ENOTSUP (59) /* Not supported. */
|
||||
#define ENOTTY (60) /* Inappropriate I/O control operation. */
|
||||
#define ENXIO (61) /* No such device or address. */
|
||||
#define EOPNOTSUPP (62) /* Operation not supported on socket. */
|
||||
#define EOVERFLOW (63) /* Value too large to be stored in data type. */
|
||||
#define EPERM (64) /* Operation not permitted. */
|
||||
#define EPIPE (65) /* Broken pipe. */
|
||||
#define EPROTO (66) /* Protocol error. */
|
||||
#define EPROTONOSUPPORT (67) /* Protocol not supported. */
|
||||
#define EPROTOTYPE (68) /* Socket type not supported. */
|
||||
#define ERANGE (69) /* Result too large. */
|
||||
#define EROFS (70) /* Read-only file system. */
|
||||
#define ESPIPE (71) /* Invalid seek. */
|
||||
#define ESRCH (72) /* No such process. */
|
||||
#define ESTALE (73) /* Reserved. */
|
||||
#define ETIME (74) /* Streamioctl()timeout. */
|
||||
#define ETIMEDOUT (75) /* Connection timed out. */
|
||||
#define ETXTBSY (76) /* Text file busy. */
|
||||
#define EWOULDBLOCK (77) /* Operation would block */
|
||||
#define EXDEV (78) /* Cross-device link. */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int * __PdxGetThreadErrNum(void); /* returns a pointer to the current thread's errno */
|
||||
|
||||
/* MACROS */
|
||||
#define errno (*__PdxGetThreadErrNum())
|
||||
|
||||
#endif /* __ERRNO_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
149
posix/include/fcntl.h
Normal file
149
posix/include/fcntl.h
Normal file
@@ -0,0 +1,149 @@
|
||||
/* $Id: fcntl.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* fcntl.h
|
||||
*
|
||||
* file control options. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __FCNTL_H_INCLUDED__
|
||||
#define __FCNTL_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
/*
|
||||
the structure flock describes a file lock
|
||||
*/
|
||||
struct flock
|
||||
{
|
||||
short l_type; /* type of lock; F_RDLCK, F_WRLCK, F_UNLCK */
|
||||
short l_whence; /* flag for starting offset */
|
||||
off_t l_start; /* relative offset in bytes */
|
||||
off_t l_len; /* size; if 0 then until EOF */
|
||||
pid_t l_pid; /* process ID of the process holding the lock;
|
||||
returned with F_GETLK */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
/*
|
||||
values for cmd used by fcntl()
|
||||
*/
|
||||
enum __fcntl_cmd
|
||||
{
|
||||
F_DUPFD, /* duplicate file descriptor */
|
||||
F_GETFD, /* get file descriptor flags */
|
||||
F_SETFD, /* set file descriptor flags */
|
||||
F_GETFL, /* get file status flags and file access modes */
|
||||
F_SETFL, /* Set file status flags */
|
||||
F_GETLK, /* get record locking information */
|
||||
F_SETLK, /* set record locking information */
|
||||
F_SETLKW, /* set record locking information; wait if blocked */
|
||||
/* ReactOS-specific */
|
||||
F_NEWFD, /* create new file descriptor */
|
||||
F_DELFD, /* delete file descriptor */
|
||||
F_GETALL, /* get a copy of the internal descriptor object */
|
||||
F_SETALL, /* initialize internal descriptor object */
|
||||
F_GETXP, /* get file descriptor extra data pointer */
|
||||
F_SETXP, /* set file descriptor extra data pointer */
|
||||
F_GETXS, /* get file descriptor extra data size */
|
||||
F_SETXS, /* set file descriptor extra data size */
|
||||
F_GETFH, /* get file handle */
|
||||
F_SETFH /* set file handle */
|
||||
};
|
||||
|
||||
/*
|
||||
file descriptor flags used for fcntl()
|
||||
*/
|
||||
/* Close the file descriptor upon execution of an exec family function. */
|
||||
#define FD_CLOEXEC (0x00000001)
|
||||
|
||||
/*
|
||||
values for l_type used for record locking with fcntl()
|
||||
*/
|
||||
/* Shared or read lock. */
|
||||
#define F_RDLCK (1)
|
||||
/* Unlock. */
|
||||
#define F_UNLCK (2)
|
||||
/* Exclusive or write lock. */
|
||||
#define F_WRLCK (3)
|
||||
|
||||
/*
|
||||
file flags used for open()
|
||||
*/
|
||||
/* Create file if it does not exist. */
|
||||
#define O_CREAT (0x00000001)
|
||||
/* Exclusive use flag. */
|
||||
#define O_EXCL (0x00000002)
|
||||
/* Do not assign controlling terminal. */
|
||||
#define O_NOCTTY (0x00000004)
|
||||
/* Truncate flag. */
|
||||
#define O_TRUNC (0x00000008)
|
||||
/* ReactOS-specific */
|
||||
/* File must be a directory */
|
||||
#define _O_DIRFILE (0x00000010)
|
||||
|
||||
/*
|
||||
file status flags used for open() and fcntl()
|
||||
*/
|
||||
/* Set append mode. */
|
||||
#define O_APPEND (0x00000100)
|
||||
/* Write according to synchronised I/O data integrity completion. */
|
||||
#define O_DSYNC (0x00000200)
|
||||
/* Non-blocking mode. */
|
||||
#define O_NONBLOCK (0x00000400)
|
||||
/* Synchronised read I/O operations. */
|
||||
#define O_RSYNC (0x00000800)
|
||||
/* Write according to synchronised I/O file integrity completion. */
|
||||
#define O_SYNC (0x00001000)
|
||||
|
||||
/*
|
||||
file access modes used for open() and fcntl()
|
||||
*/
|
||||
/* Open for reading only. */
|
||||
#define O_RDONLY (0x01000000)
|
||||
/* Open for reading and writing. */
|
||||
#define O_RDWR (0x02000000)
|
||||
/* Open for writing only. */
|
||||
#define O_WRONLY (0x04000000)
|
||||
|
||||
/*
|
||||
mask for use with file access modes
|
||||
*/
|
||||
#define O_ACCMODE (O_RDONLY | O_RDWR | O_WRONLY)
|
||||
|
||||
/* PROTOTYPES */
|
||||
int creat(const char *, mode_t);
|
||||
int fcntl(int, int, ...);
|
||||
int open(const char *, int, ...);
|
||||
|
||||
int _Wcreat(const wchar_t *, mode_t);
|
||||
int _Wopen(const wchar_t *, int, ...);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __FCNTL_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
93
posix/include/fmtmsg.h
Normal file
93
posix/include/fmtmsg.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/* $Id: fmtmsg.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* fmtmsg.h
|
||||
*
|
||||
* message display structures. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __FMTMSG_H_INCLUDED__
|
||||
#define __FMTMSG_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
/* Major Classifications */
|
||||
/* NOTE: these are unique values, not flags. Their bits can overlap, but
|
||||
cannot overlap with those of other categories */
|
||||
#define MM_HARD (0x00000001) /* Source of the condition is hardware. */
|
||||
#define MM_SOFT (0x00000002) /* Source of the condition is software. */
|
||||
#define MM_FIRM (0x00000003) /* Source of the condition is firmware. */
|
||||
|
||||
/* Message Source Subclassifications */
|
||||
/* NOTE: these are unique values, not flags. Their bits can overlap, but
|
||||
cannot overlap with those of other categories */
|
||||
#define MM_APPL (0x00000010) /* Condition detected by application. */
|
||||
#define MM_UTIL (0x00000020) /* Condition detected by utility. */
|
||||
#define MM_OPSYS (0x00000030) /* Condition detected by operating system. */
|
||||
|
||||
/* Status Subclassifications */
|
||||
/* NOTE: these are unique values, not flags. Their bits can overlap, but
|
||||
cannot overlap with those of other categories */
|
||||
#define MM_RECOVER (0x00000100) /* Recoverable error. */
|
||||
#define MM_NRECOV (0x00000200) /* Non-recoverable error. */
|
||||
|
||||
/* Display Subclassifications */
|
||||
/* NOTE: these, unlike other classification constants, are flags. Their
|
||||
bits must be distinct */
|
||||
#define MM_PRINT (0x00001000) /* Display message on standard error. */
|
||||
#define MM_CONSOLE (0x00002000) /* Display message on system console. */
|
||||
|
||||
/* Identifiers for the levels of severity */
|
||||
#define MM_NOSEV (0) /* No severity level provided for the message. */
|
||||
#define MM_INFO (1) /* Informative message. */
|
||||
#define MM_WARNING (2) /* Application has detected unusual non-error \
|
||||
condition. */
|
||||
#define MM_ERROR (3) /* Application has encountered a non-fatal fault. */
|
||||
#define MM_HALT (4) /* Error causing application to halt. */
|
||||
|
||||
/* Null values and identifiers */
|
||||
#define MM_NULLLBL ((char *)0) /* Null label */
|
||||
#define MM_NULLSEV (0) /* Null severity */
|
||||
#define MM_NULLMC (0L) /* Null class */
|
||||
#define MM_NULLTXT ((char *)0) /* Null text */
|
||||
#define MM_NULLACT ((char *)0) /* Null action */
|
||||
#define MM_NULLTAG ((char *)0) /* Null tag */
|
||||
|
||||
/* Return values */
|
||||
#define MM_OK ( 0) /* The function succeeded. */
|
||||
#define MM_NOTOK (-1) /* The function failed completely. */
|
||||
#define MM_NOMSG (-2) /* The function was unable to generate a message on \
|
||||
standard error, but otherwise succeeded. */
|
||||
#define MM_NOCON (-3) /* The function was unable to generate a console \
|
||||
message, but otherwise succeeded. */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int fmtmsg(long, const char*, int, const char*, const char*, const char*);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __FMTMSG_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
66
posix/include/fnmatch.h
Normal file
66
posix/include/fnmatch.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* $Id: fnmatch.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* fnmatch.h
|
||||
*
|
||||
* filename-matching types. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __FNMATCH_H_INCLUDED__
|
||||
#define __FNMATCH_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#ifdef __PSXDLL__
|
||||
|
||||
/* headers for internal usage by psxdll.dll and ReactOS */
|
||||
|
||||
#else /* ! __PSXDLL__ */
|
||||
|
||||
/* standard POSIX headers */
|
||||
|
||||
#endif
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
/* Flags */
|
||||
#define FNM_PATHNAME (0x00000001) /* Slash in string only matches slash \
|
||||
in pattern. */
|
||||
#define FNM_PERIOD (0x00000002) /* Leading period in string must be \
|
||||
exactly matched by period in \
|
||||
pattern. */
|
||||
#define FNM_NOESCAPE (0x00000004) /* Disable backslash escaping. */
|
||||
|
||||
/* Return values */
|
||||
#define FNM_NOMATCH (1) /* The string does not match the specified \
|
||||
pattern. */
|
||||
#define FNM_NOSYS (2) /* The implementation does not support this \
|
||||
function. */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int fnmatch(const char *, const char *, int);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __FNMATCH_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
73
posix/include/ftw.h
Normal file
73
posix/include/ftw.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/* $Id: ftw.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* ftw.h
|
||||
*
|
||||
* file tree traversal. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __FTW_H_INCLUDED__
|
||||
#define __FTW_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
struct FTW
|
||||
{
|
||||
int base;
|
||||
int level;
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
/* Values of the third argument to the application-supplied function
|
||||
that is passed as the second argument to ftw() and nftw() */
|
||||
#define FTW_F (1) /* File. */
|
||||
#define FTW_D (2) /* Directory. */
|
||||
#define FTW_DNR (3) /* Directory without read permission. */
|
||||
#define FTW_DP (4) /* Directory with subdirectories visited. */
|
||||
#define FTW_NS (5) /* Unknown type, stat() failed. */
|
||||
#define FTW_SL (6) /* Symbolic link. */
|
||||
#define FTW_SLN (7) /* Symbolic link that names a non-existent file. */
|
||||
|
||||
/* Values of the fourth argument to nftw() */
|
||||
#define FTW_PHYS (0x00000001) /* Physical walk, does not follow symbolic \
|
||||
links. Otherwise, nftw() will follow \
|
||||
links but will not walk down any path \
|
||||
that crosses itself. */
|
||||
#define FTW_MOUNT (0x00000002) /* The walk will not cross a mount point. */
|
||||
#define FTW_DEPTH (0x00000004) /* All subdirectories will be visited before \
|
||||
the directory itself. */
|
||||
#define FTW_CHDIR (0x00000008) /* The walk will change to each directory \
|
||||
before reading it. */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int ftw(const char *,
|
||||
int (*)(const char *, const struct stat *, int), int);
|
||||
int nftw(const char *, int (*)
|
||||
(const char *, const struct stat *, int, struct FTW*),
|
||||
int, int);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __FTW_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
73
posix/include/glob.h
Normal file
73
posix/include/glob.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/* $Id: glob.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* glob.h
|
||||
*
|
||||
* pathname pattern-matching types. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __GLOB_H_INCLUDED__
|
||||
#define __GLOB_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
typedef struct __tagglob_t
|
||||
{
|
||||
size_t gl_pathc; /* count of paths matched by pattern */
|
||||
char **gl_pathv; /* pointer to a list of matched pathnames */
|
||||
size_t gl_offs; /* slots to reserve at the beginning of gl_pathv */
|
||||
} glob_t;
|
||||
|
||||
/* CONSTANTS */
|
||||
/* Values for the flags argument */
|
||||
#define GLOB_APPEND (0x00000001) /* Append generated pathnames to \
|
||||
those previously obtained. */
|
||||
#define GLOB_DOOFFS (0x00000002) /* Specify how many null pointers to \
|
||||
add to the beginning of */
|
||||
#define GLOB_ERR (0x00000004) /* Cause glob() to return on error. */
|
||||
#define GLOB_MARK (0x00000008) /* Each pathname that is a directory \
|
||||
that matches pattern has a slash \
|
||||
appended. */
|
||||
#define GLOB_NOCHECK (0x00000010) /* If pattern does not match any pathname, \
|
||||
then return a list consisting of only \
|
||||
pattern. */
|
||||
#define GLOB_NOESCAPE (0x00000020) /* Disable backslash escaping. */
|
||||
#define GLOB_NOSORT (0x00000040) /* Do not sort the pathnames returned. */
|
||||
|
||||
/* Error return values */
|
||||
#define GLOB_ABORTED (-1) /* The scan was stopped because GLOB_ERR was set \
|
||||
or errfunc returned non-zero. */
|
||||
#define GLOB_NOMATCH (-2) /* The pattern does not match any existing pathname, \
|
||||
and GLOB_NOCHECK was not set in flags. */
|
||||
#define GLOB_NOSPACE (-3) /* An attempt to allocate memory failed. */
|
||||
#define GLOB_NOSYS (-4) /* The implementation does not support this function. */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int glob(const char *, int, int (*)(const char *, int), glob_t *);
|
||||
void globfree (glob_t *);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __GLOB_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
59
posix/include/grp.h
Normal file
59
posix/include/grp.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/* $Id: grp.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* grp.h
|
||||
*
|
||||
* group structure. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __GRP_H_INCLUDED__
|
||||
#define __GRP_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
struct group
|
||||
{
|
||||
char *gr_name; /* the name of the group */
|
||||
gid_t gr_gid; /* numerical group ID */
|
||||
char **gr_mem; /* pointer to a null-terminated array of character
|
||||
pointers to member names */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
struct group *getgrgid(gid_t);
|
||||
struct group *getgrnam(const char *);
|
||||
int getgrgid_r(gid_t, struct group *, char *,
|
||||
size_t, struct group **);
|
||||
int getgrnam_r(const char *, struct group *, char *,
|
||||
size_t , struct group **);
|
||||
struct group *getgrent(void);
|
||||
void endgrent(void);
|
||||
void setgrent(void);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __GRP_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
47
posix/include/iconv.h
Normal file
47
posix/include/iconv.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* $Id: iconv.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* iconv.h
|
||||
*
|
||||
* codeset conversion facility. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __ICONV_H_INCLUDED__
|
||||
#define __ICONV_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
typedef (void *) iconv_t;
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
iconv_t iconv_open(const char *, const char *);
|
||||
size_t iconv(iconv_t, char **, size_t *, char **, size_t *);
|
||||
int iconv_close(iconv_t);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __ICONV_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
60
posix/include/inttypes.h
Normal file
60
posix/include/inttypes.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/* $Id: inttypes.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* inttypes.h
|
||||
*
|
||||
* fixed size integral types. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __INTTYPES_H_INCLUDED__
|
||||
#define __INTTYPES_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
/* signed */
|
||||
typedef signed char int8_t; /* 8-bit signed integral type. */
|
||||
typedef signed short int int16_t; /* 16-bit signed integral type. */
|
||||
typedef signed long int int32_t; /* 32-bit signed integral type. */
|
||||
typedef signed long long int64_t; /* 64-bit signed integral type. */
|
||||
|
||||
/* unsigned */
|
||||
typedef unsigned char uint8_t; /* 8-bit unsigned integral type. */
|
||||
typedef unsigned short int uint16_t; /* 16-bit unsigned integral type. */
|
||||
typedef unsigned long int uint32_t; /* 32-bit unsigned integral type. */
|
||||
typedef unsigned long long uint64_t; /* 64-bit unsigned integral type. */
|
||||
|
||||
/* pointer-sized */
|
||||
typedef signed long int intptr_t; /* Signed integral type large enough
|
||||
to hold any pointer. */
|
||||
typedef unsigned long int uintptr_t; /* Unsigned integral type large
|
||||
enough to hold any pointer. */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __INTTYPES_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
54
posix/include/iso646.h
Normal file
54
posix/include/iso646.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/* $Id: iso646.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* iso646.h
|
||||
*
|
||||
* alternative spellings. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __ISO646_H_INCLUDED__
|
||||
#define __ISO646_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
#define and &&
|
||||
#define and_eq &=
|
||||
#define bitand &
|
||||
#define bitor |
|
||||
#define compl ~
|
||||
#define not !
|
||||
#define not_eq !=
|
||||
#define or ||
|
||||
#define or_eq |=
|
||||
#define xor ^
|
||||
#define xor_eq ^=
|
||||
|
||||
#endif /* __ISO646_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
52
posix/include/libgen.h
Normal file
52
posix/include/libgen.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/* $Id: libgen.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* libgen.h
|
||||
*
|
||||
* definitions for pattern matching functions. Conforming to the Single
|
||||
* UNIX(r) Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __LIBGEN_H_INCLUDED__
|
||||
#define __LIBGEN_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <stddef.h>
|
||||
|
||||
/* OBJECTS */
|
||||
extern char *__loc1; /* LEGACY */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
char *basename(char *);
|
||||
char *dirname(char *);
|
||||
char *regcmp(const char *, ...); /* LEGACY */
|
||||
char *regex(const char *, const char *, ...); /* LEGACY */
|
||||
|
||||
wchar_t *_Wbasename(wchar_t *);
|
||||
wchar_t *_Wdirname(wchar_t *);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __LIBGEN_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
45
posix/include/limits.h
Normal file
45
posix/include/limits.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* $Id: limits.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* limits.h
|
||||
*
|
||||
* implementation-dependent constants. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __LIMITS_H_INCLUDED__
|
||||
#define __LIMITS_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
/* TODO */
|
||||
#define OPEN_MAX (256)
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __LIMITS_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
65
posix/include/math.h
Normal file
65
posix/include/math.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/* $Id: math.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* math.h
|
||||
*
|
||||
* mathematical declarations. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __MATH_H_INCLUDED__
|
||||
#define __MATH_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#ifdef __PSXDLL__
|
||||
|
||||
/* headers for internal usage by psxdll.dll and ReactOS */
|
||||
|
||||
#else /* ! __PSXDLL__ */
|
||||
|
||||
/* standard POSIX headers */
|
||||
|
||||
#endif
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
#define M_E ((double) 2.7182818285) /* Value of e */
|
||||
#define M_LOG2E ((double) 1.4426950419) /* Value of log2(e) */
|
||||
#define M_LOG10E ((double) 0.4342944819) /* Value of log10(e) */
|
||||
#define M_LN2 ((double)-0.6931471806) /* Value of loge2 */
|
||||
#define M_LN10 ((double) 2.3025850929) /* Value of loge10 */
|
||||
#define M_PI ((double) 3.1415926536) /* Value of Pi */
|
||||
#define M_PI_2 ((double) 1.5707963268) /* Value of Pi/2 */
|
||||
#define M_PI_4 ((double) 0.7853981634) /* Value of Pi/4 */
|
||||
#define M_1_PI ((double) 0.3183098862) /* Value of 1/Pi */
|
||||
#define M_2_PI ((double) 0.6366197724) /* Value of 2/Pi */
|
||||
#define M_2_SQRTPI ((double) 1.1283791671) /* Value of 2/Sqrt(Pi) */
|
||||
#define M_SQRT2 ((double) 1.4142135624) /* Value of Sqrt(2) */
|
||||
#define M_SQRT1_2 ((double) 0.7071067812) /* Value of Sqrt(1/2) */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __MATH_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/netinet/in.h
Normal file
43
posix/include/netinet/in.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: in.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* netinet/in.h
|
||||
*
|
||||
* Internet Protocol family. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __NETINET_IN_H_INCLUDED__
|
||||
#define __NETINET_IN_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __NETINET_IN_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
146
posix/include/psx/debug.h
Normal file
146
posix/include/psx/debug.h
Normal file
@@ -0,0 +1,146 @@
|
||||
/* $Id: debug.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* psx/debug.h
|
||||
*
|
||||
* debugging utilities
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PSX_DEBUG_H_INCLUDED__
|
||||
#define __PSX_DEBUG_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#ifdef __PSX_DEBUG_TO_STDERR__
|
||||
#include <stdio.h>
|
||||
#else /* !defined(__PSX_DEBUG_TO_STDERR__) */
|
||||
#include <ddk/ntddk.h>
|
||||
#endif /* defined(__PSX_DEBUG_TO_STDERR__) */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#define __PSX_MODULE__ "psxdll.dll"
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
#ifdef __PSX_DEBUG_TO_STDERR__
|
||||
|
||||
#if 0
|
||||
#define DEBUGOUT(MODULE,TYPE,ARGS...) \
|
||||
do{ \
|
||||
fprintf(stderr,"%s:%s:%s:%d:%s():\n\t",(MODULE),(TYPE),__FILE__,__LINE__,__FUNCTION__); \
|
||||
fprintf(stderr,ARGS); \
|
||||
fprintf("\n"); \
|
||||
} \
|
||||
while(0)
|
||||
#endif
|
||||
|
||||
#define DEBUGOUT(MODULE,TYPE,ARGS...) \
|
||||
do{ \
|
||||
printf("%s:%s:%s:%d:%s():\n\t",(MODULE),(TYPE),__FILE__,__LINE__,__FUNCTION__); \
|
||||
printf(ARGS); \
|
||||
printf("\n"); \
|
||||
} \
|
||||
while(0)
|
||||
|
||||
|
||||
#else /* !defined(__PSX_DEBUG_TO_STDERR__) */
|
||||
|
||||
#define DEBUGOUT(MODULE,TYPE,ARGS...) \
|
||||
do{ \
|
||||
DbgPrint("%s:%s:%s:%d:%s():\n\t",(MODULE),(TYPE),__FILE__,__LINE__,__FUNCTION__); \
|
||||
DbgPrint(ARGS); \
|
||||
DbgPrint("\n"); \
|
||||
} \
|
||||
while(0)
|
||||
|
||||
#endif /* defined(__PSX_DEBUG_TO_STDERR__) */
|
||||
|
||||
#define DEBUGOUTIF(CONDITION,MODULE,TYPE,ARGS...) \
|
||||
if((CONDITION)) \
|
||||
{ \
|
||||
DEBUGOUT((MODULE),(TYPE),ARGS); \
|
||||
}
|
||||
|
||||
#else /* defined(NDEBUG) */
|
||||
|
||||
#define DEBUGOUTIF(c,m,t,args...)
|
||||
#define DEBUGOUT(m,t,args...)
|
||||
|
||||
#endif /* !defined(NDEBUG) */
|
||||
|
||||
#if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_HINTS__)
|
||||
#define HINT(args...) DEBUGOUT(__PSX_MODULE__,"HINT",args)
|
||||
#define HINTIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"HINT",args)
|
||||
#else
|
||||
#define HINT(args...)
|
||||
#define HINTIF(c,args...)
|
||||
#endif
|
||||
|
||||
#if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_INFOS__)
|
||||
#define INFO(args...) DEBUGOUT(__PSX_MODULE__,"INFO",args)
|
||||
#define INFOIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"INFO",args)
|
||||
#else
|
||||
#define INFO(args...)
|
||||
#define INFOIF(c,args...)
|
||||
#endif
|
||||
|
||||
#if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_WARNS__)
|
||||
#define WARN(args...) DEBUGOUT(__PSX_MODULE__,"WARN",args)
|
||||
#define WARNIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"WARN",args)
|
||||
#else
|
||||
#define WARN(args...)
|
||||
#define WARNIF(c,args...)
|
||||
#endif
|
||||
|
||||
#if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_ERRS__)
|
||||
#define ERR(args...) DEBUGOUT(__PSX_MODULE__,"ERR",args)
|
||||
#define ERRIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"ERR",args)
|
||||
#else
|
||||
#define ERR(args...)
|
||||
#define ERRIF(c,args...)
|
||||
#endif
|
||||
|
||||
#if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_TODOS__)
|
||||
#define TODO(args...) DEBUGOUT(__PSX_MODULE__,"TODO",args)
|
||||
#define TODOIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"TODO",args)
|
||||
#else
|
||||
#define TODO(args...)
|
||||
#define TODOIF(c,args...)
|
||||
#endif
|
||||
|
||||
#if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_FIXMES__)
|
||||
#define FIXME(args...) DEBUGOUT(__PSX_MODULE__,"FIXME",args)
|
||||
#define FIXMEIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"FIXME",args)
|
||||
#else
|
||||
#define FIXME(args...)
|
||||
#define FIXMEIF(c,args...)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __PSX_DEBUG_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
57
posix/include/psx/dirent.h
Normal file
57
posix/include/psx/dirent.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* $Id: dirent.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* psx/dirent.h
|
||||
*
|
||||
* internal dirent.h
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PSX_DIRENT_H_INCLUDED__
|
||||
#define __PSX_DIRENT_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <ddk/ntddk.h>
|
||||
#include <dirent.h>
|
||||
#include <psx/safeobj.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
struct __internal_DIR
|
||||
{
|
||||
__magic_t signature; /* signature to verify object's validity across calls */
|
||||
union __any_dirent{
|
||||
struct dirent de_ansi;
|
||||
struct _Wdirent de_unicode;
|
||||
} ent; /* storage for return buffer of readdir() */
|
||||
int fildes; /* file descriptor of the directory */
|
||||
FILE_DIRECTORY_INFORMATION info; /* directory entry information */
|
||||
WCHAR name[MAX_PATH]; /* filename buffer */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
#define __IDIR_MAGIC MAGIC('I', 'D', 'I', 'R')
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __PSX_DIRENT_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
53
posix/include/psx/dlfcn.h
Normal file
53
posix/include/psx/dlfcn.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* $Id: dlfcn.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* psx/dlfcn.h
|
||||
*
|
||||
* internal dlfcn.h
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PSX_DLFCN_H_INCLUDED__
|
||||
#define __PSX_DLFCN_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <psx/errno.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
/* internal representation for loaded DLLs */
|
||||
/* TODO: get rid of this. The handle should be enough, with a proper PE loader */
|
||||
struct __dlobj
|
||||
{
|
||||
int global; /* if non-zero, all the other fields have no meaning */
|
||||
void *handle; /* pointer to the module mapping */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
void __dl_set_last_error(int);
|
||||
|
||||
/* MACROS */
|
||||
#define __dl_get_reloc_flag(m) ((m) & (RTLD_LAZY | RTLD_NOW))
|
||||
#define __dl_get_scope_flag(m) ((m) & (RTLD_GLOBAL | RTLD_LOCAL))
|
||||
|
||||
#endif /* __PSX_DLFCN_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
45
posix/include/psx/errno.h
Normal file
45
posix/include/psx/errno.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* $Id: errno.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* psx/errno.h
|
||||
*
|
||||
* internal errno.h
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PSX_ERRNO_H_INCLUDED__
|
||||
#define __PSX_ERRNO_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <errno.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
#define __status_to_errno(s) (s)
|
||||
#define __set_errno_from_status(s) (errno = __status_to_errno((s)))
|
||||
|
||||
#endif /* __PSX_ERRNO_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
72
posix/include/psx/fdtable.h
Normal file
72
posix/include/psx/fdtable.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* $Id: fdtable.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* psx/fdtable.h
|
||||
*
|
||||
* POSIX+ subsystem file descriptor table data structure
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PSX_FDTABLE_H_INCLUDED__
|
||||
#define __PSX_FDTABLE_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <limits.h>
|
||||
#include <inttypes.h>
|
||||
#include <psx/safeobj.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
typedef struct __tagfildes_t
|
||||
{
|
||||
void *FileHandle;
|
||||
int OpenFlags;
|
||||
int FdFlags;
|
||||
size_t ExtraDataSize;
|
||||
void *ExtraData;
|
||||
} __fildes_t;
|
||||
|
||||
typedef struct __tagfdtable_t
|
||||
{
|
||||
__magic_t Signature;
|
||||
int32_t LowestUnusedFileNo;
|
||||
int32_t UsedDescriptors;
|
||||
int32_t AllocatedDescriptors;
|
||||
uint32_t DescriptorsBitmap[OPEN_MAX / 32];
|
||||
__fildes_t *Descriptors;
|
||||
} __fdtable_t;
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int __fdtable_init(__fdtable_t *);
|
||||
int __fdtable_free(__fdtable_t *);
|
||||
|
||||
int __fdtable_entry_isavail(__fdtable_t *, int);
|
||||
int __fdtable_entry_nextavail(__fdtable_t *, int);
|
||||
int __fdtable_entry_add(__fdtable_t *, int, __fildes_t *, __fildes_t **);
|
||||
int __fdtable_entry_remove(__fdtable_t *, int);
|
||||
__fildes_t *__fdtable_entry_get(__fdtable_t *, int);
|
||||
|
||||
/* MACROS */
|
||||
#define __FDTABLE_MAGIC MAGIC('F', 'D', 'T', 'B')
|
||||
|
||||
#endif /* __PSX_FDTABLE_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
45
posix/include/psx/interlock.h
Normal file
45
posix/include/psx/interlock.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* $Id: interlock.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* psx/interlock.h
|
||||
*
|
||||
* inter-locked increment/decrement
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PSX_INTERLOCK_H_INCLUDED__
|
||||
#define __PSX_INTERLOCK_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int __interlock_inc(int *);
|
||||
int __interlock_dec(int *);
|
||||
int __interlock_add(int *, int);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __PSX_INTERLOCK_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
112
posix/include/psx/path.h
Normal file
112
posix/include/psx/path.h
Normal file
@@ -0,0 +1,112 @@
|
||||
/* $Id: path.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* psx/path.h
|
||||
*
|
||||
* POSIX+ subsystem path functions
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PSX_PATH_H_INCLUDED__
|
||||
#define __PSX_PATH_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <ddk/ntddk.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
BOOLEAN
|
||||
__PdxPosixPathGetNextComponent_U
|
||||
(
|
||||
IN UNICODE_STRING PathName,
|
||||
IN OUT PUNICODE_STRING PathComponent,
|
||||
OUT PBOOLEAN TrailingDelimiter OPTIONAL
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
__PdxPosixPathResolve_U
|
||||
(
|
||||
IN UNICODE_STRING PathName,
|
||||
OUT PUNICODE_STRING ResolvedPathName,
|
||||
IN WCHAR PathDelimiter OPTIONAL
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
__PdxPosixPathGetNextComponent_A
|
||||
(
|
||||
IN ANSI_STRING PathName,
|
||||
IN OUT PANSI_STRING PathComponent,
|
||||
OUT PBOOLEAN TrailingDelimiter OPTIONAL
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
__PdxPosixPathResolve_A
|
||||
(
|
||||
IN ANSI_STRING PathName,
|
||||
OUT PANSI_STRING ResolvedPathName,
|
||||
IN CHAR PathDelimiter OPTIONAL
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
__PdxPosixPathNameToNtPathName
|
||||
(
|
||||
IN PWCHAR PosixPath,
|
||||
OUT PUNICODE_STRING NativePath,
|
||||
IN PUNICODE_STRING CurDir OPTIONAL,
|
||||
IN PUNICODE_STRING RootDir OPTIONAL
|
||||
);
|
||||
|
||||
/* MACROS */
|
||||
/* returns non-zero if the argument is a path delimiter */
|
||||
#define IS_CHAR_DELIMITER_U(WCH) (((WCH) == L'/') || ((WCH) == L'\\'))
|
||||
#define IS_CHAR_DELIMITER_A(CH) (((CH) == '/') || ((CH) == '\\'))
|
||||
|
||||
/* returns non-zero if the argument is an empty path component */
|
||||
#define IS_COMPONENT_EMPTY_U(WCOMPONENT) (WCOMPONENT.Length == 0)
|
||||
#define IS_COMPONENT_EMPTY_A(COMPONENT) (COMPONENT.Length == 0)
|
||||
|
||||
/* returns non-zero if the argument is "." */
|
||||
#define IS_COMPONENT_DOT_U(WCOMPONENT) \
|
||||
((WCOMPONENT.Length == sizeof(WCHAR)) && (WCOMPONENT.Buffer[0] == L'.'))
|
||||
|
||||
#define IS_COMPONENT_DOT_A(COMPONENT) \
|
||||
((COMPONENT.Length == 1) && (COMPONENT.Buffer[0] == '.'))
|
||||
|
||||
/* returns non-zero if the argument is ".." */
|
||||
#define IS_COMPONENT_DOTDOT_U(WCOMPONENT) \
|
||||
( \
|
||||
(WCOMPONENT.Length == (sizeof(WCHAR) * 2)) && \
|
||||
(WCOMPONENT.Buffer[0] == L'.') && \
|
||||
(WCOMPONENT.Buffer[1] == L'.') \
|
||||
)
|
||||
|
||||
#define IS_COMPONENT_DOTDOT_A(COMPONENT) \
|
||||
( \
|
||||
(COMPONENT.Length == 2) && \
|
||||
(COMPONENT.Buffer[0] == '.') && \
|
||||
(COMPONENT.Buffer[1] == '.') \
|
||||
)
|
||||
|
||||
#endif /* __PSX_PATH_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
71
posix/include/psx/pdata.h
Normal file
71
posix/include/psx/pdata.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/* $Id: pdata.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* psx/pdata.h
|
||||
*
|
||||
* POSIX+ subsystem process environment data structure
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PSX_PDATA_H_INCLUDED__
|
||||
#define __PSX_PDATA_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ntdll/rtl.h>
|
||||
#include <limits.h>
|
||||
#include <psx/fdtable.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
typedef struct __tagPDX_PDATA
|
||||
{
|
||||
UNICODE_STRING NativePathBuffer;
|
||||
UNICODE_STRING CurDir;
|
||||
UNICODE_STRING RootPath;
|
||||
HANDLE RootHandle;
|
||||
__fdtable_t *FdTable;
|
||||
} __PDX_PDATA, * __PPDX_PDATA;
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
#define __PdxAcquirePdataLock() (RtlAcquirePebLock())
|
||||
#define __PdxReleasePdataLock() (RtlReleasePebLock())
|
||||
|
||||
#define __PdxSetProcessData()(PPDATA) ((void)((NtCurrentPeb()->SubSystemData) = (PPDATA)))
|
||||
#define __PdxGetProcessData() ((__PPDX_PDATA)(&(NtCurrentPeb()->SubSystemData)))
|
||||
|
||||
#define __PdxGetNativePathBuffer() ((PUNICODE_STRING)(&(__PdxGetProcessData()->NativePathBuffer)))
|
||||
#define __PdxGetCurDir() ((PUNICODE_STRING)(&(__PdxGetProcessData()->CurDir)))
|
||||
#define __PdxGetRootPath() ((PUNICODE_STRING)(&(__PdxGetProcessData()->RootPath)))
|
||||
#define __PdxGetRootHandle() ((HANDLE)(__PdxGetProcessData()->RootHandle))
|
||||
#define __PdxGetFdTable() ((__fdtable_t *)(__PdxGetProcessData()->FdTable))
|
||||
|
||||
#define __PdxSetNativePathBuffer(BUF) ((void)((__PdxGetProcessData()->NativePathBuffer) = (BUF)))
|
||||
#define __PdxSetCurDir(CURDIR) ((void)((__PdxGetProcessData()->CurDir) = (CURDIR)))
|
||||
#define __PdxSetRootPath(ROOTPATH) ((void)((__PdxGetProcessData()->RootPath) = (ROOTPATH)))
|
||||
#define __PdxSetRootHandle(ROOTHANDLE) ((void)((__PdxGetProcessData()->RootHandle) = (ROOTHANDLE)))
|
||||
#define __PdxSetFdTable(FDTABLE) ((void)((__PdxGetProcessData()->FdTable) = (FDTABLE)))
|
||||
|
||||
#endif /* __PSX_PDATA_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
61
posix/include/psx/pthread.h
Normal file
61
posix/include/psx/pthread.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/* $Id: pthread.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* psx/pthread.h
|
||||
*
|
||||
* internal pthread.h
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PSX_PTHREAD_H_INCLUDED__
|
||||
#define __PSX_PTHREAD_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <psx/safeobj.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
struct __mutexattr
|
||||
{
|
||||
__magic_t signature;
|
||||
int pshared;
|
||||
int protocol;
|
||||
int type;
|
||||
};
|
||||
|
||||
struct __mutex
|
||||
{
|
||||
__magic_t signature;
|
||||
void * handle;
|
||||
int protocol;
|
||||
int type;
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
#define __PTHREAD_MUTEX_MAGIC (MAGIC('P', 'T', 'M', 'X'))
|
||||
#define __PTHREAD_MUTEX_ATTR_MAGIC (MAGIC('P', 'T', 'M', 'A'))
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __PSX_PTHREAD_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
59
posix/include/psx/safeobj.h
Normal file
59
posix/include/psx/safeobj.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/* $Id: safeobj.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* psx/safeobj.h
|
||||
*
|
||||
* types and definitions for safe checking of user-provided objects
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PSX_SAFEOBJ_H_INCLUDED__
|
||||
#define __PSX_SAFEOBJ_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <inttypes.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
typedef uint32_t __magic_t;
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int __safeobj_validate(void *, __magic_t);
|
||||
|
||||
/* MACROS */
|
||||
/* builds a magic number from 4 characters */
|
||||
#define MAGIC(a,b,c,d) ( \
|
||||
(((uint32_t)(uint8_t)(a)) << 24) | \
|
||||
(((uint32_t)(uint8_t)(b)) << 16) | \
|
||||
(((uint32_t)(uint8_t)(c)) << 8) | \
|
||||
(((uint32_t)(uint8_t)(d)) << 0) \
|
||||
)
|
||||
|
||||
/* retrieves a comma-separated list of the 4 characters in a magic number */
|
||||
#define MAGIC_DECOMPOSE(m) \
|
||||
((uint8_t)(m >> 24)), \
|
||||
((uint8_t)(m >> 16)), \
|
||||
((uint8_t)(m >> 8)), \
|
||||
((uint8_t)(m >> 0))
|
||||
|
||||
#endif /* __PSX_SAFEOBJ_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
51
posix/include/psx/stdlib.h
Normal file
51
posix/include/psx/stdlib.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* $Id: stdlib.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* psx/stdlib.h
|
||||
*
|
||||
* internal stdlib.h
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PSX_STDLIB_H_INCLUDED__
|
||||
#define __PSX_STDLIB_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ntos/heap.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
/* FIXME? Windows NT's ntdll doesn't export RtlGetProcessHeap() */
|
||||
#define RtlGetProcessHeap() ((HANDLE)NtCurrentPeb()->ProcessHeap)
|
||||
|
||||
#define __malloc(SIZE) (RtlAllocateHeap(RtlGetProcessHeap(), 0, (SIZE)))
|
||||
#define __realloc(PTR,SIZE) (RtlReAllocateHeap(RtlGetProcessHeap(), 0, (PTR), (SIZE)))
|
||||
#define __free(PTR) (RtlFreeHeap(RtlGetProcessHeap(), 0, (PTR)))
|
||||
|
||||
#endif /* __PSX_STDLIB_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
83
posix/include/psx/template.h
Normal file
83
posix/include/psx/template.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/* $Id: template.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
How to create a new header file from this template:
|
||||
- copy the template in the new file (never edit this file directly, unless
|
||||
that's what you want)
|
||||
- search for the string "EDITME" in the file, and follow the instructions
|
||||
- remove this comment block, all blocks containing DELETEME, and all EDITME
|
||||
instructions
|
||||
- save your file, and Have Fun! (TM)
|
||||
*/
|
||||
/* $ Id $ (EDITME: replace "$ Id $" with "$Id: template.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $")
|
||||
*/
|
||||
/*
|
||||
* psx/template.h (EDITME: replace with the real name of the header)
|
||||
*
|
||||
* template for POSIX headers (EDITME: replace this line with the real file
|
||||
* description)
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by John Doe <john.doe@mail.com> (EDITME: your name and e-mail go
|
||||
* here)
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Tags are used to prevent double inclusion of C header files. This
|
||||
technique should be documented in all good C manuals
|
||||
|
||||
How to generate an unique tag for your header:
|
||||
- uppercase the name of the header, where "name" is the filename and
|
||||
the optional relative path (e.g. "stdio.h", "sys/types.h")
|
||||
- replace all non-alphanumeric characters in the obtained name with an
|
||||
underscore character ("_")
|
||||
- prepend a double underscore ("__"), and append the string "_INCLUDED__"
|
||||
- replace all occurrences of "__PSX_TEMPLATE_H_INCLUDED__" in this file
|
||||
with your tag
|
||||
|
||||
Example tags:
|
||||
sys/types.h -> SYS/TYPES.H -> SYS_TYPES_H -> __SYS_TYPES_H_INCLUDED__
|
||||
iso646.h -> ISO646.H -> ISO646_H -> __ISO646_H_INCLUDED__
|
||||
|
||||
(REMOVEME)
|
||||
*/
|
||||
#ifndef __PSX_TEMPLATE_H_INCLUDED__ /* EDITME: replace macro with unique tag */
|
||||
#define __PSX_TEMPLATE_H_INCLUDED__ /* EDITME: replace macro with unique tag */
|
||||
/*
|
||||
Explanation of the sections:
|
||||
INCLUDES #include directives should be grouped here
|
||||
OBJECTS declare global variables here
|
||||
TYPES types, structures and unions here
|
||||
CONSTANTS symbolic constants (simple #define's), enums, constants
|
||||
PROTOTYPES ANSI C function prototypes
|
||||
MACROS parametrized macros
|
||||
|
||||
(REMOVEME)
|
||||
*/
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __PSX_TEMPLATE_H_INCLUDED__ */ /* EDITME: replace macro with unique tag */
|
||||
|
||||
/* EOF */
|
||||
|
141
posix/include/pthread.h
Normal file
141
posix/include/pthread.h
Normal file
@@ -0,0 +1,141 @@
|
||||
/* $Id: pthread.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* pthread.h
|
||||
*
|
||||
* threads. Conforming to the Single UNIX(r) Specification Version 2,
|
||||
* System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PTHREAD_H_INCLUDED__
|
||||
#define __PTHREAD_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <sched.h>
|
||||
#include <time.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
#define PTHREAD_MUTEX_NORMAL (1)
|
||||
#define PTHREAD_MUTEX_ERRORCHECK (2)
|
||||
#define PTHREAD_MUTEX_RECURSIVE (3)
|
||||
|
||||
#define PTHREAD_MUTEX_DEFAULT (PTHREAD_MUTEX_NORMAL)
|
||||
|
||||
#define PTHREAD_PROCESS_PRIVATE (1)
|
||||
#define PTHREAD_PROCESS_SHARED (2)
|
||||
|
||||
#define PTHREAD_PRIO_NONE (1)
|
||||
|
||||
/* PROTOTYPES */
|
||||
int pthread_attr_destroy(pthread_attr_t *);
|
||||
int pthread_attr_getdetachstate(const pthread_attr_t *, int *);
|
||||
int pthread_attr_getguardsize(const pthread_attr_t *, size_t *);
|
||||
int pthread_attr_getinheritsched(const pthread_attr_t *, int *);
|
||||
int pthread_attr_getschedparam(const pthread_attr_t *,
|
||||
struct sched_param *);
|
||||
int pthread_attr_getschedpolicy(const pthread_attr_t *, int *);
|
||||
int pthread_attr_getscope(const pthread_attr_t *, int *);
|
||||
int pthread_attr_getstackaddr(const pthread_attr_t *, void **);
|
||||
int pthread_attr_getstacksize(const pthread_attr_t *, size_t *);
|
||||
int pthread_attr_init(pthread_attr_t *);
|
||||
int pthread_attr_setdetachstate(pthread_attr_t *, int);
|
||||
int pthread_attr_setguardsize(pthread_attr_t *, size_t);
|
||||
int pthread_attr_setinheritsched(pthread_attr_t *, int);
|
||||
int pthread_attr_setschedparam(pthread_attr_t *,
|
||||
const struct sched_param *);
|
||||
int pthread_attr_setschedpolicy(pthread_attr_t *, int);
|
||||
int pthread_attr_setscope(pthread_attr_t *, int);
|
||||
int pthread_attr_setstackaddr(pthread_attr_t *, void *);
|
||||
int pthread_attr_setstacksize(pthread_attr_t *, size_t);
|
||||
int pthread_cancel(pthread_t);
|
||||
void pthread_cleanup_push(void (*)(void *), void *);
|
||||
void pthread_cleanup_pop(int);
|
||||
int pthread_cond_broadcast(pthread_cond_t *);
|
||||
int pthread_cond_destroy(pthread_cond_t *);
|
||||
int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *);
|
||||
int pthread_cond_signal(pthread_cond_t *);
|
||||
int pthread_cond_timedwait(pthread_cond_t *,
|
||||
pthread_mutex_t *, const struct timespec *);
|
||||
int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *);
|
||||
int pthread_condattr_destroy(pthread_condattr_t *);
|
||||
int pthread_condattr_getpshared(const pthread_condattr_t *, int *);
|
||||
int pthread_condattr_init(pthread_condattr_t *);
|
||||
int pthread_condattr_setpshared(pthread_condattr_t *, int);
|
||||
int pthread_create(pthread_t *, const pthread_attr_t *,
|
||||
void *(*)(void *), void *);
|
||||
int pthread_detach(pthread_t);
|
||||
int pthread_equal(pthread_t, pthread_t);
|
||||
void pthread_exit(void *);
|
||||
int pthread_getconcurrency(void);
|
||||
int pthread_getschedparam(pthread_t, int *, struct sched_param *);
|
||||
void *pthread_getspecific(pthread_key_t);
|
||||
int pthread_join(pthread_t, void **);
|
||||
int pthread_key_create(pthread_key_t *, void (*)(void *));
|
||||
int pthread_key_delete(pthread_key_t);
|
||||
int pthread_mutex_destroy(pthread_mutex_t *);
|
||||
int pthread_mutex_getprioceiling(const pthread_mutex_t *, int *);
|
||||
int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *);
|
||||
int pthread_mutex_lock(pthread_mutex_t *);
|
||||
int pthread_mutex_setprioceiling(pthread_mutex_t *, int, int *);
|
||||
int pthread_mutex_trylock(pthread_mutex_t *);
|
||||
int pthread_mutex_unlock(pthread_mutex_t *);
|
||||
int pthread_mutexattr_destroy(pthread_mutexattr_t *);
|
||||
int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *,
|
||||
int *);
|
||||
int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *, int *);
|
||||
int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, int *);
|
||||
int pthread_mutexattr_gettype(const pthread_mutexattr_t *, int *);
|
||||
int pthread_mutexattr_init(pthread_mutexattr_t *);
|
||||
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int);
|
||||
int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int);
|
||||
int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
|
||||
int pthread_mutexattr_settype(pthread_mutexattr_t *, int);
|
||||
int pthread_once(pthread_once_t *, void (*)(void));
|
||||
int pthread_rwlock_destroy(pthread_rwlock_t *);
|
||||
int pthread_rwlock_init(pthread_rwlock_t *,
|
||||
const pthread_rwlockattr_t *);
|
||||
int pthread_rwlock_rdlock(pthread_rwlock_t *);
|
||||
int pthread_rwlock_tryrdlock(pthread_rwlock_t *);
|
||||
int pthread_rwlock_trywrlock(pthread_rwlock_t *);
|
||||
int pthread_rwlock_unlock(pthread_rwlock_t *);
|
||||
int pthread_rwlock_wrlock(pthread_rwlock_t *);
|
||||
int pthread_rwlockattr_destroy(pthread_rwlockattr_t *);
|
||||
int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *,
|
||||
int *);
|
||||
int pthread_rwlockattr_init(pthread_rwlockattr_t *);
|
||||
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int);
|
||||
pthread_t
|
||||
pthread_self(void);
|
||||
int pthread_setcancelstate(int, int *);
|
||||
int pthread_setcanceltype(int, int *);
|
||||
int pthread_setconcurrency(int);
|
||||
int pthread_setschedparam(pthread_t, int ,
|
||||
const struct sched_param *);
|
||||
int pthread_setspecific(pthread_key_t, const void *);
|
||||
void pthread_testcancel(void);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __PTHREAD_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
60
posix/include/pwd.h
Normal file
60
posix/include/pwd.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/* $Id: pwd.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* pwd.h
|
||||
*
|
||||
* password structure. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __PWD_H_INCLUDED__
|
||||
#define __PWD_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
struct passwd
|
||||
{
|
||||
char *pw_name; /* user's login name */
|
||||
uid_t pw_uid; /* numerical user ID */
|
||||
gid_t pw_gid; /* numerical group ID */
|
||||
char *pw_dir; /* initial working directory */
|
||||
char *pw_shell; /* program to use as shell */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
struct passwd *getpwnam(const char *);
|
||||
struct passwd *getpwuid(uid_t);
|
||||
int getpwnam_r(const char *, struct passwd *, char *,
|
||||
size_t, struct passwd **);
|
||||
int getpwuid_r(uid_t, struct passwd *, char *,
|
||||
size_t, struct passwd **);
|
||||
void endpwent(void);
|
||||
struct passwd *getpwent(void);
|
||||
void setpwent(void);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __PWD_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
62
posix/include/sched.h
Normal file
62
posix/include/sched.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* $Id: sched.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sched.h
|
||||
*
|
||||
* execution scheduling (REALTIME). Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SCHED_H_INCLUDED__
|
||||
#define __SCHED_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <time.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
struct sched_param
|
||||
{
|
||||
int sched_priority; /* process execution scheduling priority */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
/* First in-first out (FIFO) scheduling policy */
|
||||
#define SCHED_FIFO (1)
|
||||
/* Round robin scheduling policy */
|
||||
#define SCHED_RR (2)
|
||||
/* Another scheduling policy */
|
||||
#define SCHED_OTHER (3)
|
||||
|
||||
/* PROTOTYPES */
|
||||
int sched_get_priority_max(int);
|
||||
int sched_get_priority_min(int);
|
||||
int sched_getparam(pid_t, struct sched_param *);
|
||||
int sched_getscheduler(pid_t);
|
||||
int sched_rr_get_interval(pid_t, struct timespec *);
|
||||
int sched_setparam(pid_t, const struct sched_param *);
|
||||
int sched_setscheduler(pid_t, int, const struct sched_param *);
|
||||
int sched_yield(void);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SCHED_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
359
posix/include/signal.h
Normal file
359
posix/include/signal.h
Normal file
@@ -0,0 +1,359 @@
|
||||
/* $Id: signal.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* signal.h
|
||||
*
|
||||
* signals. Conforming to the Single UNIX(r) Specification Version 2,
|
||||
* System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SIGNAL_H_INCLUDED__
|
||||
#define __SIGNAL_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
/* pre-declaration of time.h types to suppress warnings caused by circular
|
||||
dependencies */
|
||||
struct timespec;
|
||||
|
||||
typedef int sig_atomic_t; /* Integral type of an object that can be
|
||||
accessed as an atomic entity, even in the
|
||||
presence of asynchronous interrupts */ /* FIXME? */
|
||||
|
||||
typedef struct __tagsigset_t
|
||||
{
|
||||
int _dummy;
|
||||
} sigset_t; /* Integral or structure type of an object used to represent
|
||||
sets of signals. */ /* TODO */
|
||||
|
||||
union sigval
|
||||
{
|
||||
int sival_int; /* integer signal value */
|
||||
void* sival_ptr; /* pointer signal value */
|
||||
};
|
||||
|
||||
struct sigevent
|
||||
{
|
||||
int sigev_notify; /* notification type */
|
||||
int sigev_signo; /* signal number */
|
||||
union sigval sigev_value; /* signal value */
|
||||
void (* sigev_notify_function)(union sigval); /* notification function */
|
||||
pthread_attr_t * sigev_notify_attributes; /* notification attributes */
|
||||
};
|
||||
|
||||
|
||||
typedef struct __tagsiginfo_t
|
||||
{
|
||||
int si_signo; /* signal number */
|
||||
int si_errno; /* if non-zero, an errno value associated with
|
||||
this signal, as defined in <errno.h> */
|
||||
int si_code; /* signal code */
|
||||
pid_t si_pid; /* sending process ID */
|
||||
uid_t si_uid; /* real user ID of sending process */
|
||||
void *si_addr; /* address of faulting instruction */
|
||||
int si_status; /* exit value or signal */
|
||||
long si_band; /* band event for SIGPOLL */
|
||||
union sigval si_value; /* signal value */
|
||||
} siginfo_t;
|
||||
|
||||
struct sigaction
|
||||
{
|
||||
void (* sa_handler)(int); /* what to do on receipt of signal */
|
||||
sigset_t sa_mask; /* set of signals to be blocked during
|
||||
execution of the signal handling
|
||||
function */
|
||||
int sa_flags; /* special flags */
|
||||
void (* sa_sigaction)(int, siginfo_t *, void *);
|
||||
/* pointer to signal handler function
|
||||
or one of the macros SIG_IGN or SIG_DFL */
|
||||
};
|
||||
|
||||
typedef struct __tagstack_t
|
||||
{
|
||||
void *ss_sp; /* stack base or pointer */
|
||||
size_t ss_size; /* stack size */
|
||||
int ss_flags; /* flags */
|
||||
} stack_t;
|
||||
|
||||
struct sigstack
|
||||
{
|
||||
int ss_onstack; /* non-zero when signal stack is in use */
|
||||
void *ss_sp; /* signal stack pointer */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
/* Request for default signal handling. */
|
||||
#define SIG_DFL ((void (*)(int))(0))
|
||||
/* Return value from signal() in case of error. */
|
||||
#define SIG_ERR ((void (*)(int))(1))
|
||||
/* Request that signal be held. */
|
||||
#define SIG_HOLD ((void (*)(int))(2))
|
||||
/* Request that signal be ignored. */
|
||||
#define SIG_IGN ((void (*)(int))(3))
|
||||
|
||||
/* No asynchronous notification will be delivered when the event of
|
||||
interest occurs. */
|
||||
#define SIGEV_NONE (0)
|
||||
/* A queued signal, with an application-defined value, will be generated
|
||||
when the event of interest occurs. */
|
||||
#define SIGEV_SIGNAL (1)
|
||||
/* A notification function will be called to perform notification. */
|
||||
#define SIGEV_THREAD (2)
|
||||
|
||||
/* TODO: realtime features not supported yet */
|
||||
#define SIGRTMIN (-1)
|
||||
#define SIGRTMAX (-1)
|
||||
|
||||
/* Process abort signal. */
|
||||
#define SIGABRT ( 1)
|
||||
/* Alarm clock. */
|
||||
#define SIGALRM ( 2)
|
||||
/* Erroneous arithmetic operation. */
|
||||
#define SIGFPE ( 3)
|
||||
/* Hangup. */
|
||||
#define SIGHUP ( 4)
|
||||
/* Illegal instruction. */
|
||||
#define SIGILL ( 5)
|
||||
/* Terminal interrupt signal. */
|
||||
#define SIGINT ( 6)
|
||||
/* Kill (cannot be caught or ignored). */
|
||||
#define SIGKILL ( 7)
|
||||
/* Write on a pipe with no one to read it. */
|
||||
#define SIGPIPE ( 8)
|
||||
/* Terminal quit signal. */
|
||||
#define SIGQUIT ( 9)
|
||||
/* Invalid memory reference. */
|
||||
#define SIGSEGV (10)
|
||||
/* Termination signal. */
|
||||
#define SIGTERM (11)
|
||||
/* User-defined signal 1. */
|
||||
#define SIGUSR1 (12)
|
||||
/* User-defined signal 2. */
|
||||
#define SIGUSR2 (13)
|
||||
/* Child process terminated or stopped. */
|
||||
#define SIGCHLD (14)
|
||||
/* Continue executing, if stopped. */
|
||||
#define SIGCONT (15)
|
||||
/* Stop executing (cannot be caught or ignored). */
|
||||
#define SIGSTOP (16)
|
||||
/* Terminal stop signal. */
|
||||
#define SIGTSTP (17)
|
||||
/* Background process attempting read. */
|
||||
#define SIGTTIN (18)
|
||||
/* Background process attempting write. */
|
||||
#define SIGTTOU (19)
|
||||
/* Access to an undefined portion of a memory object. */
|
||||
#define SIGBUS (20)
|
||||
/* Pollable event. */
|
||||
#define SIGPOLL (21)
|
||||
/* Profiling timer expired. */
|
||||
#define SIGPROF (22)
|
||||
/* Bad system call. */
|
||||
#define SIGSYS (23)
|
||||
/* Trace/breakpoint trap. */
|
||||
#define SIGTRAP (24)
|
||||
/* High bandwidth data is available at a socket. */
|
||||
#define SIGURG (25)
|
||||
/* Virtual timer expired. */
|
||||
#define SIGVTALRM (26)
|
||||
/* CPU time limit exceeded. */
|
||||
#define SIGXCPU (27)
|
||||
/* File size limit exceeded. */
|
||||
#define SIGXFSZ (28)
|
||||
|
||||
/* FIXME: the following constants need to be reviewed */
|
||||
/* Do not generate SIGCHLD when children stop. */
|
||||
#define SA_NOCLDSTOP (0x00000001)
|
||||
/* The resulting set is the union of the current set and the signal set
|
||||
pointed to by the argument set. */
|
||||
#define SA_ONSTACK (0x00000002)
|
||||
/* Causes signal dispositions to be set to SIG_DFL on entry to signal
|
||||
handlers. */
|
||||
#define SA_RESETHAND (0x00000004)
|
||||
/* Causes certain functions to become restartable. */
|
||||
#define SA_RESTART (0x00000008)
|
||||
/* Causes extra information to be passed to signal handlers at the time
|
||||
of receipt of a signal. */
|
||||
#define SA_SIGINFO (0x00000010)
|
||||
/* Causes implementations not to create zombie processes on child death. */
|
||||
#define SA_NOCLDWAIT (0x00000020)
|
||||
/* Causes signal not to be automatically blocked on entry to signal
|
||||
handler. */
|
||||
#define SA_NODEFER (0x00000040)
|
||||
|
||||
/* FIXME: the following constants need to be reviewed */
|
||||
/* The resulting set is the intersection of the current set and the
|
||||
complement of the signal set pointed to by the argument set. */
|
||||
#define SIG_BLOCK (1)
|
||||
/* The resulting set is the signal set pointed to by the argument
|
||||
set. */
|
||||
#define SIG_UNBLOCK (2)
|
||||
/* Causes signal delivery to occur on an alternate stack. */
|
||||
#define SIG_SETMASK (3)
|
||||
|
||||
/* FIXME: the following constants need to be reviewed */
|
||||
/* Process is executing on an alternate signal stack. */
|
||||
#define SS_ONSTACK (1)
|
||||
/* Alternate signal stack is disabled. */
|
||||
#define SS_DISABLE (2)
|
||||
|
||||
/* Minimum stack size for a signal handler. */ /* FIXME */
|
||||
#define MINSIGSTKSZ (0)
|
||||
/* Default size in bytes for the alternate signal stack. */ /* FIXME */
|
||||
#define SIGSTKSZ (0)
|
||||
|
||||
/*
|
||||
signal-specific reasons why the signal was generated
|
||||
*/
|
||||
/* SIGILL */
|
||||
/* illegal opcode */
|
||||
#define ILL_ILLOPC (1)
|
||||
/* illegal operand */
|
||||
#define ILL_ILLOPN (2)
|
||||
/* illegal addressing mode */
|
||||
#define ILL_ILLADR (3)
|
||||
/* illegal trap */
|
||||
#define ILL_ILLTRP (4)
|
||||
/* privileged opcode */
|
||||
#define ILL_PRVOPC (5)
|
||||
/* privileged register */
|
||||
#define ILL_PRVREG (6)
|
||||
/* coprocessor error */
|
||||
#define ILL_COPROC (7)
|
||||
/* internal stack error */
|
||||
#define ILL_BADSTK (8)
|
||||
|
||||
/* SIGFPE */
|
||||
/* integer divide by zero */
|
||||
#define FPE_INTDIV
|
||||
/* integer overflow */
|
||||
#define FPE_INTOVF
|
||||
/* floating point divide by zero */
|
||||
#define FPE_FLTDIV
|
||||
/* floating point overflow */
|
||||
#define FPE_FLTOVF
|
||||
/* floating point underflow */
|
||||
#define FPE_FLTUND
|
||||
/* floating point inexact result */
|
||||
#define FPE_FLTRES
|
||||
/* invalid floating point operation */
|
||||
#define FPE_FLTINV
|
||||
/* subscript out of range */
|
||||
#define FPE_FLTSUB
|
||||
|
||||
/* SIGSEGV */
|
||||
/* address not mapped to object */
|
||||
#define SEGV_MAPERR
|
||||
/* invalid permissions for mapped object */
|
||||
#define SEGV_ACCERR
|
||||
|
||||
/* SIGBUS */
|
||||
/* invalid address alignment */
|
||||
#define BUS_ADRALN
|
||||
/* non-existent physical address */
|
||||
#define BUS_ADRERR
|
||||
/* object specific hardware error */
|
||||
#define BUS_OBJERR
|
||||
|
||||
/* SIGTRAP */
|
||||
/* process breakpoint */
|
||||
#define TRAP_BRKPT
|
||||
/* process trace trap */
|
||||
#define TRAP_TRACE
|
||||
|
||||
/* SIGCHLD */
|
||||
/* child has exited */
|
||||
#define CLD_EXITED
|
||||
/* child has terminated abnormally and did not create a core file */
|
||||
#define CLD_KILLED
|
||||
/* child has terminated abnormally and created a core file */
|
||||
#define CLD_DUMPED
|
||||
/* traced child has trapped */
|
||||
#define CLD_TRAPPED
|
||||
/* child has stopped */
|
||||
#define CLD_STOPPED
|
||||
/* stopped child has continued */
|
||||
#define CLD_CONTINUED
|
||||
|
||||
/* SIGPOLL */
|
||||
/* data input available */
|
||||
#define POLL_IN
|
||||
/* output buffers available */
|
||||
#define POLL_OUT
|
||||
/* input message available */
|
||||
#define POLL_MSG
|
||||
/* I/O error */
|
||||
#define POLL_ERR
|
||||
/* high priority input available */
|
||||
#define POLL_PRI
|
||||
/* device disconnected */
|
||||
#define POLL_HUP
|
||||
/* signal sent by kill() */
|
||||
#define SI_USER
|
||||
/* signal sent by the sigqueue() */
|
||||
#define SI_QUEUE
|
||||
/* signal generated by expiration of a timer set by timer_settime() */
|
||||
#define SI_TIMER
|
||||
/* signal generated by completion of an asynchronous I/O request */
|
||||
#define SI_ASYNCIO
|
||||
/* signal generated by arrival of a message on an empty message queue */
|
||||
#define SI_MESGQ
|
||||
|
||||
/* PROTOTYPES */
|
||||
void (*bsd_signal(int, void (*)(int)))(int);
|
||||
int kill(pid_t, int);
|
||||
int killpg(pid_t, int);
|
||||
int pthread_kill(pthread_t, int);
|
||||
int pthread_sigmask(int, const sigset_t *, sigset_t *);
|
||||
int raise(int);
|
||||
int sigaction(int, const struct sigaction *, struct sigaction *);
|
||||
int sigaddset(sigset_t *, int);
|
||||
int sigaltstack(const stack_t *, stack_t *);
|
||||
int sigdelset(sigset_t *, int);
|
||||
int sigemptyset(sigset_t *);
|
||||
int sigfillset(sigset_t *);
|
||||
int sighold(int);
|
||||
int sigignore(int);
|
||||
int siginterrupt(int, int);
|
||||
int sigismember(const sigset_t *, int);
|
||||
void (*signal(int, void (*)(int)))(int);
|
||||
int sigpause(int);
|
||||
int sigpending(sigset_t *);
|
||||
int sigprocmask(int, const sigset_t *, sigset_t *);
|
||||
int sigqueue(pid_t, int, const union sigval);
|
||||
int sigrelse(int);
|
||||
void (*sigset(int, void (*)(int)))(int);
|
||||
int sigstack(struct sigstack *ss,
|
||||
struct sigstack *oss); /* LEGACY */
|
||||
int sigsuspend(const sigset_t *);
|
||||
int sigtimedwait(const sigset_t *, siginfo_t *,
|
||||
const struct timespec *);
|
||||
int sigwait(const sigset_t *set, int *sig);
|
||||
int sigwaitinfo(const sigset_t *, siginfo_t *);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SIGNAL_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
57
posix/include/stdarg.h
Normal file
57
posix/include/stdarg.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* $Id: stdarg.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* stdarg.h
|
||||
*
|
||||
* handle variable argument list. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __STDARG_H_INCLUDED__
|
||||
#define __STDARG_H_INCLUDED__
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
typedef char* va_list;
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
/* taken from mingw's stdarg.h */
|
||||
|
||||
/* Amount of space required in an argument list (ie. the stack) for an
|
||||
argument of type t. */
|
||||
#define __va_argsiz(t) \
|
||||
(((sizeof(t) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
|
||||
|
||||
#define va_start(ap, pN) \
|
||||
((ap) = ((va_list) (&pN) + __va_argsiz(pN)))
|
||||
|
||||
#define va_end(ap) ((void)0)
|
||||
|
||||
#define va_arg(ap, t) \
|
||||
(((ap) = (ap) + __va_argsiz(t)), \
|
||||
*((t*) (void*) ((ap) - __va_argsiz(t))))
|
||||
|
||||
#endif /* __STDARG_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
50
posix/include/stddef.h
Normal file
50
posix/include/stddef.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/* $Id: stddef.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* stddef.h
|
||||
*
|
||||
* standard type definitions. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __STDDEF_H_INCLUDED__
|
||||
#define __STDDEF_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <sys/types.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
typedef signed long int ptrdiff_t;
|
||||
typedef unsigned short int wchar_t;
|
||||
|
||||
/* CONSTANTS */
|
||||
#ifndef NULL
|
||||
#define NULL ((void *)(0)) /* Null pointer constant. */
|
||||
#endif
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
#define offsetof(t,m) ((size_t) &((t *)0)->m)
|
||||
|
||||
#endif /* __STDDEF_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
165
posix/include/stdio.h
Normal file
165
posix/include/stdio.h
Normal file
@@ -0,0 +1,165 @@
|
||||
/* $Id: stdio.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* stdio.h
|
||||
*
|
||||
* standard buffered input/output. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __STDIO_H_INCLUDED__
|
||||
#define __STDIO_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* OBJECTS */
|
||||
extern char *optarg;
|
||||
extern int opterr;
|
||||
extern int optind; /* LEGACY */
|
||||
extern int optopt;
|
||||
|
||||
/* TYPES */
|
||||
typedef struct __tagFILE
|
||||
{
|
||||
int _dummy;
|
||||
} FILE;
|
||||
|
||||
typedef struct __tagfpos_t
|
||||
{
|
||||
int _dummy;
|
||||
} fpos_t;
|
||||
|
||||
|
||||
/* CONSTANTS */
|
||||
/* Size of <stdio.h> buffers. */
|
||||
#define BUFSIZ (0x10000)
|
||||
|
||||
/* Maximum size in bytes of the longest filename string that the implementation
|
||||
guarantees can be opened. */
|
||||
#define FILENAME_MAX (255)
|
||||
|
||||
/* Number of streams which the implementation guarantees can be open
|
||||
simultaneously. The value will be at least eight. */
|
||||
#define FOPEN_MAX (8)
|
||||
|
||||
/* Input/output fully buffered. */
|
||||
#define _IOFBF (1)
|
||||
/* Input/output line buffered. */
|
||||
#define _IOLBF (2)
|
||||
/* Input/output unbuffered. */
|
||||
#define _IONBF (3)
|
||||
|
||||
/* Maximum size of character array to hold ctermid() output. */
|
||||
#define L_ctermid (255)
|
||||
/* Maximum size of character array to hold cuserid() output. (LEGACY) */
|
||||
#define L_cuserid (255)
|
||||
/* Maximum size of character array to hold tmpnam() output. */
|
||||
#define L_tmpnam (255)
|
||||
|
||||
/* Minimum number of unique filenames generated by tmpnam(). Maximum number
|
||||
of times an application can call tmpnam() reliably. The value of TMP_MAX
|
||||
will be at least 10,000. */
|
||||
#define TMP_MAX (0xFFFF)
|
||||
|
||||
/* End-of-file return value. */
|
||||
#define EOF (-1)
|
||||
|
||||
/* default directory prefix for tempnam() */
|
||||
#define P_tmpdir "/tmp/"
|
||||
|
||||
/* Standard error output stream. */
|
||||
#define stderr ((FILE *)STDERR_FILENO)
|
||||
/* Standard input stream. */
|
||||
#define stdin ((FILE *)STDIN_FILENO)
|
||||
/* Standard output stream. */
|
||||
#define stdout ((FILE *)STDOUT_FILENO)
|
||||
|
||||
/* PROTOTYPES */
|
||||
void clearerr(FILE *);
|
||||
char *ctermid(char *);
|
||||
char *cuserid(char *); /* LEGACY */
|
||||
int fclose(FILE *);
|
||||
FILE *fdopen(int, const char *);
|
||||
int feof(FILE *);
|
||||
int ferror(FILE *);
|
||||
int fflush(FILE *);
|
||||
int fgetc(FILE *);
|
||||
int fgetpos(FILE *, fpos_t *);
|
||||
char *fgets(char *, int, FILE *);
|
||||
int fileno(FILE *);
|
||||
void flockfile(FILE *);
|
||||
FILE *fopen(const char *, const char *);
|
||||
int fprintf(FILE *, const char *, ...);
|
||||
int fputc(int, FILE *);
|
||||
int fputs(const char *, FILE *);
|
||||
size_t fread(void *, size_t, size_t, FILE *);
|
||||
FILE *freopen(const char *, const char *, FILE *);
|
||||
int fscanf(FILE *, const char *, ...);
|
||||
int fseek(FILE *, long int, int);
|
||||
int fseeko(FILE *, off_t, int);
|
||||
int fsetpos(FILE *, const fpos_t *);
|
||||
long int ftell(FILE *);
|
||||
off_t ftello(FILE *);
|
||||
int ftrylockfile(FILE *);
|
||||
void funlockfile(FILE *);
|
||||
size_t fwrite(const void *, size_t, size_t, FILE *);
|
||||
int getc(FILE *);
|
||||
int getchar(void);
|
||||
int getc_unlocked(FILE *);
|
||||
int getchar_unlocked(void);
|
||||
int getopt(int, char * const[], const char *); /* LEGACY */
|
||||
char *gets(char *);
|
||||
int getw(FILE *);
|
||||
int pclose(FILE *);
|
||||
void perror(const char *);
|
||||
FILE *popen(const char *, const char *);
|
||||
int printf(const char *, ...);
|
||||
int putc(int, FILE *);
|
||||
int putchar(int);
|
||||
int putc_unlocked(int, FILE *);
|
||||
int putchar_unlocked(int);
|
||||
int puts(const char *);
|
||||
int putw(int, FILE *);
|
||||
int remove(const char *);
|
||||
int rename(const char *, const char *);
|
||||
void rewind(FILE *);
|
||||
int scanf(const char *, ...);
|
||||
void setbuf(FILE *, char *);
|
||||
int setvbuf(FILE *, char *, int, size_t);
|
||||
int snprintf(char *, size_t, const char *, ...);
|
||||
int sprintf(char *, const char *, ...);
|
||||
int sscanf(const char *, const char *, int, ...);
|
||||
char *tempnam(const char *, const char *);
|
||||
FILE *tmpfile(void);
|
||||
char *tmpnam(char *);
|
||||
int ungetc(int, FILE *);
|
||||
int vfprintf(FILE *, const char *, va_list);
|
||||
int vprintf(const char *, va_list);
|
||||
int vsnprintf(char *, size_t, const char *, va_list);
|
||||
int vsprintf(char *, const char *, va_list);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __STDIO_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
130
posix/include/stdlib.h
Normal file
130
posix/include/stdlib.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/* $Id: stdlib.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* stdlib.h
|
||||
*
|
||||
* standard library definitions. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __STDLIB_H_INCLUDED__
|
||||
#define __STDLIB_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <stddef.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
typedef struct __tagdiv_t
|
||||
{
|
||||
int quot; /* quotient */
|
||||
int rem; /* remainder */
|
||||
} div_t;
|
||||
|
||||
typedef struct __tagldiv_t
|
||||
{
|
||||
long int quot; /* quotient */
|
||||
long int rem; /* remainder */
|
||||
} ldiv_t;
|
||||
|
||||
/* CONSTANTS */
|
||||
#define EXIT_FAILURE (-1) /* Unsuccessful termination for exit(), evaluates \
|
||||
to a non-zero value. */
|
||||
#define EXIT_SUCCESS (0) /* Successful termination for exit(), evaluates to 0. */
|
||||
|
||||
/* FIXME */
|
||||
#define RAND_MAX (32767) /* Maximum value returned by rand(), at least 32,767. */
|
||||
|
||||
/* FIXME */
|
||||
#define MB_CUR_MAX (1) /* Integer expression whose value is the maximum number \
|
||||
of bytes in a character specified by the current \
|
||||
locale. */
|
||||
|
||||
/* PROTOTYPES */
|
||||
long a64l(const char *);
|
||||
void abort(void);
|
||||
int abs(int);
|
||||
int atexit(void (*)(void));
|
||||
double atof(const char *);
|
||||
int atoi(const char *);
|
||||
long int atol(const char *);
|
||||
void *bsearch(const void *, const void *, size_t, size_t,
|
||||
int (*)(const void *, const void *));
|
||||
void *calloc(size_t, size_t);
|
||||
div_t div(int, int);
|
||||
double drand48(void);
|
||||
char *ecvt(double, int, int *, int *);
|
||||
double erand48(unsigned short int[3]);
|
||||
void exit(int);
|
||||
char *fcvt (double, int, int *, int *);
|
||||
void free(void *);
|
||||
char *gcvt(double, int, char *);
|
||||
char *getenv(const char *);
|
||||
int getsubopt(char **, char *const *, char **);
|
||||
int grantpt(int);
|
||||
char *initstate(unsigned int, char *, size_t);
|
||||
long int jrand48(unsigned short int[3]);
|
||||
char *l64a(long);
|
||||
long int labs(long int);
|
||||
void lcong48(unsigned short int[7]);
|
||||
ldiv_t ldiv(long int, long int);
|
||||
long int lrand48(void);
|
||||
void *malloc(size_t);
|
||||
int mblen(const char *, size_t);
|
||||
size_t mbstowcs(wchar_t *, const char *, size_t);
|
||||
int mbtowc(wchar_t *, const char *, size_t);
|
||||
char *mktemp(char *);
|
||||
int mkstemp(char *);
|
||||
long int mrand48(void);
|
||||
long int nrand48(unsigned short int [3]);
|
||||
char *ptsname(int);
|
||||
int putenv(char *);
|
||||
void qsort(void *, size_t, size_t, int (*)(const void *,
|
||||
const void *));
|
||||
int rand(void);
|
||||
int rand_r(unsigned int *);
|
||||
long random(void);
|
||||
void *realloc(void *, size_t);
|
||||
char *realpath(const char *, char *);
|
||||
unsigned short int seed48(unsigned short int[3]);
|
||||
void setkey(const char *);
|
||||
char *setstate(const char *);
|
||||
void srand(unsigned int);
|
||||
void srand48(long int);
|
||||
void srandom(unsigned);
|
||||
double strtod(const char *, char **);
|
||||
long int strtol(const char *, char **, int);
|
||||
unsigned long int
|
||||
strtoul(const char *, char **, int);
|
||||
int system(const char *);
|
||||
int ttyslot(void); /* LEGACY */
|
||||
int unlockpt(int);
|
||||
void *valloc(size_t); /* LEGACY */
|
||||
size_t wcstombs(char *, const wchar_t *, size_t);
|
||||
int wctomb(char *, wchar_t);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __STDLIB_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
69
posix/include/string.h
Normal file
69
posix/include/string.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/* $Id: string.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* string.h
|
||||
*
|
||||
* string operations. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __STRING_H_INCLUDED__ /* replace with the appropriate tag */
|
||||
#define __STRING_H_INCLUDED__ /* replace with the appropriate tag */
|
||||
|
||||
/* INCLUDES */
|
||||
#include <stddef.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
void *memccpy(void *, const void *, int, size_t);
|
||||
void *memchr(const void *, int, size_t);
|
||||
int memcmp(const void *, const void *, size_t);
|
||||
void *memcpy(void *, const void *, size_t);
|
||||
void *memmove(void *, const void *, size_t);
|
||||
void *memset(void *, int, size_t);
|
||||
char *strcat(char *, const char *);
|
||||
char *strchr(const char *, int);
|
||||
int strcmp(const char *, const char *);
|
||||
int strcoll(const char *, const char *);
|
||||
char *strcpy(char *, const char *);
|
||||
size_t strcspn(const char *, const char *);
|
||||
char *strdup(const char *);
|
||||
char *strerror(int);
|
||||
size_t strlen(const char *);
|
||||
char *strncat(char *, const char *, size_t);
|
||||
int strncmp(const char *, const char *, size_t);
|
||||
char *strncpy(char *, const char *, size_t);
|
||||
char *strpbrk(const char *, const char *);
|
||||
char *strrchr(const char *, int);
|
||||
size_t strspn(const char *, const char *);
|
||||
char *strstr(const char *, const char *);
|
||||
char *strtok(char *, const char *);
|
||||
char *strtok_r(char *, const char *, char **);
|
||||
size_t strxfrm(char *, const char *, size_t);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __STRING_H_INCLUDED__ */ /* replace with the appropriate tag */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/ipc.h
Normal file
43
posix/include/sys/ipc.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: ipc.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/ipc.h
|
||||
*
|
||||
* interprocess communication access structure. Conforming to the Single
|
||||
* UNIX(r) Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_IPC_H_INCLUDED__
|
||||
#define __SYS_IPC_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_IPC_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/mman.h
Normal file
43
posix/include/sys/mman.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: mman.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/mman.h
|
||||
*
|
||||
* memory management declarations. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_SOCKET_H_INCLUDED__
|
||||
#define __SYS_SOCKET_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_SOCKET_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/msg.h
Normal file
43
posix/include/sys/msg.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: msg.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/msg.h
|
||||
*
|
||||
* message queue structures. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_SOCKET_H_INCLUDED__
|
||||
#define __SYS_SOCKET_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_SOCKET_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/resource.h
Normal file
43
posix/include/sys/resource.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: resource.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/resource.h
|
||||
*
|
||||
* definitions for XSI resource operations. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_RESOURCE_H_INCLUDED__
|
||||
#define __SYS_RESOURCE_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_RESOURCE_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/sem.h
Normal file
43
posix/include/sys/sem.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: sem.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/sem.h
|
||||
*
|
||||
* semaphore facility. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_SEM_H_INCLUDED__
|
||||
#define __SYS_SEM_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_SEM_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/shm.h
Normal file
43
posix/include/sys/shm.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: shm.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/shm.h
|
||||
*
|
||||
* shared memory facility. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_SHM_H_INCLUDED__
|
||||
#define __SYS_SHM_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_SHM_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/socket.h
Normal file
43
posix/include/sys/socket.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: socket.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/socket.h
|
||||
*
|
||||
* Internet Protocol family. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_SOCKET_H_INCLUDED__
|
||||
#define __SYS_SOCKET_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_SOCKET_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
122
posix/include/sys/stat.h
Normal file
122
posix/include/sys/stat.h
Normal file
@@ -0,0 +1,122 @@
|
||||
/* $Id: stat.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/stat.h
|
||||
*
|
||||
* data returned by the stat() function. Conforming to the Single
|
||||
* UNIX(r) Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_STAT_H_INCLUDED__
|
||||
#define __SYS_STAT_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <sys/types.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
struct stat
|
||||
{
|
||||
dev_t st_dev; /* ID of device containing file */
|
||||
ino_t st_ino; /* file serial number */
|
||||
mode_t st_mode; /* mode of file (see below) */
|
||||
nlink_t st_nlink; /* number of links to the file */
|
||||
uid_t st_uid; /* user ID of file */
|
||||
gid_t st_gid; /* group ID of file */
|
||||
dev_t st_rdev; /* device ID (if file is character or block special) */
|
||||
off_t st_size; /* file size in bytes (if file is a regular file) */
|
||||
time_t st_atime; /* time of last access */
|
||||
time_t st_mtime; /* time of last data modification */
|
||||
time_t st_ctime; /* time of last status change */
|
||||
blksize_t st_blksize; /* a filesystem-specific preferred I/O block size for
|
||||
this object. In some filesystem types, this may
|
||||
vary from file to file */
|
||||
blkcnt_t st_blocks; /* number of blocks allocated for this object */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
/*
|
||||
file type
|
||||
*/
|
||||
#define S_IFBLK (1) /* block special */
|
||||
#define S_IFCHR (2) /* character special */
|
||||
#define S_IFIFO (3) /* FIFO special */
|
||||
#define S_IFREG (4) /* regular */
|
||||
#define S_IFDIR (5) /* directory */
|
||||
#define S_IFLNK (6) /* symbolic link */
|
||||
|
||||
/* type of file */
|
||||
#define S_IFMT (S_IFBLK | S_IFCHR | S_IFIFO | S_IFREG | S_IFDIR | S_IFLNK)
|
||||
|
||||
/*
|
||||
file mode bits
|
||||
*/
|
||||
#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) /* read, write, execute/search by owner */
|
||||
#define S_IRUSR (0x00000001) /* read permission, owner */
|
||||
#define S_IWUSR (0x00000002) /* write permission, owner */
|
||||
#define S_IXUSR (0x00000004) /* execute/search permission, owner */
|
||||
|
||||
#define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) /* read, write, execute/search by group */
|
||||
#define S_IRGRP (0x00000010) /* read permission, group */
|
||||
#define S_IWGRP (0x00000020) /* write permission, group */
|
||||
#define S_IXGRP (0x00000040) /* execute/search permission, group */
|
||||
|
||||
#define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) /* read, write, execute/search by others */
|
||||
#define S_IROTH (0x00000100) /* read permission, others */
|
||||
#define S_IWOTH (0x00000200) /* write permission, others */
|
||||
#define S_IXOTH (0x00000400) /* execute/search permission, others */
|
||||
|
||||
#define S_ISUID (0x00001000) /* set-user-ID on execution */
|
||||
#define S_ISGID (0x00002000) /* set-group-ID on execution */
|
||||
#define S_ISVTX (0x00004000) /* on directories, restricted deletion flag */
|
||||
|
||||
/*
|
||||
the following macros will test whether a file is of the specified type
|
||||
*/
|
||||
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
||||
|
||||
/* shared memory, semaphores and message queues are unlikely to be ever
|
||||
implemented as files */
|
||||
#define S_TYPEISMQ(buf) (0) /* Test for a message queue */
|
||||
#define S_TYPEISSEM(buf) (0) /* Test for a semaphore */
|
||||
#define S_TYPEISSHM(buf) (0) /* Test for a shared memory object */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int chmod(const char *, mode_t);
|
||||
int fchmod(int, mode_t);
|
||||
int fstat(int, struct stat *);
|
||||
int lstat(const char *, struct stat *);
|
||||
int mkdir(const char *, mode_t);
|
||||
int mkfifo(const char *, mode_t);
|
||||
int mknod(const char *, mode_t, dev_t);
|
||||
int stat(const char *, struct stat *);
|
||||
mode_t umask(mode_t);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_STAT_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/statvfs.h
Normal file
43
posix/include/sys/statvfs.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: statvfs.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/statvfs.h
|
||||
*
|
||||
* VFS Filesystem information structure. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_STATVFS_H_INCLUDED__
|
||||
#define __SYS_STATVFS_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_STATVFS_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/time.h
Normal file
43
posix/include/sys/time.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: time.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/time.h
|
||||
*
|
||||
* time types. Conforming to the Single UNIX(r) Specification Version 2,
|
||||
* System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_TIME_H_INCLUDED__
|
||||
#define __SYS_TIME_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_TIME_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/timeb.h
Normal file
43
posix/include/sys/timeb.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: timeb.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/timeb.h
|
||||
*
|
||||
* additional definitions for date and time. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_TIMEB_H_INCLUDED__
|
||||
#define __SYS_TIMEB_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_TIMEB_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/times.h
Normal file
43
posix/include/sys/times.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: times.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/times.h
|
||||
*
|
||||
* file access and modification times structure. Conforming to the Single
|
||||
* UNIX(r) Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_TIMES_H_INCLUDED__
|
||||
#define __SYS_TIMES_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_TIMES_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
83
posix/include/sys/types.h
Normal file
83
posix/include/sys/types.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/* $Id: types.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/types.h
|
||||
*
|
||||
* data types. Conforming to the Single UNIX(r) Specification Version 2,
|
||||
* System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_TYPES_H_INCLUDED__
|
||||
#define __SYS_TYPES_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <inttypes.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
/* FIXME: all these types need to be checked */
|
||||
typedef unsigned long int blkcnt_t; /* Used for file block counts */
|
||||
typedef unsigned long int blksize_t; /* Used for block sizes */
|
||||
typedef long long clock_t; /* Used for system times in clock ticks or CLOCKS_PER_SEC */
|
||||
typedef int clockid_t; /* Used for clock ID type in the clock and timer functions. */
|
||||
typedef int dev_t; /* Used for device IDs. */
|
||||
typedef long long fsblkcnt_t; /* Used for file system block counts */
|
||||
typedef long long fsfilcnt_t; /* Used for file system file counts */
|
||||
typedef int gid_t; /* Used for group IDs. */
|
||||
typedef int id_t; /* Used as a general identifier; can be used to contain at least a
|
||||
pid_t, uid_t or a gid_t. */
|
||||
typedef uint64_t ino_t; /* Used for file serial numbers. */
|
||||
typedef int key_t; /* Used for interprocess communication. */
|
||||
typedef int mode_t; /* Used for some file attributes. */
|
||||
typedef int nlink_t; /* Used for link counts. */
|
||||
typedef int64_t off_t; /* Used for file sizes. */
|
||||
typedef unsigned long int pid_t; /* Used for process IDs and process group IDs. */
|
||||
|
||||
/* pthread types */
|
||||
typedef void * pthread_cond_t; /* Used for condition variables. */
|
||||
typedef void * pthread_condattr_t; /* Used to identify a condition attribute object. */
|
||||
typedef void * pthread_key_t; /* Used for thread-specific data keys. */
|
||||
typedef void * pthread_attr_t; /* Used to identify a thread attribute object. */
|
||||
|
||||
typedef void * pthread_mutex_t;
|
||||
typedef void * pthread_mutexattr_t;
|
||||
|
||||
typedef void * pthread_once_t; /* Used for dynamic package initialisation. */
|
||||
typedef void * pthread_rwlock_t; /* Used for read-write locks. */
|
||||
typedef void * pthread_rwlockattr_t; /* Used for read-write lock attributes. */
|
||||
typedef unsigned long int pthread_t; /* Used to identify a thread. */
|
||||
|
||||
typedef unsigned long int size_t; /* Used for sizes of objects. */
|
||||
typedef long int ssize_t; /* Used for a count of bytes or an error indication. */
|
||||
typedef long long suseconds_t; /* Used for time in microseconds */
|
||||
typedef unsigned long int time_t; /* Used for time in seconds. */
|
||||
typedef void * timer_t; /* Used for timer ID returned by timer_create(). */
|
||||
typedef int uid_t; /* Used for user IDs. */
|
||||
typedef unsigned long long useconds_t; /* Used for time in microseconds. */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_TYPES_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/uio.h
Normal file
43
posix/include/sys/uio.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: uio.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/uio.h
|
||||
*
|
||||
* definitions for vector I/O operations. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_UIO_H_INCLUDED__
|
||||
#define __SYS_UIO_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_UIO_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/un.h
Normal file
43
posix/include/sys/un.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: un.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/un.h
|
||||
*
|
||||
* declarations for definitions for UNIX-domain sockets. Conforming to the
|
||||
* Single UNIX(r) Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_UN_H_INCLUDED__
|
||||
#define __SYS_UN_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_UN_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
54
posix/include/sys/utsname.h
Normal file
54
posix/include/sys/utsname.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/* $Id: utsname.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/utsname.h
|
||||
*
|
||||
* system name structure. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_UTSNAME_H_INCLUDED__
|
||||
#define __SYS_UTSNAME_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
struct utsname
|
||||
{
|
||||
char sysname[255]; /* name of this implementation of the operating system */
|
||||
char nodename[255]; /* name of this node within an implementation-dependent
|
||||
communications network */
|
||||
char release[255]; /* current release level of this implementation */
|
||||
char version[255]; /* current version level of this release */
|
||||
char machine[255]; /* name of the hardware type on which the system is
|
||||
running */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int uname(struct utsname *);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_UTSNAME_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
43
posix/include/sys/wait.h
Normal file
43
posix/include/sys/wait.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* $Id: wait.h,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* sys/wait.h
|
||||
*
|
||||
* declarations for waiting. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __SYS_WAIT_H_INCLUDED__
|
||||
#define __SYS_WAIT_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __SYS_WAIT_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
114
posix/include/time.h
Normal file
114
posix/include/time.h
Normal file
@@ -0,0 +1,114 @@
|
||||
/* $Id: time.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* time.h
|
||||
*
|
||||
* time types. Conforming to the Single UNIX(r) Specification Version 2,
|
||||
* System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __TIME_H_INCLUDED__
|
||||
#define __TIME_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* OBJECTS */
|
||||
//extern static int getdate_err; /* FIXME */
|
||||
extern int daylight;
|
||||
extern long int timezone;
|
||||
extern char *tzname[];
|
||||
|
||||
/* TYPES */
|
||||
/* pre-declaration of signal.h types to suppress warnings caused by circular
|
||||
dependencies */
|
||||
struct sigevent;
|
||||
|
||||
struct tm
|
||||
{
|
||||
int tm_sec; /* seconds [0,61] */
|
||||
int tm_min; /* minutes [0,59] */
|
||||
int tm_hour; /* hour [0,23] */
|
||||
int tm_mday; /* day of month [1,31] */
|
||||
int tm_mon; /* month of year [0,11] */
|
||||
int tm_year; /* years since 1900 */
|
||||
int tm_wday; /* day of week [0,6] (Sunday = 0) */
|
||||
int tm_yday; /* day of year [0,365] */
|
||||
int tm_isdst; /* daylight savings flag */
|
||||
};
|
||||
|
||||
struct timespec
|
||||
{
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_nsec; /* nanoseconds */
|
||||
};
|
||||
|
||||
struct itimerspec
|
||||
{
|
||||
struct timespec it_interval; /* timer period */
|
||||
struct timespec it_value; /* timer expiration */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
/* FIXME: all the constants are wrong */
|
||||
/* Number of clock ticks per second returned by the times() function (LEGACY). */
|
||||
#define CLK_TCK (1)
|
||||
/* A number used to convert the value returned by the clock() function into
|
||||
seconds. */
|
||||
#define CLOCKS_PER_SEC (1)
|
||||
/* The identifier of the systemwide realtime clock. */
|
||||
#define CLOCK_REALTIME (0)
|
||||
/* Flag indicating time is absolute with respect to the clock associated with a
|
||||
timer. */
|
||||
#define TIMER_ABSTIME (1)
|
||||
|
||||
/* PROTOTYPES */
|
||||
char *asctime(const struct tm *);
|
||||
char *asctime_r(const struct tm *, char *);
|
||||
clock_t clock(void);
|
||||
int clock_getres(clockid_t, struct timespec *);
|
||||
int clock_gettime(clockid_t, struct timespec *);
|
||||
int clock_settime(clockid_t, const struct timespec *);
|
||||
char *ctime(const time_t *);
|
||||
char *ctime_r(const time_t *, char *);
|
||||
double difftime(time_t, time_t);
|
||||
struct tm *getdate(const char *);
|
||||
struct tm *gmtime(const time_t *);
|
||||
struct tm *gmtime_r(const time_t *, struct tm *);
|
||||
struct tm *localtime(const time_t *);
|
||||
struct tm *localtime_r(const time_t *, struct tm *);
|
||||
time_t mktime(struct tm *);
|
||||
int nanosleep(const struct timespec *, struct timespec *);
|
||||
size_t strftime(char *, size_t, const char *, const struct tm *);
|
||||
char *strptime(const char *, const char *, struct tm *);
|
||||
time_t time(time_t *);
|
||||
int timer_create(clockid_t, struct sigevent *, timer_t *);
|
||||
int timer_delete(timer_t);
|
||||
int timer_gettime(timer_t, struct itimerspec *);
|
||||
int timer_getoverrun(timer_t);
|
||||
int timer_settime(timer_t, int, const struct itimerspec *,
|
||||
struct itimerspec *);
|
||||
void tzset(void);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __TIME_H_INCLUDED__ */ /* replace with the appropriate tag */
|
||||
|
||||
/* EOF */
|
||||
|
62
posix/include/ucontext.h
Normal file
62
posix/include/ucontext.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* $Id: ucontext.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* ucontext.h
|
||||
*
|
||||
* user context. Conforming to the Single UNIX(r) Specification Version 2,
|
||||
* System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __UCONTEXT_H_INCLUDED__
|
||||
#define __UCONTEXT_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <signal.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
typedef void * mcontext_t;
|
||||
|
||||
typedef struct __tagucontext_t ucontext_t;
|
||||
|
||||
struct __tagucontext_t
|
||||
{
|
||||
ucontext_t *uc_link; /* pointer to the context that will be resumed
|
||||
when this context returns */
|
||||
sigset_t uc_sigmask; /* the set of signals that are blocked when this
|
||||
context is active */
|
||||
stack_t uc_stack; /* the stack used by this context */
|
||||
mcontext_t uc_mcontext; /* a machine-specific representation of the saved
|
||||
context */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int getcontext(ucontext_t *);
|
||||
int setcontext(const ucontext_t *);
|
||||
void makecontext(ucontext_t *, (void *)(), int, ...);
|
||||
int swapcontext(ucontext_t *, const ucontext_t *);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __UCONTEXT_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
492
posix/include/unistd.h
Normal file
492
posix/include/unistd.h
Normal file
@@ -0,0 +1,492 @@
|
||||
/* $Id: unistd.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* unistd.h
|
||||
*
|
||||
* standard symbolic constants and types. Conforming to the Single UNIX(r)
|
||||
* Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __UNISTD_H_INCLUDED__
|
||||
#define __UNISTD_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
/* OBJECTS */
|
||||
extern char *optarg;
|
||||
extern int optind, opterr, optopt;
|
||||
|
||||
/* TYPES */
|
||||
|
||||
/* CONSTANTS */
|
||||
/* FIXME: set these constants appropriately */
|
||||
/* Integer value indicating version of the ISO<53>POSIX-1 standard (C
|
||||
language binding). */
|
||||
#define _POSIX_VERSION (0)
|
||||
|
||||
/* Integer value indicating version of the ISO POSIX-2 standard
|
||||
(Commands). */
|
||||
#define _POSIX2_VERSION (0)
|
||||
|
||||
/* Integer value indicating version of the ISO POSIX-2 standard (C
|
||||
language binding). */
|
||||
#define _POSIX2_C_VERSION (0)
|
||||
|
||||
/* Integer value indicating version of the X/Open Portability Guide to
|
||||
which the implementation conforms. */
|
||||
#define _XOPEN_VERSION (500)
|
||||
|
||||
/* The version of the XCU specification to which the implementation
|
||||
conforms */
|
||||
/* TODO: set to an appropriate value when commands and utilities will
|
||||
be available */
|
||||
#define _XOPEN_XCU_VERSION (-1)
|
||||
|
||||
#if _XOPEN_XCU_VERSION != -1
|
||||
#error TODO: define these constants
|
||||
#define _POSIX2_C_BIND
|
||||
#define _POSIX2_C_VERSION
|
||||
#define _POSIX2_CHAR_TERM
|
||||
#define _POSIX2_LOCALEDEF
|
||||
#define _POSIX2_UPE
|
||||
#define _POSIX2_VERSION
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* TODO: check for conformance to the following specs */
|
||||
#define _XOPEN_XPG2
|
||||
#define _XOPEN_XPG3
|
||||
#define _XOPEN_XPG4
|
||||
#define _XOPEN_UNIX
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* TODO: don't forget these features */
|
||||
/* The use of chown() is restricted to a process with appropriate
|
||||
privileges, and to changing the group ID of a file only to the
|
||||
effective group ID of the process or to one of its supplementary
|
||||
group IDs. */
|
||||
#define _POSIX_CHOWN_RESTRICTED
|
||||
|
||||
/* Terminal special characters defined in <termios.h> can be disabled
|
||||
using this character value. */
|
||||
#define _POSIX_VDISABLE
|
||||
|
||||
/* Each process has a saved set-user-ID and a saved set-group-ID. */
|
||||
#define _POSIX_SAVED_IDS
|
||||
|
||||
/* Implementation supports job control. */
|
||||
#define _POSIX_JOB_CONTROL
|
||||
|
||||
#endif
|
||||
|
||||
/* Pathname components longer than {NAME_MAX} generate an error. */
|
||||
#define _POSIX_NO_TRUNC (1)
|
||||
|
||||
/* The implementation supports the threads option. */
|
||||
#define _POSIX_THREADS (1)
|
||||
|
||||
/* FIXME: none of the following is strictly true yet */
|
||||
/* The implementation supports the thread stack address attribute
|
||||
option. */ /* FIXME: not currently implemented. Should be trivial */
|
||||
#define _POSIX_THREAD_ATTR_STACKADDR (1)
|
||||
|
||||
/* The implementation supports the thread stack size attribute
|
||||
option. */ /* FIXME: not currently implemented. Should be trivial */
|
||||
#define _POSIX_THREAD_ATTR_STACKSIZE (1)
|
||||
|
||||
/* The implementation supports the process-shared synchronisation
|
||||
option. */ /* FIXME? not sure */
|
||||
#define _POSIX_THREAD_PROCESS_SHARED (1)
|
||||
|
||||
/* The implementation supports the thread-safe functions option. */
|
||||
/* FIXME: fix errno (currently not thread-safe) */
|
||||
#define _POSIX_THREAD_SAFE_FUNCTIONS (1)
|
||||
|
||||
/*
|
||||
<20>Constants for Options and Feature Groups
|
||||
*/
|
||||
|
||||
/* Implementation supports the C Language Binding option. This will
|
||||
always have a value other than -1. */
|
||||
#define _POSIX2_C_BIND (1)
|
||||
|
||||
/* Implementation supports the C Language Development Utilities
|
||||
option. */ /* FIXME: please change this when C compiler and
|
||||
utilities are ported */
|
||||
#define _POSIX2_C_DEV (-1)
|
||||
|
||||
/* Implementation supports at least one terminal type. */ /* FIXME:
|
||||
please change this when terminal emulation is complete */
|
||||
#define _POSIX2_CHAR_TERM (-1)
|
||||
|
||||
/* Implementation supports the FORTRAN Development Utilities option. */
|
||||
/* FIXME: please change this when Fortran compiler and utilities are
|
||||
ported */
|
||||
#define _POSIX2_FORT_DEV (-1)
|
||||
|
||||
/* Implementation supports the FORTRAN Run-time Utilities option. */
|
||||
/* FIXME: please change this when Fortran runtimes are ported */
|
||||
#define _POSIX2_FORT_RUN (-1)
|
||||
|
||||
/* Implementation supports the creation of locales by the localedef
|
||||
utility. */ /* FIXME: please change this when locales are ready */
|
||||
#define _POSIX2_LOCALEDEF (-1)
|
||||
|
||||
/* Implementation supports the Software Development Utilities option. */
|
||||
/* FIXME? */
|
||||
#define _POSIX2_SW_DEV (-1)
|
||||
|
||||
/* The implementation supports the User Portability Utilities option. */
|
||||
/* FIXME? */
|
||||
#define _POSIX2_UPE (-1)
|
||||
|
||||
/* The implementation supports the X/Open Encryption Feature Group. */
|
||||
/* FIXME: please change this when encryption is ready */
|
||||
#define _XOPEN_CRYPT (-1)
|
||||
|
||||
/* The implementation supports the Issue 4, Version 2 Enhanced
|
||||
Internationalisation Feature Group. This is always set to a value
|
||||
other than -1. */ /* TODO: high priority. Support for this feature is
|
||||
needed for a conforming implementation */
|
||||
#define _XOPEN_ENH_I18N (-1)
|
||||
|
||||
/* The implementation supports the Legacy Feature Group. */
|
||||
#define _XOPEN_LEGACY (1)
|
||||
|
||||
/* The implementation supports the X/Open Realtime Feature Group. */
|
||||
/* FIXME? unlikely to be ever supported */
|
||||
#define _XOPEN_REALTIME (-1)
|
||||
|
||||
/* The implementation supports the X/Open Realtime Threads Feature
|
||||
Group. */ /* FIXME? really unlikely to be ever supported */
|
||||
#define _XOPEN_REALTIME_THREADS (-1)
|
||||
|
||||
/* The implementation supports the Issue 4, Version 2 Shared Memory
|
||||
Feature Group. This is always set to a value other than -1. */ /* TODO:
|
||||
high priority. Support for this feature is needed for a conforming
|
||||
implementation */
|
||||
#define _XOPEN_SHM (-1)
|
||||
|
||||
/* Implementation provides a C-language compilation environment with
|
||||
32-bit int, long, pointer and off_t types. */
|
||||
#define _XBS5_ILP32_OFF32 (1)
|
||||
|
||||
/* Implementation provides a C-language compilation environment with
|
||||
32-bit int, long and pointer types and an off_t type using at
|
||||
least 64 bits. */ /* FIXME? check the off_t type */
|
||||
#define _XBS5_ILP32_OFFBIG (1)
|
||||
|
||||
/* Implementation provides a C-language compilation environment with
|
||||
32-bit int and 64-bit long, pointer and off_t types. */ /* FIXME: on
|
||||
some architectures this may be true */
|
||||
#define _XBS5_LP64_OFF64 (-1)
|
||||
|
||||
/* Implementation provides a C-language compilation environment with
|
||||
an int type using at least 32 bits and long, pointer and off_t
|
||||
types using at least 64 bits. */ /* FIXME: on some architectures
|
||||
this may be true */
|
||||
#define _XBS5_LPBIG_OFFBIG (-1)
|
||||
|
||||
/* Implementation supports the File Synchronisation option. */
|
||||
/* TODO: high priority. Implement this */
|
||||
#define _POSIX_FSYNC
|
||||
|
||||
/* Implementation supports the Memory Mapped Files option. */
|
||||
/* TODO: high priority. Implement this */
|
||||
#define _POSIX_MAPPED_FILES
|
||||
|
||||
/* Implementation supports the Memory Protection option. */
|
||||
/* TODO: high priority. Implement this */
|
||||
#define _POSIX_MEMORY_PROTECTION
|
||||
|
||||
#if 0
|
||||
/* Implementation supports the Prioritized Input and Output option. */
|
||||
/* FIXME? unlikely to be ever supported */
|
||||
#define _POSIX_PRIORITIZED_IO
|
||||
#endif
|
||||
|
||||
/* FIXME: these should be implemented */
|
||||
/* Asynchronous input or output operations may be performed for the
|
||||
associated file. */
|
||||
#define _POSIX_ASYNC_IO (-1)
|
||||
|
||||
/* Prioritized input or output operations may be performed for the
|
||||
associated file. */
|
||||
#define _POSIX_PRIO_IO (-1)
|
||||
|
||||
/* Synchronised input or output operations may be performed for the
|
||||
associated file. */
|
||||
#define _POSIX_SYNC_IO (-1)
|
||||
|
||||
/*
|
||||
null pointer
|
||||
*/
|
||||
#ifndef NULL
|
||||
/* NULL seems to be defined pretty much everywhere - we prevent
|
||||
redefinition */
|
||||
#define NULL ((void *)(0))
|
||||
#endif
|
||||
|
||||
/*
|
||||
constants for the access() function
|
||||
*/
|
||||
|
||||
/* Test for read permission. */
|
||||
#define R_OK (0x00000001)
|
||||
/* Test for write permission. */
|
||||
#define W_OK (0x00000002)
|
||||
/* Test for execute (search) permission. */
|
||||
#define X_OK (0x00000004)
|
||||
/* Test for existence of file. */
|
||||
#define F_OK (0)
|
||||
|
||||
/*
|
||||
constants for the confstr() function
|
||||
*/
|
||||
#define _CS_PATH (1)
|
||||
#define _CS_XBS5_ILP32_OFF32_CFLAGS (2)
|
||||
#define _CS_XBS5_ILP32_OFF32_LDFLAGS (3)
|
||||
#define _CS_XBS5_ILP32_OFF32_LIBS (4)
|
||||
#define _CS_XBS5_ILP32_OFF32_LINTFLAGS (5)
|
||||
#define _CS_XBS5_ILP32_OFFBIG_CFLAGS (6)
|
||||
#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS (7)
|
||||
#define _CS_XBS5_ILP32_OFFBIG_LIBS (8)
|
||||
#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS (9)
|
||||
#define _CS_XBS5_LP64_OFF64_CFLAGS (10)
|
||||
#define _CS_XBS5_LP64_OFF64_LDFLAGS (11)
|
||||
#define _CS_XBS5_LP64_OFF64_LIBS (12)
|
||||
#define _CS_XBS5_LP64_OFF64_LINTFLAGS (13)
|
||||
#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS (14)
|
||||
#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS (15)
|
||||
#define _CS_XBS5_LPBIG_OFFBIG_LIBS (16)
|
||||
#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS (17)
|
||||
|
||||
/*
|
||||
constants for the lseek() and fcntl() functions
|
||||
*/
|
||||
|
||||
#define SEEK_SET (1) /* Set file offset to offset. */
|
||||
#define SEEK_CUR (2) /* Set file offset to current plus offset. */
|
||||
#define SEEK_END (3) /* Set file offset to EOF plus offset. */
|
||||
|
||||
/*
|
||||
constants for sysconf()
|
||||
*/
|
||||
#define _SC_2_C_BIND (1)
|
||||
#define _SC_2_C_DEV (2)
|
||||
#define _SC_2_C_VERSION (3)
|
||||
#define _SC_2_FORT_DEV (4)
|
||||
#define _SC_2_FORT_RUN (5)
|
||||
#define _SC_2_LOCALEDEF (6)
|
||||
#define _SC_2_SW_DEV (7)
|
||||
#define _SC_2_UPE (8)
|
||||
#define _SC_2_VERSION (9)
|
||||
#define _SC_ARG_MAX (10)
|
||||
#define _SC_AIO_LISTIO_MAX (11)
|
||||
#define _SC_AIO_MAX (12)
|
||||
#define _SC_AIO_PRIO_DELTA_MAX (13)
|
||||
#define _SC_ASYNCHRONOUS_IO (14)
|
||||
#define _SC_ATEXIT_MAX (15)
|
||||
#define _SC_BC_BASE_MAX (16)
|
||||
#define _SC_BC_DIM_MAX (17)
|
||||
#define _SC_BC_SCALE_MAX (18)
|
||||
#define _SC_BC_STRING_MAX (19)
|
||||
#define _SC_CHILD_MAX (20)
|
||||
#define _SC_CLK_TCK (21)
|
||||
#define _SC_COLL_WEIGHTS_MAX (22)
|
||||
#define _SC_DELAYTIMER_MAX (23)
|
||||
#define _SC_EXPR_NEST_MAX (24)
|
||||
#define _SC_FSYNC (25)
|
||||
#define _SC_GETGR_R_SIZE_MAX (26)
|
||||
#define _SC_GETPW_R_SIZE_MAX (27)
|
||||
#define _SC_IOV_MAX (28)
|
||||
#define _SC_JOB_CONTROL (29)
|
||||
#define _SC_LINE_MAX (30)
|
||||
#define _SC_LOGIN_NAME_MAX (31)
|
||||
#define _SC_MAPPED_FILES (32)
|
||||
#define _SC_MEMLOCK (33)
|
||||
#define _SC_MEMLOCK_RANGE (34)
|
||||
#define _SC_MEMORY_PROTECTION (35)
|
||||
#define _SC_MESSAGE_PASSING (36)
|
||||
#define _SC_MQ_OPEN_MAX (37)
|
||||
#define _SC_MQ_PRIO_MAX (38)
|
||||
#define _SC_NGROUPS_MAX (39)
|
||||
#define _SC_OPEN_MAX (40)
|
||||
#define _SC_PAGE_SIZE (41)
|
||||
#define _SC_PASS_MAX (42) /* LEGACY */
|
||||
#define _SC_PRIORITIZED_IO (43)
|
||||
#define _SC_PRIORITY_SCHEDULING (44)
|
||||
#define _SC_RE_DUP_MAX (45)
|
||||
#define _SC_REALTIME_SIGNALS (46)
|
||||
#define _SC_RTSIG_MAX (47)
|
||||
#define _SC_SAVED_IDS (48)
|
||||
#define _SC_SEMAPHORES (49)
|
||||
#define _SC_SEM_NSEMS_MAX (50)
|
||||
#define _SC_SEM_VALUE_MAX (51)
|
||||
#define _SC_SHARED_MEMORY_OBJECTS (52)
|
||||
#define _SC_SIGQUEUE_MAX (53)
|
||||
#define _SC_STREAM_MAX (54)
|
||||
#define _SC_SYNCHRONIZED_IO (55)
|
||||
#define _SC_THREADS (56)
|
||||
#define _SC_THREAD_ATTR_STACKADDR (57)
|
||||
#define _SC_THREAD_ATTR_STACKSIZE (58)
|
||||
#define _SC_THREAD_DESTRUCTOR_ITERATIONS (59)
|
||||
#define _SC_THREAD_KEYS_MAX (60)
|
||||
#define _SC_THREAD_PRIORITY_SCHEDULING (61)
|
||||
#define _SC_THREAD_PRIO_INHERIT (62)
|
||||
#define _SC_THREAD_PRIO_PROTECT (63)
|
||||
#define _SC_THREAD_PROCESS_SHARED (64)
|
||||
#define _SC_THREAD_SAFE_FUNCTIONS (65)
|
||||
#define _SC_THREAD_STACK_MIN (66)
|
||||
#define _SC_THREAD_THREADS_MAX (67)
|
||||
#define _SC_TIMERS (68)
|
||||
#define _SC_TIMER_MAX (69)
|
||||
#define _SC_TTY_NAME_MAX (70)
|
||||
#define _SC_TZNAME_MAX (71)
|
||||
#define _SC_VERSION (72)
|
||||
#define _SC_XOPEN_VERSION (73)
|
||||
#define _SC_XOPEN_CRYPT (74)
|
||||
#define _SC_XOPEN_ENH_I18N (75)
|
||||
#define _SC_XOPEN_SHM (76)
|
||||
#define _SC_XOPEN_UNIX (77)
|
||||
#define _SC_XOPEN_XCU_VERSION (78)
|
||||
#define _SC_XOPEN_LEGACY (79)
|
||||
#define _SC_XOPEN_REALTIME (80)
|
||||
#define _SC_XOPEN_REALTIME_THREADS (81)
|
||||
#define _SC_XBS5_ILP32_OFF32 (82)
|
||||
#define _SC_XBS5_ILP32_OFFBIG (83)
|
||||
#define _SC_XBS5_LP64_OFF64 (84)
|
||||
#define _SC_XBS5_LPBIG_OFFBIG (85)
|
||||
|
||||
#define _SC_PAGESIZE _SC_PAGE_SIZE
|
||||
|
||||
/* possible values for the function argument to the lockf() function */
|
||||
/* Lock a section for exclusive use. */
|
||||
#define F_LOCK (1)
|
||||
/* Unlock locked sections. */
|
||||
#define F_ULOCK (2)
|
||||
/* Test section for locks by other processes. */
|
||||
#define F_TEST (3)
|
||||
/* Test and lock a section for exclusive use. */
|
||||
#define F_TLOCK (4)
|
||||
|
||||
/* File number of stdin. It is 0. */
|
||||
#define STDIN_FILENO (0)
|
||||
/* File number of stdout. It is 1. */
|
||||
#define STDOUT_FILENO (1)
|
||||
/* File number of stderr. It is 2. */
|
||||
#define STDERR_FILENO (2)
|
||||
|
||||
/* PROTOTYPES */
|
||||
int access(const char *, int);
|
||||
unsigned int alarm(unsigned int);
|
||||
int brk(void *);
|
||||
int chdir(const char *);
|
||||
int chroot(const char *); /* LEGACY */
|
||||
int chown(const char *, uid_t, gid_t);
|
||||
int close(int);
|
||||
size_t confstr(int, char *, size_t);
|
||||
char *crypt(const char *, const char *);
|
||||
char *ctermid(char *);
|
||||
char *cuserid(char *s); /* LEGACY */
|
||||
int dup(int);
|
||||
int dup2(int, int);
|
||||
void encrypt(char[64], int);
|
||||
int execl(const char *, const char *, ...);
|
||||
int execle(const char *, const char *, ...);
|
||||
int execlp(const char *, const char *, ...);
|
||||
int execv(const char *, char *const []);
|
||||
int execve(const char *, char *const [], char *const []);
|
||||
int execvp(const char *, char *const []);
|
||||
void _exit(int);
|
||||
int fchown(int, uid_t, gid_t);
|
||||
int fchdir(int);
|
||||
int fdatasync(int);
|
||||
pid_t fork(void);
|
||||
long int fpathconf(int, int);
|
||||
int fsync(int);
|
||||
int ftruncate(int, off_t);
|
||||
char *getcwd(char *, size_t);
|
||||
int getdtablesize(void); /* LEGACY */
|
||||
gid_t getegid(void);
|
||||
uid_t geteuid(void);
|
||||
gid_t getgid(void);
|
||||
int getgroups(int, gid_t []);
|
||||
long gethostid(void);
|
||||
char *getlogin(void);
|
||||
int getlogin_r(char *, size_t);
|
||||
int getopt(int, char * const [], const char *);
|
||||
int getpagesize(void); /* LEGACY */
|
||||
char *getpass(const char *); /* LEGACY */
|
||||
pid_t getpgid(pid_t);
|
||||
pid_t getpgrp(void);
|
||||
pid_t getpid(void);
|
||||
pid_t getppid(void);
|
||||
pid_t getsid(pid_t);
|
||||
uid_t getuid(void);
|
||||
char *getwd(char *);
|
||||
int isatty(int);
|
||||
int lchown(const char *, uid_t, gid_t);
|
||||
int link(const char *, const char *);
|
||||
int lockf(int, int, off_t);
|
||||
off_t lseek(int, off_t, int);
|
||||
int nice(int);
|
||||
long int pathconf(const char *, int);
|
||||
int pause(void);
|
||||
int pipe(int [2]);
|
||||
ssize_t pread(int, void *, size_t, off_t);
|
||||
int pthread_atfork(void (*)(void), void (*)(void),
|
||||
void(*)(void));
|
||||
ssize_t pwrite(int, const void *, size_t, off_t);
|
||||
ssize_t read(int, void *, size_t);
|
||||
int readlink(const char *, char *, size_t);
|
||||
int rmdir(const char *);
|
||||
void *sbrk(intptr_t);
|
||||
int setgid(gid_t);
|
||||
int setpgid(pid_t, pid_t);
|
||||
pid_t setpgrp(void);
|
||||
int setregid(gid_t, gid_t);
|
||||
int setreuid(uid_t, uid_t);
|
||||
pid_t setsid(void);
|
||||
int setuid(uid_t);
|
||||
unsigned int sleep(unsigned int);
|
||||
void swab(const void *, void *, ssize_t);
|
||||
int symlink(const char *, const char *);
|
||||
void sync(void);
|
||||
long int sysconf(int);
|
||||
pid_t tcgetpgrp(int);
|
||||
int tcsetpgrp(int, pid_t);
|
||||
int truncate(const char *, off_t);
|
||||
char *ttyname(int);
|
||||
int ttyname_r(int, char *, size_t);
|
||||
useconds_t ualarm(useconds_t, useconds_t);
|
||||
int unlink(const char *);
|
||||
int usleep(useconds_t);
|
||||
pid_t vfork(void);
|
||||
ssize_t write(int, const void *, size_t);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __UNISTD_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
50
posix/include/utime.h
Normal file
50
posix/include/utime.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/* $Id: utime.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* utime.h
|
||||
*
|
||||
* access and modification times structure. Conforming to the Single
|
||||
* UNIX(r) Specification Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __UTIME_H_INCLUDED__
|
||||
#define __UTIME_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <sys/types.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
struct utimbuf
|
||||
{
|
||||
time_t actime; /* access time */
|
||||
time_t modtime; /* modification time */
|
||||
};
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
int utime(const char *, const struct utimbuf *);
|
||||
|
||||
/* MACROS */
|
||||
|
||||
#endif /* __UTIME_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
139
posix/include/wchar.h
Normal file
139
posix/include/wchar.h
Normal file
@@ -0,0 +1,139 @@
|
||||
/* $Id: wchar.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* wchar.h
|
||||
*
|
||||
* wide-character types. Conforming to the Single UNIX(r) Specification
|
||||
* Version 2, System Interface & Headers Issue 5
|
||||
*
|
||||
* This file is part of the ReactOS Operating System.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by KJK::Hyperion <noog@libero.it>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
#ifndef __WCHAR_H_INCLUDED__
|
||||
#define __WCHAR_H_INCLUDED__
|
||||
|
||||
/* INCLUDES */
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <time.h>
|
||||
|
||||
/* OBJECTS */
|
||||
|
||||
/* TYPES */
|
||||
typedef wchar_t wint_t; /* An integral type capable of storing any valid
|
||||
value of wchar_t, or WEOF */
|
||||
typedef long int wctype_t; /* A scalar type of a data object that can hold
|
||||
values which represent locale-specific
|
||||
character classification. */
|
||||
typedef void * mbstate_t; /* An object type other than an array type that
|
||||
can hold the conversion state information
|
||||
necessary to convert between sequences of
|
||||
(possibly multibyte) characters and
|
||||
wide-characters */
|
||||
|
||||
/* CONSTANTS */
|
||||
|
||||
/* PROTOTYPES */
|
||||
wint_t btowc(int);
|
||||
int fwprintf(FILE *, const wchar_t *, ...);
|
||||
int fwscanf(FILE *, const wchar_t *, ...);
|
||||
int iswalnum(wint_t);
|
||||
int iswalpha(wint_t);
|
||||
int iswcntrl(wint_t);
|
||||
int iswdigit(wint_t);
|
||||
int iswgraph(wint_t);
|
||||
int iswlower(wint_t);
|
||||
int iswprint(wint_t);
|
||||
int iswpunct(wint_t);
|
||||
int iswspace(wint_t);
|
||||
int iswupper(wint_t);
|
||||
int iswxdigit(wint_t);
|
||||
int iswctype(wint_t, wctype_t);
|
||||
wint_t fgetwc(FILE *);
|
||||
wchar_t *fgetws(wchar_t *, int, FILE *);
|
||||
wint_t fputwc(wchar_t, FILE *);
|
||||
int fputws(const wchar_t *, FILE *);
|
||||
int fwide(FILE *, int);
|
||||
wint_t getwc(FILE *);
|
||||
wint_t getwchar(void);
|
||||
int mbsinit(const mbstate_t *);
|
||||
size_t mbrlen(const char *, size_t, mbstate_t *);
|
||||
size_t mbrtowc(wchar_t *, const char *, size_t,
|
||||
mbstate_t *);
|
||||
size_t mbsrtowcs(wchar_t *, const char **, size_t,
|
||||
mbstate_t *);
|
||||
wint_t putwc(wchar_t, FILE *);
|
||||
wint_t putwchar(wchar_t);
|
||||
int swprintf(wchar_t *, size_t, const wchar_t *, ...);
|
||||
int swscanf(const wchar_t *, const wchar_t *, ...);
|
||||
wint_t towlower(wint_t);
|
||||
wint_t towupper(wint_t);
|
||||
wint_t ungetwc(wint_t, FILE *);
|
||||
int vfwprintf(FILE *, const wchar_t *, va_list);
|
||||
int vwprintf(const wchar_t *, va_list);
|
||||
int vswprintf(wchar_t *, size_t, const wchar_t *,
|
||||
va_list);
|
||||
size_t wcrtomb(char *, wchar_t, mbstate_t *);
|
||||
wchar_t *wcscat(wchar_t *, const wchar_t *);
|
||||
wchar_t *wcschr(const wchar_t *, wchar_t);
|
||||
int wcscmp(const wchar_t *, const wchar_t *);
|
||||
int wcscoll(const wchar_t *, const wchar_t *);
|
||||
wchar_t *wcscpy(wchar_t *, const wchar_t *);
|
||||
size_t wcscspn(const wchar_t *, const wchar_t *);
|
||||
size_t wcsftime(wchar_t *, size_t, const wchar_t *,
|
||||
const struct tm *);
|
||||
size_t wcslen(const wchar_t *);
|
||||
wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t);
|
||||
int wcsncmp(const wchar_t *, const wchar_t *, size_t);
|
||||
wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t);
|
||||
wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
|
||||
wchar_t *wcsrchr(const wchar_t *, wchar_t);
|
||||
size_t wcsrtombs(char *, const wchar_t **, size_t,
|
||||
mbstate_t *);
|
||||
size_t wcsspn(const wchar_t *, const wchar_t *);
|
||||
wchar_t *wcsstr(const wchar_t *, const wchar_t *);
|
||||
double wcstod(const wchar_t *, wchar_t **);
|
||||
wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t **);
|
||||
long int wcstol(const wchar_t *, wchar_t **, int);
|
||||
unsigned long int wcstoul(const wchar_t *, wchar_t **, int);
|
||||
wchar_t *wcswcs(const wchar_t *, const wchar_t *);
|
||||
int wcswidth(const wchar_t *, size_t);
|
||||
size_t wcsxfrm(wchar_t *, const wchar_t *, size_t);
|
||||
int wctob(wint_t);
|
||||
wctype_t wctype(const char *);
|
||||
int wcwidth(wchar_t);
|
||||
wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
|
||||
int wmemcmp(const wchar_t *, const wchar_t *, size_t);
|
||||
wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t);
|
||||
wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
|
||||
wchar_t *wmemset(wchar_t *, wchar_t, size_t);
|
||||
int wprintf(const wchar_t *, ...);
|
||||
int wscanf(const wchar_t *, ...);
|
||||
|
||||
/* MACROS */
|
||||
#define WCHAR_MAX (0xFFFF)
|
||||
#define WCHAR_MIN (0x0000)
|
||||
|
||||
/* FIXME? */
|
||||
#define WEOF (0xFFFF)
|
||||
|
||||
#endif /* __WCHAR_H_INCLUDED__ */
|
||||
|
||||
/* EOF */
|
||||
|
46
posix/lib/crt0w32.c
Normal file
46
posix/lib/crt0w32.c
Normal file
@@ -0,0 +1,46 @@
|
||||
/* $Id: crt0w32.c,v 1.1 2002/01/20 21:24:49 ea Exp $
|
||||
*
|
||||
* PROJECT : ReactOS / POSIX+ personality
|
||||
* FILE : subsys/psx/lib/cr0w32.c
|
||||
* DESCRIPTION: startup code for POSIX+ applications.
|
||||
* DATE : 2002-01-18
|
||||
* AUTHOR : Emanuele Aliberti <ea@iol.it>
|
||||
*/
|
||||
|
||||
extern void __stdcall __PdxInitializeData(int*,char***);
|
||||
extern int main (int,char**,char**);
|
||||
extern void exit(int);
|
||||
|
||||
/* ANSI ENVIRONMENT */
|
||||
|
||||
char **_environ = (char**) 0;
|
||||
|
||||
int errno = 0;
|
||||
|
||||
#ifdef __SUBSYSTEM_WINDOWS__
|
||||
void WinMainCRTStartup (void)
|
||||
#else
|
||||
void mainCRTStartup (void)
|
||||
#endif
|
||||
{
|
||||
char * argv[2] = {"none", 0};
|
||||
|
||||
/* TODO: parse the command line */
|
||||
exit(main(1,argv,0));
|
||||
}
|
||||
|
||||
void __main ()
|
||||
{
|
||||
/*
|
||||
* Store in PSXDLL.DLL two well known global symbols
|
||||
* references.
|
||||
*/
|
||||
__PdxInitializeData (& errno, & _environ); /* PSXDLL.__PdxInitializeData */
|
||||
/* CRT initialization. */
|
||||
#ifdef __SUBSYSTEM_WINDOWS__
|
||||
WinMainCRTStartup ();
|
||||
#else
|
||||
mainCRTStartup ();
|
||||
#endif
|
||||
}
|
||||
/* EOF */
|
117
posix/lib/psxdll/Makefile
Normal file
117
posix/lib/psxdll/Makefile
Normal file
@@ -0,0 +1,117 @@
|
||||
# $Id: Makefile,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
|
||||
PATH_TO_TOP = ../../../..
|
||||
|
||||
TARGET_TYPE = dynlink
|
||||
|
||||
TARGET_NAME = psxdll
|
||||
|
||||
TARGET_LFLAGS = -nostartfiles
|
||||
|
||||
TARGET_SDKLIBS = ntdll.a
|
||||
|
||||
TARGET_BASE = 0x68EB0000
|
||||
|
||||
TARGET_ENTRY = _DllMain@12
|
||||
|
||||
TARGET_CFLAGS = -W -nostdinc -nostdlib -fno-builtin -I$(PATH_TO_TOP)/subsys/psx/include -D__PSXDLL__ -D__PSX_DEBUG_WANT_ALL__
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
TARGET_CLEAN = $(OBJECTS)
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
include $(TOOLS_PATH)/helper.mk
|
||||
|
||||
OBJECTS_MISC = \
|
||||
misc/main.o \
|
||||
misc/interlock.o \
|
||||
misc/safeobj.o \
|
||||
misc/path.o \
|
||||
misc/fdtable.o
|
||||
|
||||
OBJECTS_DIRENT = \
|
||||
dirent/opendir.o \
|
||||
dirent/readdir.o \
|
||||
dirent/closedir.o
|
||||
|
||||
OBJECTS_DLFCN = \
|
||||
dlfcn/dlopen.o \
|
||||
dlfcn/dlclose.o \
|
||||
dlfcn/dlsym.o \
|
||||
dlfcn/dlerror.o
|
||||
|
||||
OBJECTS_ERRNO = \
|
||||
errno/errno.o
|
||||
|
||||
OBJECTS_FCNTL = \
|
||||
fcntl/open.o \
|
||||
fcntl/fcntl.o
|
||||
|
||||
OBJECTS_LIBGEN = \
|
||||
libgen/basename.o
|
||||
|
||||
OBJECTS_SCHED = \
|
||||
sched/yield.o
|
||||
|
||||
OBJECTS_SIGNAL = \
|
||||
pthread/kill.o \
|
||||
signal/raise.o
|
||||
|
||||
OBJECTS_STDLIB = \
|
||||
stdlib/abort.o \
|
||||
stdlib/malloc.o \
|
||||
stdlib/exit.o
|
||||
|
||||
OBJECTS_STRING = \
|
||||
string/strdup.o \
|
||||
string/strerror.o
|
||||
|
||||
OBJECTS_PTHREAD = \
|
||||
pthread/create.o \
|
||||
pthread/exit.o \
|
||||
pthread/join.o \
|
||||
pthread/mutex.o \
|
||||
pthread/self.o
|
||||
|
||||
OBJECTS_SYS_UTSNAME = \
|
||||
sys/utsname/uname.o
|
||||
|
||||
OBJECTS_UNISTD = \
|
||||
unistd/close.o \
|
||||
unistd/dup.o \
|
||||
unistd/getcwd.o \
|
||||
unistd/getpid.o \
|
||||
unistd/getppid.o
|
||||
|
||||
OBJECTS = \
|
||||
$(OBJECTS_MISC) \
|
||||
$(OBJECTS_DIRENT) \
|
||||
$(OBJECTS_DLFCN) \
|
||||
$(OBJECTS_ERRNO) \
|
||||
$(OBJECTS_FCNTL) \
|
||||
$(OBJECTS_LIBGEN) \
|
||||
$(OBJECTS_SCHED) \
|
||||
$(OBJECTS_SIGNAL) \
|
||||
$(OBJECTS_STDLIB) \
|
||||
$(OBJECTS_STRING) \
|
||||
$(OBJECTS_PTHREAD) \
|
||||
$(OBJECTS_SYS_UTSNAME) \
|
||||
$(OBJECTS_UNISTD)
|
||||
|
||||
DEP_OBJECTS = $(OBJECTS)
|
||||
|
||||
include $(TOOLS_PATH)/depend.mk
|
||||
|
||||
$(TARGET_NAME).o: $(OBJECTS)
|
||||
$(LD) -r $(OBJECTS) -o $(TARGET_NAME).o
|
||||
|
||||
DTFLAGS = -k -l $@
|
||||
|
||||
$(TARGET_NAME).a: $(TARGET_NAME).def
|
||||
$(DLLTOOL) \
|
||||
$(DTFLAGS) \
|
||||
-D $(TARGET_NAME).dll \
|
||||
-d $(TARGET_NAME).def
|
||||
|
||||
# EOF
|
36
posix/lib/psxdll/dirent/closedir.c
Normal file
36
posix/lib/psxdll/dirent/closedir.c
Normal file
@@ -0,0 +1,36 @@
|
||||
/* $Id: closedir.c,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/dirent/closedir.c
|
||||
* PURPOSE: Close a directory stream
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 01/02/2002: Created
|
||||
* 13/02/2002: KJK::Hyperion: modified to use file descriptors
|
||||
*/
|
||||
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <psx/dirent.h>
|
||||
#include <psx/safeobj.h>
|
||||
|
||||
int closedir(DIR *dirp)
|
||||
{
|
||||
/* check the "magic" signature */
|
||||
if(!__safeobj_validate(dirp, __IDIR_MAGIC))
|
||||
{
|
||||
errno = EBADF;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* this will close the handle, deallocate the internal object and
|
||||
invalidate the descriptor */
|
||||
return (close(((struct __internal_DIR *)dirp)->fildes));
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
100
posix/lib/psxdll/dirent/opendir.c
Normal file
100
posix/lib/psxdll/dirent/opendir.c
Normal file
@@ -0,0 +1,100 @@
|
||||
/* $Id: opendir.c,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/dirent/opendir.c
|
||||
* PURPOSE: Open a directory
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 27/01/2002: Created
|
||||
* 13/02/2002: KJK::Hyperion: modified to use file descriptors
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
#include <wchar.h>
|
||||
#include <errno.h>
|
||||
#include <psx/debug.h>
|
||||
#include <psx/stdlib.h>
|
||||
#include <psx/dirent.h>
|
||||
#include <psx/safeobj.h>
|
||||
|
||||
DIR *opendir(const char *dirname)
|
||||
{
|
||||
ANSI_STRING strDirName;
|
||||
UNICODE_STRING wstrDirName;
|
||||
DIR *pdData;
|
||||
|
||||
RtlInitAnsiString(&strDirName, (PCSZ)dirname);
|
||||
RtlAnsiStringToUnicodeString(&wstrDirName, &strDirName, TRUE);
|
||||
|
||||
pdData = (DIR *)_Wopendir(wstrDirName.Buffer);
|
||||
|
||||
RtlFreeUnicodeString(&wstrDirName);
|
||||
|
||||
return (pdData);
|
||||
|
||||
}
|
||||
|
||||
DIR *_Wopendir(const wchar_t *dirname)
|
||||
{
|
||||
struct __internal_DIR *pidData;
|
||||
int nFileNo;
|
||||
|
||||
/* allocate internal object */
|
||||
pidData = __malloc(sizeof(*pidData));
|
||||
|
||||
/* allocation failed */
|
||||
if(pidData == 0)
|
||||
{
|
||||
errno = ENOMEM;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* open the directory */
|
||||
nFileNo = _Wopen(dirname, O_RDONLY | _O_DIRFILE);
|
||||
|
||||
/* failure */
|
||||
if(nFileNo < 0)
|
||||
{
|
||||
__free(pidData);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* directory file descriptors must be closed on exec() */
|
||||
if(fcntl(nFileNo, F_SETFD, FD_CLOEXEC) == -1)
|
||||
WARN
|
||||
(
|
||||
"couldn't set FD_CLOEXEC flag on file number %u, errno %u",
|
||||
nFileNo,
|
||||
errno
|
||||
);
|
||||
|
||||
/* associate the internal data to the file descriptor */
|
||||
if(fcntl(nFileNo, F_SETXP, pidData) == -1)
|
||||
WARN
|
||||
(
|
||||
"couldn't associate the object at 0x%X to the file number %u, errno %u",
|
||||
pidData,
|
||||
nFileNo,
|
||||
errno
|
||||
);
|
||||
|
||||
if(fcntl(nFileNo, F_SETXS, sizeof(*pidData)) == -1)
|
||||
WARN
|
||||
(
|
||||
"couldn't set the extra data size of the file number %u, errno %u",
|
||||
nFileNo,
|
||||
errno
|
||||
);
|
||||
|
||||
pidData->signature = __IDIR_MAGIC;
|
||||
|
||||
/* success */
|
||||
return ((DIR *)pidData);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
214
posix/lib/psxdll/dirent/readdir.c
Normal file
214
posix/lib/psxdll/dirent/readdir.c
Normal file
@@ -0,0 +1,214 @@
|
||||
/* $Id: readdir.c,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/dirent/readdir.c
|
||||
* PURPOSE: Read directory
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 27/01/2002: Created
|
||||
* 13/02/2002: KJK::Hyperion: modified to use file descriptors
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <dirent.h>
|
||||
#include <psx/dirent.h>
|
||||
#include <psx/debug.h>
|
||||
#include <psx/errno.h>
|
||||
#include <psx/safeobj.h>
|
||||
#include <ddk/ntddk.h>
|
||||
|
||||
struct dirent *readdir(DIR *dirp)
|
||||
{
|
||||
struct _Wdirent *lpwdReturn;
|
||||
struct __internal_DIR *pidData;
|
||||
ANSI_STRING strFileName;
|
||||
UNICODE_STRING wstrFileName;
|
||||
NTSTATUS nErrCode;
|
||||
|
||||
/* call Unicode function */
|
||||
lpwdReturn = _Wreaddir(dirp);
|
||||
|
||||
/* failure */
|
||||
if(lpwdReturn == 0)
|
||||
return (0);
|
||||
|
||||
/* get the internal data object */
|
||||
pidData = ((struct __internal_DIR *)dirp);
|
||||
|
||||
/* create NT Unicode string from the Unicode dirent's buffer */
|
||||
RtlInitUnicodeString(&wstrFileName, pidData->ent.de_unicode.d_name);
|
||||
|
||||
/* HACK: make the ANSI string point to the same buffer where the Unicode string is stored */
|
||||
strFileName.Buffer = (PCSZ)&pidData->info.FileName[0];
|
||||
strFileName.Length = 0;
|
||||
strFileName.MaximumLength = MAX_PATH;
|
||||
|
||||
/* convert the filename to ANSI */
|
||||
nErrCode = RtlUnicodeStringToAnsiString(&strFileName, &wstrFileName, FALSE);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
errno = __status_to_errno(nErrCode);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* make the ANSI dirent filename point to the ANSI buffer */
|
||||
pidData->ent.de_ansi.d_name = strFileName.Buffer;
|
||||
|
||||
/* null-terminate the ANSI name */
|
||||
pidData->ent.de_ansi.d_name[strFileName.Length] = 0;
|
||||
|
||||
/* success */
|
||||
return (&(pidData->ent.de_ansi));
|
||||
}
|
||||
|
||||
int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return (0);
|
||||
}
|
||||
|
||||
struct _Wdirent *_Wreaddir(DIR *dirp)
|
||||
{
|
||||
HANDLE hFile;
|
||||
HANDLE hDir;
|
||||
OBJECT_ATTRIBUTES oaFileAttribs;
|
||||
UNICODE_STRING wstrFileName;
|
||||
FILE_INTERNAL_INFORMATION fiiInfo;
|
||||
IO_STATUS_BLOCK isbStatus;
|
||||
NTSTATUS nErrCode;
|
||||
struct __internal_DIR *pidData;
|
||||
|
||||
/* check the "magic" signature */
|
||||
if(!__safeobj_validate(dirp, __IDIR_MAGIC))
|
||||
{
|
||||
errno = EINVAL;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* get internal data */
|
||||
pidData = (struct __internal_DIR *)dirp;
|
||||
|
||||
/* get handle */
|
||||
hDir = (HANDLE)fcntl(pidData->fildes, F_GETFH);
|
||||
|
||||
/* failure */
|
||||
if(((int)hDir) == -1)
|
||||
return (0);
|
||||
|
||||
/* read next directory entry */
|
||||
nErrCode = NtQueryDirectoryFile
|
||||
(
|
||||
hDir,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&isbStatus,
|
||||
(PVOID)&pidData->info,
|
||||
sizeof(pidData->info) + sizeof(WCHAR) * (MAX_PATH - 1),
|
||||
FileDirectoryInformation,
|
||||
TRUE,
|
||||
NULL,
|
||||
FALSE
|
||||
);
|
||||
|
||||
/* failure or EOF */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
if(nErrCode == (NTSTATUS)STATUS_NO_MORE_FILES)
|
||||
return (0);
|
||||
else
|
||||
{
|
||||
ERR("NtQueryDirectoryFile() failed with status 0x%08X", nErrCode);
|
||||
errno = __status_to_errno(nErrCode);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
/* null-terminate the filename, just in case */
|
||||
pidData->info.FileName[pidData->info.FileNameLength / sizeof(WCHAR)] = 0;
|
||||
|
||||
INFO("this entry: %ls", pidData->info.FileName);
|
||||
|
||||
#if 0
|
||||
/* file inodes are not returned by NtQueryDirectoryFile, we have to open every file */
|
||||
/* set file's object attributes */
|
||||
wstrFileName.Length = pidData->info.FileNameLength;
|
||||
wstrFileName.MaximumLength = sizeof(WCHAR) * MAX_PATH;
|
||||
wstrFileName.Buffer = &pidData->info.FileName[0];
|
||||
|
||||
oaFileAttribs.Length = sizeof(OBJECT_ATTRIBUTES);
|
||||
oaFileAttribs.RootDirectory = pidData->dirhandle;
|
||||
oaFileAttribs.ObjectName = &wstrFileName;
|
||||
oaFileAttribs.Attributes = 0;
|
||||
oaFileAttribs.SecurityDescriptor = NULL;
|
||||
oaFileAttribs.SecurityQualityOfService = NULL;
|
||||
|
||||
/* open the file */
|
||||
nErrCode = NtOpenFile
|
||||
(
|
||||
&hFile,
|
||||
FILE_READ_ATTRIBUTES,
|
||||
&oaFileAttribs,
|
||||
&isbStatus,
|
||||
0,
|
||||
FILE_SYNCHRONOUS_IO_NONALERT
|
||||
);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
ERR("NtOpenFile() failed with status %#X", nErrCode);
|
||||
errno = __status_to_errno(nErrCode);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* get the internal information for the file */
|
||||
nErrCode = NtQueryInformationFile
|
||||
(
|
||||
hFile,
|
||||
&isbStatus,
|
||||
&fiiInfo,
|
||||
sizeof(FILE_INTERNAL_INFORMATION),
|
||||
FileInternalInformation
|
||||
);
|
||||
|
||||
/* close the handle (not needed anymore) */
|
||||
NtClose(hFile);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
ERR("NtQueryInformationFile() failed with status %#X", nErrCode);
|
||||
errno = __status_to_errno(nErrCode);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* return file inode */
|
||||
pidData->ent.de_unicode.d_ino = (ino_t)fiiInfo.IndexNumber.QuadPart;
|
||||
#endif
|
||||
|
||||
FIXME("file inodes currently hardcoded to 0");
|
||||
pidData->ent.de_unicode.d_ino = 0;
|
||||
|
||||
/* return file name */
|
||||
pidData->ent.de_unicode.d_name = &pidData->info.FileName[0];
|
||||
|
||||
/* success */
|
||||
return &(pidData->ent.de_unicode);
|
||||
}
|
||||
|
||||
int _Wreaddir_r(DIR *dirp, struct _Wdirent *entry, struct _Wdirent **result)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
60
posix/lib/psxdll/dlfcn/dlclose.c
Normal file
60
posix/lib/psxdll/dlfcn/dlclose.c
Normal file
@@ -0,0 +1,60 @@
|
||||
/* $Id: dlclose.c,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/dlfcn/dlclose.c
|
||||
* PURPOSE: Close a dlopen() object
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 19/12/2001: Created
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ntdll/rtl.h>
|
||||
#include <ntdll/ldr.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
#include <psx/debug.h>
|
||||
#include <psx/dlfcn.h>
|
||||
#include <psx/errno.h>
|
||||
|
||||
int dlclose(void *handle)
|
||||
{
|
||||
if(handle == 0)
|
||||
{
|
||||
ERR("invalid handle passed to dlclose");
|
||||
|
||||
__dl_set_last_error(EFAULT); /* FIXME? maybe EINVAL? */
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if(((struct __dlobj *)handle)->global)
|
||||
{
|
||||
TODO("global symbol matching not implemented");
|
||||
|
||||
__dl_set_last_error(EINVAL);
|
||||
return (-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
NTSTATUS nErrCode = LdrUnloadDll(((struct __dlobj *)handle)->handle);
|
||||
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
ERR("LdrUnloadDll(%#x) failed with status %d", ((struct __dlobj *)handle)->handle, nErrCode);
|
||||
|
||||
free(handle);
|
||||
__dl_set_last_error(__status_to_errno(nErrCode));
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
free(handle);
|
||||
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
36
posix/lib/psxdll/dlfcn/dlerror.c
Normal file
36
posix/lib/psxdll/dlfcn/dlerror.c
Normal file
@@ -0,0 +1,36 @@
|
||||
/* $Id: dlerror.c,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/dlfcn/dlerror.c
|
||||
* PURPOSE: Gain access to an executable object file
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 19/12/2001: Created
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ntdll/rtl.h>
|
||||
#include <ntdll/ldr.h>
|
||||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
#include <psx/debug.h>
|
||||
#include <psx/dlfcn.h>
|
||||
#include <psx/errno.h>
|
||||
|
||||
static int __dl_last_error = 0;
|
||||
|
||||
void __dl_set_last_error(int err)
|
||||
{
|
||||
FIXME("dlfcn error handling not thread safe");
|
||||
__dl_last_error = err;
|
||||
}
|
||||
|
||||
char *dlerror(void)
|
||||
{
|
||||
return strerror(__dl_last_error);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
129
posix/lib/psxdll/dlfcn/dlopen.c
Normal file
129
posix/lib/psxdll/dlfcn/dlopen.c
Normal file
@@ -0,0 +1,129 @@
|
||||
/* $Id: dlopen.c,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/dlfcn/dlopen.c
|
||||
* PURPOSE: Gain access to an executable object file
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 19/12/2001: Created
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ntdll/rtl.h>
|
||||
#include <ntdll/ldr.h>
|
||||
#include <wchar.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
#include <psx/dlfcn.h>
|
||||
#include <psx/errno.h>
|
||||
#include <psx/debug.h>
|
||||
|
||||
void *__wdlopen(const wchar_t *, int);
|
||||
|
||||
void *dlopen(const char *file, int mode)
|
||||
{
|
||||
/* TODO: ANSI-to-Unicode stubs like this need to be standardized in some way */
|
||||
void * pRetVal;
|
||||
ANSI_STRING strFile;
|
||||
UNICODE_STRING wstrFile;
|
||||
|
||||
RtlInitAnsiString(&strFile, (LPSTR)file);
|
||||
RtlAnsiStringToUnicodeString (&wstrFile, &strFile, TRUE);
|
||||
|
||||
pRetVal = __wdlopen((wchar_t *)wstrFile.Buffer, mode);
|
||||
|
||||
free(wstrFile.Buffer);
|
||||
|
||||
return pRetVal;
|
||||
|
||||
}
|
||||
|
||||
void *__wdlopen(const wchar_t *file, int mode)
|
||||
{
|
||||
NTSTATUS nErrCode;
|
||||
UNICODE_STRING wstrNativePath;
|
||||
struct __dlobj * pdloObject;
|
||||
|
||||
if(file == 0)
|
||||
{
|
||||
/* POSIX dynamic linking allows for global symbol matching */
|
||||
pdloObject = (struct __dlobj *)malloc(sizeof(struct __dlobj));
|
||||
|
||||
TODO("\
|
||||
move the global symbol matching semantics into the PE Loader \
|
||||
(NTDLL Ldr family of calls), and just return a pointer to the module \
|
||||
image\
|
||||
");
|
||||
|
||||
pdloObject->global = 1;
|
||||
return (pdloObject);
|
||||
}
|
||||
|
||||
FIXME("\
|
||||
LdrLoadDll() only accepts DOS paths - probably because the POSIX \
|
||||
standard didn't specify dynamic linking interfaces at the time Windows NT \
|
||||
was born \
|
||||
");
|
||||
|
||||
#if 0
|
||||
/* TODO: LdrLoadNtDll() or LdrLoadDllEx() (the former is preferrable, since
|
||||
the latter is more likely to be implemented with different purposes from
|
||||
Microsoft), accepting native NT paths */
|
||||
|
||||
if(wcschr(file, '/'L) != NULL)
|
||||
{
|
||||
/* TODO: RtlPosixPathNameToNtPathName_U */
|
||||
if(!RtlPosixPathNameToNtPathName_U((LPWSTR)file, &wstrNativePath, NULL, NULL))
|
||||
{
|
||||
__dl_set_last_error(ENOENT);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RtlInitUnicodeString(&wstrNativePath, (LPWSTR)file);
|
||||
}
|
||||
#endif
|
||||
|
||||
RtlInitUnicodeString(&wstrNativePath, (LPWSTR)file);
|
||||
|
||||
pdloObject = (struct __dlobj *)malloc(sizeof(struct __dlobj));
|
||||
pdloObject->global = 0;
|
||||
|
||||
WARN("\
|
||||
mode flags are not fully supported by Windows NT, due to the \
|
||||
completely different semantics of dynamical linking (for \
|
||||
example the global symbol matching is unsupported). This \
|
||||
implementation will then behave as if mode was set to \
|
||||
(RTLD_NOW | RTLD_GLOBAL), and fail if other flags are set.\
|
||||
");
|
||||
|
||||
if(__dl_get_scope_flag(mode) == RTLD_LOCAL)
|
||||
{
|
||||
__dl_set_last_error(EINVAL);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* load the DLL */
|
||||
nErrCode = LdrLoadDll
|
||||
(
|
||||
NULL,
|
||||
0,
|
||||
&wstrNativePath,
|
||||
(PVOID*)&pdloObject->handle
|
||||
);
|
||||
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
__dl_set_last_error(__status_to_errno(nErrCode));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (pdloObject);
|
||||
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
92
posix/lib/psxdll/dlfcn/dlsym.c
Normal file
92
posix/lib/psxdll/dlfcn/dlsym.c
Normal file
@@ -0,0 +1,92 @@
|
||||
/* $Id: dlsym.c,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/dlfcn/dlsym.c
|
||||
* PURPOSE: Obtain the address of a symbol from a dlopen() object
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 19/12/2001: Created
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ntdll/rtl.h>
|
||||
#include <ntdll/ldr.h>
|
||||
#include <dlfcn.h>
|
||||
#include <psx/dlfcn.h>
|
||||
#include <psx/errno.h>
|
||||
#include <psx/debug.h>
|
||||
|
||||
void *__dlsymn(void *, unsigned long int);
|
||||
void *__dlsym(void *, int, const char *, unsigned long int);
|
||||
|
||||
void *dlsym(void *handle, const char *name)
|
||||
{
|
||||
return (__dlsym(handle, 1, name, 0));
|
||||
}
|
||||
|
||||
void *__dlsymn(void *handle, unsigned long int ordinal)
|
||||
{
|
||||
return (__dlsym(handle, 0, 0, ordinal));
|
||||
}
|
||||
|
||||
void *__dlsym(void *handle, int by_name, const char *name, unsigned long int ordinal)
|
||||
{
|
||||
struct __dlobj * pdloObject;
|
||||
|
||||
void * pProcAddr;
|
||||
NTSTATUS nErrCode;
|
||||
|
||||
if(handle == RTLD_NEXT)
|
||||
{
|
||||
FIXME("implement RTLD_NEXT semantics");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
pdloObject = (struct __dlobj *) handle;
|
||||
|
||||
if(pdloObject->global)
|
||||
{
|
||||
FIXME("implement global symbol matching");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if(by_name)
|
||||
{
|
||||
ANSI_STRING strName;
|
||||
|
||||
RtlInitAnsiString(&strName, (LPSTR)name);
|
||||
|
||||
nErrCode = LdrGetProcedureAddress
|
||||
(
|
||||
pdloObject->handle,
|
||||
&strName,
|
||||
0,
|
||||
(PVOID *)&pProcAddr
|
||||
);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
nErrCode = LdrGetProcedureAddress
|
||||
(
|
||||
pdloObject->handle,
|
||||
NULL,
|
||||
ordinal,
|
||||
(PVOID *)&pProcAddr
|
||||
);
|
||||
}
|
||||
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
__dl_set_last_error(__status_to_errno(nErrCode));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return pProcAddr;
|
||||
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
25
posix/lib/psxdll/errno/errno.c
Normal file
25
posix/lib/psxdll/errno/errno.c
Normal file
@@ -0,0 +1,25 @@
|
||||
/* $Id: errno.c,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/errno/errno.c
|
||||
* PURPOSE: Internal errno implementation
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 27/12/2001: Created
|
||||
*/
|
||||
|
||||
#include <psx/debug.h>
|
||||
#include <psx/errno.h>
|
||||
|
||||
static int __errno_storage = 0;
|
||||
|
||||
int * __PdxGetThreadErrNum(void)
|
||||
{
|
||||
FIXME("errno currently not thread-safe");
|
||||
return (&__errno_storage);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
311
posix/lib/psxdll/fcntl/fcntl.c
Normal file
311
posix/lib/psxdll/fcntl/fcntl.c
Normal file
@@ -0,0 +1,311 @@
|
||||
/* $Id: fcntl.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/fcntl/fcntl.c
|
||||
* PURPOSE: File control
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 13/02/2002: Created
|
||||
* 15/02/2002: Implemented fcntl() (KJK::Hyperion)
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
#include <psx/errno.h>
|
||||
#include <psx/stdlib.h>
|
||||
#include <psx/fdtable.h>
|
||||
#include <psx/pdata.h>
|
||||
#include <psx/debug.h>
|
||||
|
||||
int fcntl(int fildes, int cmd, ...)
|
||||
{
|
||||
__fdtable_t *pftFdTable;
|
||||
__fildes_t *pfdDescriptor;
|
||||
NTSTATUS nErrCode;
|
||||
int nRetVal;
|
||||
int nThirdArg;
|
||||
void *pThirdArg;
|
||||
va_list vlArgs;
|
||||
|
||||
/* lock the environment */
|
||||
__PdxAcquirePdataLock();
|
||||
|
||||
/* get the file descriptors table */
|
||||
pftFdTable = __PdxGetProcessData()->FdTable;
|
||||
|
||||
/* fildes is an invalid, closed or uninitialized descriptor */
|
||||
if
|
||||
(
|
||||
fildes < 0 ||
|
||||
fildes >= OPEN_MAX ||
|
||||
__fdtable_entry_isavail(pftFdTable, fildes) == 0 ||
|
||||
__fdtable_entry_get(pftFdTable, fildes) == 0
|
||||
)
|
||||
{
|
||||
errno = EBADF;
|
||||
__PdxReleasePdataLock();
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* get the file descriptor referenced by fildes */
|
||||
pfdDescriptor = __fdtable_entry_get(pftFdTable, fildes);
|
||||
|
||||
/* get third argument as integer */
|
||||
va_start(vlArgs, cmd);
|
||||
nThirdArg = va_arg(vlArgs, int);
|
||||
va_end(vlArgs);
|
||||
|
||||
/* get third argument as pointer */
|
||||
va_start(vlArgs, cmd);
|
||||
pThirdArg = va_arg(vlArgs, void *);
|
||||
va_end(vlArgs);
|
||||
|
||||
/* initialize return value */
|
||||
nRetVal = -1;
|
||||
|
||||
switch(cmd)
|
||||
{
|
||||
case F_DUPFD:
|
||||
{
|
||||
va_list vlArgs;
|
||||
int nDupFileNo;
|
||||
__fildes_t *pfdDupDescriptor;
|
||||
|
||||
/* allocate the duplicated descriptor */
|
||||
nDupFileNo = __fdtable_entry_add(pftFdTable, nThirdArg, 0, &pfdDupDescriptor);
|
||||
|
||||
if(nDupFileNo)
|
||||
break;
|
||||
|
||||
/* copy the open flags */
|
||||
pfdDupDescriptor->OpenFlags = pfdDescriptor->OpenFlags;
|
||||
|
||||
/* clear the FD_CLOEXEC flag */
|
||||
pfdDupDescriptor->FdFlags = pfdDescriptor->FdFlags & ~FD_CLOEXEC;
|
||||
|
||||
/* duplicate the extra data */
|
||||
if(pfdDescriptor->ExtraDataSize != 0 && pfdDescriptor->ExtraData != 0)
|
||||
{
|
||||
/* allocate space for the duplicated extra data */
|
||||
pfdDupDescriptor->ExtraDataSize = pfdDescriptor->ExtraDataSize;
|
||||
pfdDupDescriptor->ExtraData = __malloc(pfdDupDescriptor->ExtraDataSize);
|
||||
|
||||
/* failure */
|
||||
if(pfdDupDescriptor->ExtraData == 0)
|
||||
{
|
||||
errno = ENOMEM;
|
||||
break;
|
||||
}
|
||||
|
||||
/* copy the extra data */
|
||||
memcpy(pfdDupDescriptor->ExtraData, pfdDescriptor->ExtraData, pfdDupDescriptor->ExtraDataSize);
|
||||
INFO
|
||||
(
|
||||
"copied %u bytes from 0x%08X into 0x%08X",
|
||||
pfdDupDescriptor->ExtraDataSize,
|
||||
pfdDescriptor->ExtraData,
|
||||
pfdDupDescriptor->ExtraData
|
||||
);
|
||||
}
|
||||
|
||||
/* duplicate the handle */
|
||||
nErrCode = NtDuplicateObject
|
||||
(
|
||||
NtCurrentProcess(),
|
||||
pfdDescriptor->FileHandle,
|
||||
NtCurrentProcess(),
|
||||
&pfdDupDescriptor->FileHandle,
|
||||
0,
|
||||
0,
|
||||
DUPLICATE_SAME_ACCESS /* | DUPLICATE_SAME_ATTRIBUTES */
|
||||
);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
__free(pfdDupDescriptor->ExtraData);
|
||||
errno = __status_to_errno(nErrCode);
|
||||
break;
|
||||
}
|
||||
|
||||
INFO
|
||||
(
|
||||
"duplicated handle 0x%08X into handle 0x%08X",
|
||||
pfdDescriptor->FileHandle,
|
||||
pfdDupDescriptor->FileHandle
|
||||
);
|
||||
|
||||
/* return the duplicated file number */
|
||||
nRetVal = nDupFileNo;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_GETFD:
|
||||
{
|
||||
nRetVal = pfdDescriptor->FdFlags;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_SETFD:
|
||||
{
|
||||
pfdDescriptor->FdFlags = nThirdArg;
|
||||
nRetVal = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_GETFL:
|
||||
{
|
||||
nRetVal = pfdDescriptor->OpenFlags;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_SETFL:
|
||||
{
|
||||
pfdDescriptor->OpenFlags = nThirdArg;
|
||||
nRetVal = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_GETLK:
|
||||
{
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_SETLK:
|
||||
{
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_SETLKW:
|
||||
{
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_NEWFD:
|
||||
{
|
||||
/* allocate a new descriptor */
|
||||
nRetVal = __fdtable_entry_add(pftFdTable, fildes, (__fildes_t *)pThirdArg, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
case F_DELFD:
|
||||
{
|
||||
/* invalid return pointer */
|
||||
if(pThirdArg == 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
memcpy((__fildes_t *)pThirdArg, pfdDescriptor, sizeof(*pfdDescriptor));
|
||||
|
||||
/* remove file descriptor */
|
||||
nRetVal = __fdtable_entry_remove(pftFdTable, fildes);
|
||||
|
||||
}
|
||||
|
||||
case F_GETALL:
|
||||
{
|
||||
/* invalid return pointer */
|
||||
if(pThirdArg == 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
/* return a copy of the file descriptor */
|
||||
memcpy((__fildes_t *)pThirdArg, pfdDescriptor, sizeof(*pfdDescriptor));
|
||||
nRetVal = 0;
|
||||
}
|
||||
|
||||
case F_SETALL:
|
||||
{
|
||||
/* invalid file descriptor to copy attributes from */
|
||||
if(pThirdArg == 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
/* copy the attributes of file descriptor from the provided descriptor */
|
||||
memcpy(pfdDescriptor, pThirdArg, sizeof(*pfdDescriptor));
|
||||
nRetVal = 0;
|
||||
}
|
||||
|
||||
case F_GETXP:
|
||||
{
|
||||
/* invalid return pointer */
|
||||
if(pThirdArg == 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
/* return a pointer to the extra data associated to the descriptor */
|
||||
*((void **)pThirdArg) = pfdDescriptor->ExtraData;
|
||||
nRetVal = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_SETXP:
|
||||
{
|
||||
/* set the pointer to the extra data associated */
|
||||
pfdDescriptor->ExtraData = pThirdArg;
|
||||
nRetVal = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_GETXS:
|
||||
{
|
||||
nRetVal = pfdDescriptor->ExtraDataSize;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_SETXS:
|
||||
{
|
||||
pfdDescriptor->ExtraDataSize = nThirdArg;
|
||||
nRetVal = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_GETFH:
|
||||
{
|
||||
/* invalid return pointer */
|
||||
if(pThirdArg == 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
/* return the handle associated to the descriptor */
|
||||
*((void **)pThirdArg) = pfdDescriptor->FileHandle;
|
||||
nRetVal = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case F_SETFH:
|
||||
{
|
||||
pfdDescriptor->FileHandle = pThirdArg;
|
||||
nRetVal = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
errno = EINVAL;
|
||||
}
|
||||
|
||||
/* unlock the environment */
|
||||
__PdxReleasePdataLock();
|
||||
|
||||
return (nRetVal);
|
||||
}
|
||||
|
||||
/* EOF */
|
181
posix/lib/psxdll/fcntl/open.c
Normal file
181
posix/lib/psxdll/fcntl/open.c
Normal file
@@ -0,0 +1,181 @@
|
||||
/* $Id: open.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/fcntl/open.c
|
||||
* PURPOSE: Open a file
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 04/02/2002: Created
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <psx/path.h>
|
||||
#include <psx/debug.h>
|
||||
#include <psx/errno.h>
|
||||
#include <psx/pdata.h>
|
||||
|
||||
int open(const char *path, int oflag, ...)
|
||||
{
|
||||
ANSI_STRING strPath;
|
||||
UNICODE_STRING wstrPath;
|
||||
int nRetVal;
|
||||
|
||||
RtlInitAnsiString(&strPath, (PCSZ)path);
|
||||
RtlAnsiStringToUnicodeString(&wstrPath, &strPath, TRUE);
|
||||
|
||||
nRetVal = _Wopen(wstrPath.Buffer, oflag);
|
||||
|
||||
RtlFreeUnicodeString(&wstrPath);
|
||||
|
||||
return (nRetVal);
|
||||
}
|
||||
|
||||
int _Wopen(const wchar_t *path, int oflag, ...)
|
||||
{
|
||||
OBJECT_ATTRIBUTES oaFileAttribs;
|
||||
IO_STATUS_BLOCK isbStatus;
|
||||
UNICODE_STRING wstrNativePath;
|
||||
NTSTATUS nErrCode;
|
||||
ULONG nDesiredAccess;
|
||||
ULONG nCreateDisposition;
|
||||
ULONG nCreateOptions;
|
||||
HANDLE hFile;
|
||||
#if 0
|
||||
mode_t mFileMode;
|
||||
#endif
|
||||
int nFileNo;
|
||||
__fdtable_t *pftTable;
|
||||
__fildes_t fdDescriptor;
|
||||
|
||||
/* translate file access flag */
|
||||
switch(oflag & O_ACCMODE)
|
||||
{
|
||||
case O_RDONLY:
|
||||
{
|
||||
nDesiredAccess = FILE_READ_ACCESS;
|
||||
nCreateOptions = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case O_WRONLY:
|
||||
{
|
||||
nDesiredAccess = FILE_WRITE_ACCESS;
|
||||
nCreateOptions = FILE_NON_DIRECTORY_FILE; /* required by the specification */
|
||||
break;
|
||||
}
|
||||
|
||||
case O_RDWR:
|
||||
{
|
||||
nDesiredAccess = FILE_READ_ACCESS | FILE_WRITE_ACCESS;
|
||||
nCreateOptions = FILE_NON_DIRECTORY_FILE; /* required by the specification */
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* miscellaneous flags */
|
||||
if((oflag & _O_DIRFILE) == _O_DIRFILE)
|
||||
nCreateOptions |= FILE_DIRECTORY_FILE;
|
||||
|
||||
/* creation disposition */
|
||||
if((oflag & O_CREAT) == O_CREAT)
|
||||
if((oflag & O_EXCL) == O_EXCL)
|
||||
nCreateDisposition = FILE_CREATE; /* O_CREAT + O_EXCL: create file, fail if file exists */
|
||||
else
|
||||
nCreateDisposition = FILE_OPEN_IF; /* O_CREAT: open file, create if file doesn't exist */
|
||||
else if((oflag & O_TRUNC) == O_TRUNC)
|
||||
nCreateDisposition = FILE_OVERWRITE; /* O_TRUNC: truncate existing file */
|
||||
else
|
||||
nCreateDisposition = FILE_OPEN; /* normal: open file, fail if file doesn't exist */
|
||||
|
||||
/* lock the environment */
|
||||
__PdxAcquirePdataLock();
|
||||
|
||||
/* convert the path into a native path */
|
||||
if(!__PdxPosixPathNameToNtPathName((LPWSTR)path, __PdxGetNativePathBuffer(), __PdxGetCurDir(), NULL))
|
||||
{
|
||||
__PdxReleasePdataLock();
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* set file generic object attributes */
|
||||
oaFileAttribs.Length = sizeof(oaFileAttribs);
|
||||
oaFileAttribs.RootDirectory = __PdxGetRootHandle();
|
||||
oaFileAttribs.ObjectName = &wstrNativePath;
|
||||
oaFileAttribs.Attributes = OBJ_INHERIT; /* child processes inherit all file descriptors */
|
||||
oaFileAttribs.SecurityDescriptor = NULL;
|
||||
oaFileAttribs.SecurityQualityOfService = NULL;
|
||||
|
||||
/* open or create the file */
|
||||
nErrCode = NtCreateFile
|
||||
(
|
||||
&hFile,
|
||||
nDesiredAccess | SYNCHRONIZE,
|
||||
&oaFileAttribs,
|
||||
&isbStatus,
|
||||
NULL,
|
||||
0,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
||||
nCreateDisposition,
|
||||
FILE_SYNCHRONOUS_IO_NONALERT,
|
||||
NULL,
|
||||
nCreateOptions
|
||||
);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
ERR("NtCreateFile() failed with status 0x%08X", nErrCode);
|
||||
__PdxReleasePdataLock();
|
||||
errno = __status_to_errno(nErrCode);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* initialize descriptor constructor */
|
||||
memset(&fdDescriptor, 0, sizeof(fdDescriptor));
|
||||
fdDescriptor.FileHandle = hFile;
|
||||
fdDescriptor.OpenFlags = oflag;
|
||||
|
||||
/* allocate a new file descriptor */
|
||||
nFileNo = fcntl(0, F_NEWFD, &fdDescriptor);
|
||||
|
||||
/* unlock the environment */
|
||||
__PdxReleasePdataLock();
|
||||
|
||||
/* could not allocate the file descriptor */
|
||||
if(nFileNo < 0)
|
||||
{
|
||||
NtClose(hFile);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* return the file number */
|
||||
return (nFileNo);
|
||||
}
|
||||
|
||||
int creat(const char *path, mode_t mode)
|
||||
{
|
||||
return (open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
|
||||
}
|
||||
|
||||
int _Wcreat(const wchar_t *path, mode_t mode)
|
||||
{
|
||||
return (_Wopen(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
114
posix/lib/psxdll/libgen/basename.c
Normal file
114
posix/lib/psxdll/libgen/basename.c
Normal file
@@ -0,0 +1,114 @@
|
||||
/* $Id: basename.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/libgen/basename.c
|
||||
* PURPOSE: Return the last component of a pathname
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 15/02/2002: Created
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <libgen.h>
|
||||
#include <wchar.h>
|
||||
#include <psx/path.h>
|
||||
|
||||
static const char *__basename_dot = ".";
|
||||
static const wchar_t *__Wbasename_dot = L".";
|
||||
|
||||
char *basename(char *path)
|
||||
{
|
||||
char *pcTail;
|
||||
size_t nStrLen;
|
||||
|
||||
/* null or empty string */
|
||||
if(path == 0 && ((nStrLen = strlen(path)) == 0))
|
||||
return ((char *)__basename_dot);
|
||||
|
||||
if(nStrLen == 1)
|
||||
{
|
||||
/* path is "/", return "/" */
|
||||
if(IS_CHAR_DELIMITER_A(path[0]))
|
||||
{
|
||||
path[0] = '/';
|
||||
path[1] = 0;
|
||||
return (path);
|
||||
}
|
||||
/* path is a single character, return it */
|
||||
else
|
||||
{
|
||||
return (path);
|
||||
}
|
||||
}
|
||||
|
||||
/* tail of the string (null terminator excluded) */
|
||||
pcTail = &path[nStrLen - 1];
|
||||
|
||||
/* skip trailing slashes */
|
||||
while(pcTail > path && IS_CHAR_DELIMITER_A(*pcTail))
|
||||
pcTail --;
|
||||
|
||||
pcTail[1] = 0;
|
||||
|
||||
/* go backwards until a delimiter char or the beginning of the string */
|
||||
while(pcTail >= path)
|
||||
/* delimiter found, return the basename */
|
||||
if(IS_CHAR_DELIMITER_A(*pcTail))
|
||||
return (&pcTail[1]);
|
||||
else
|
||||
pcTail --;
|
||||
|
||||
/* return all the path */
|
||||
return (path);
|
||||
}
|
||||
|
||||
wchar_t *_Wbasename(wchar_t *path)
|
||||
{
|
||||
wchar_t *pwcTail;
|
||||
size_t nStrLen;
|
||||
|
||||
/* null or empty string */
|
||||
if(path == 0 && ((nStrLen = wcslen(path)) == 0))
|
||||
return ((wchar_t *)__Wbasename_dot);
|
||||
|
||||
if(nStrLen == 1)
|
||||
{
|
||||
/* path is "/", return "/" */
|
||||
if(IS_CHAR_DELIMITER_U(path[0]))
|
||||
{
|
||||
path[0] = L'/';
|
||||
path[1] = 0;
|
||||
return (path);
|
||||
}
|
||||
/* path is a single character, return it */
|
||||
else
|
||||
{
|
||||
return (path);
|
||||
}
|
||||
}
|
||||
|
||||
/* tail of the string (null terminator excluded) */
|
||||
pwcTail = &path[nStrLen - 1];
|
||||
|
||||
/* skip trailing slashes */
|
||||
while(pwcTail > path && IS_CHAR_DELIMITER_U(*pwcTail))
|
||||
pwcTail --;
|
||||
|
||||
pwcTail[1] = 0;
|
||||
|
||||
/* go backwards until a delimiter char or the beginning of the string */
|
||||
while(pwcTail >= path)
|
||||
/* delimiter found, return the basename */
|
||||
if(IS_CHAR_DELIMITER_U(*pwcTail))
|
||||
return (&pwcTail[1]);
|
||||
else
|
||||
pwcTail --;
|
||||
|
||||
/* return all the path */
|
||||
return (path);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
234
posix/lib/psxdll/misc/fdtable.c
Normal file
234
posix/lib/psxdll/misc/fdtable.c
Normal file
@@ -0,0 +1,234 @@
|
||||
/* $Id: fdtable.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/misc/fdtable.c
|
||||
* PURPOSE: File descriptors table functions
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 12/02/2002: Created
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <psx/fdtable.h>
|
||||
#include <psx/stdlib.h>
|
||||
#include <psx/debug.h>
|
||||
#include <psx/safeobj.h>
|
||||
|
||||
int __fdtable_init(__fdtable_t * fdtable)
|
||||
{
|
||||
if(fdtable == 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
memset(fdtable, 0, sizeof(*fdtable));
|
||||
|
||||
fdtable->Signature = __FDTABLE_MAGIC;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int __fdtable_free(__fdtable_t * fdtable)
|
||||
{
|
||||
if(fdtable == 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
__free(&fdtable->Descriptors);
|
||||
|
||||
memset(fdtable, 0, sizeof(*fdtable));
|
||||
|
||||
fdtable->Signature = MAGIC('B', 'A', 'A', 'D');
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int __fdtable_entry_isavail(__fdtable_t * fdtable, int fileno)
|
||||
{
|
||||
return ((fdtable->DescriptorsBitmap[fileno / 32] >> (fileno % 32)) % 2);
|
||||
}
|
||||
|
||||
int __fdtable_entry_nextavail(__fdtable_t * fdtable, int fileno)
|
||||
{
|
||||
int nCurMapIndex;
|
||||
int nUnusedIndex;
|
||||
uint32_t nCurMapCell;
|
||||
|
||||
nUnusedIndex = fileno;
|
||||
|
||||
/* The file descriptors bitmap is an array of 32 bit unsigned integers (32 bit
|
||||
integers were chosen for proper data alignment without padding). The array is
|
||||
big enough to hold at least OPEN_MAX bits, that is it has OPEN_MAX / 32 cells
|
||||
(see also the __fdtable_t definition in psx/fdtable.h). Bits correspond to
|
||||
file numbers: if a bit is 1, the corresponding file number is in use, else
|
||||
it's unused. Bit numbering is right-to-left wise, that is the rightmost (least
|
||||
significative) bit of cell 0 corresponds to file number 0, the leftmost (most
|
||||
significative) bit of cell 0 to file number 7, the leftmost bit of cell 1 to
|
||||
file number 8, and so on
|
||||
*/
|
||||
/* NOTE: I'm sure the algorytm can be greatly optimized, but I prefer to privilege
|
||||
readability - it allows for more maintenable code. Please don't pretend to
|
||||
outsmart the compiler: such optimizations as performing divisions as bit shifts
|
||||
are useless */
|
||||
|
||||
/* index of the bitmap cell containing nUnusedIndex */
|
||||
nCurMapIndex = nUnusedIndex / 32;
|
||||
|
||||
/* get a copy of the bitmap cell containg nUnusedIndex, and shift it to the right
|
||||
so that the rightmost (least significative) bit is the one referencing nUnusedIndex */
|
||||
nCurMapCell = fdtable->DescriptorsBitmap[nCurMapIndex] >> (nUnusedIndex % 32);
|
||||
|
||||
while(1)
|
||||
{
|
||||
/* if the least significative bit of the current cell is 0, we've found an unused
|
||||
fileno, and we return it */
|
||||
if((nCurMapCell % 2) == 0)
|
||||
return (nUnusedIndex);
|
||||
|
||||
/* on to next fileno */
|
||||
nUnusedIndex ++;
|
||||
|
||||
/* this is NOT a failure. -1 with undefined errno means that no unused file
|
||||
number exists */
|
||||
if(nUnusedIndex >= OPEN_MAX)
|
||||
return (-1);
|
||||
|
||||
/* this fileno is referenced in the next cell */
|
||||
if((nUnusedIndex % 32) == 0)
|
||||
{
|
||||
nCurMapIndex ++;
|
||||
nCurMapCell = fdtable->DescriptorsBitmap[nCurMapIndex];
|
||||
}
|
||||
/* on to next fileno (bit) in the current cell */
|
||||
else
|
||||
nCurMapCell >>= 1;
|
||||
}
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
int __fdtable_entry_add(__fdtable_t * fdtable, int fileno, __fildes_t * fildes, __fildes_t ** newfd)
|
||||
{
|
||||
int nFileNo;
|
||||
|
||||
/* descriptors count reached OPEN_MAX */
|
||||
if(fdtable->UsedDescriptors >= OPEN_MAX)
|
||||
{
|
||||
ERR("file descriptor table full");
|
||||
errno = EMFILE;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* base fileno less than zero: use the lowest unused fileno */
|
||||
if(fileno < 0)
|
||||
nFileNo = fdtable->LowestUnusedFileNo;
|
||||
/* base fileno greater than or equal to zero: use the next available fileno */
|
||||
else
|
||||
nFileNo = __fdtable_entry_nextavail(fdtable, fileno);
|
||||
|
||||
INFO("lowest unused file number is %d", nFileNo);
|
||||
|
||||
/* descriptors count reached OPEN_MAX */
|
||||
if(nFileNo < 0)
|
||||
{
|
||||
ERR("nFileNo is less than zero");
|
||||
errno = EMFILE;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* if the table doesn't have enough space for the next entry ... */
|
||||
if(nFileNo >= fdtable->AllocatedDescriptors)
|
||||
{
|
||||
void * pTemp;
|
||||
|
||||
INFO
|
||||
(
|
||||
"growing the array from %lu to %lu bytes",
|
||||
fdtable->AllocatedDescriptors * sizeof(*fdtable->Descriptors),
|
||||
(nFileNo + 1) * sizeof(*fdtable->Descriptors)
|
||||
);
|
||||
|
||||
/* ... try to increase the size of the table */
|
||||
pTemp = __realloc
|
||||
(
|
||||
fdtable->Descriptors,
|
||||
(nFileNo + 1) * sizeof(*fdtable->Descriptors)
|
||||
);
|
||||
|
||||
/* reallocation failed */
|
||||
if(pTemp == 0)
|
||||
{
|
||||
ERR("__realloc() failed");
|
||||
errno = ENOMEM;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* update the table */
|
||||
fdtable->AllocatedDescriptors = nFileNo + 1;
|
||||
fdtable->Descriptors = pTemp;
|
||||
}
|
||||
|
||||
/* initialize descriptor */
|
||||
if(fildes == 0)
|
||||
memset(&fdtable->Descriptors[nFileNo], 0, sizeof(__fildes_t));
|
||||
else
|
||||
memcpy(&fdtable->Descriptors[nFileNo], fildes, sizeof(__fildes_t));
|
||||
|
||||
if(newfd != 0)
|
||||
*newfd = &fdtable->Descriptors[nFileNo];
|
||||
|
||||
INFO
|
||||
(
|
||||
"file number %d: handle 0x%08X, open flags 0x%08X, flags 0x%08X, extra data size %u, extra data at 0x%08X",
|
||||
nFileNo,
|
||||
fdtable->Descriptors[nFileNo].FileHandle,
|
||||
fdtable->Descriptors[nFileNo].OpenFlags,
|
||||
fdtable->Descriptors[nFileNo].FdFlags,
|
||||
fdtable->Descriptors[nFileNo].ExtraDataSize,
|
||||
fdtable->Descriptors[nFileNo].ExtraData
|
||||
);
|
||||
|
||||
INFO
|
||||
(
|
||||
"incrementing used descriptors count from %u to %u",
|
||||
fdtable->UsedDescriptors,
|
||||
fdtable->UsedDescriptors + 1
|
||||
);
|
||||
fdtable->UsedDescriptors ++;
|
||||
|
||||
INFO
|
||||
(
|
||||
"setting bit %u of cell %u of the bitmap to 1",
|
||||
nFileNo % 32,
|
||||
nFileNo / 32
|
||||
);
|
||||
fdtable->DescriptorsBitmap[nFileNo / 32] |= (1 << (nFileNo % 32));
|
||||
|
||||
fdtable->LowestUnusedFileNo = __fdtable_entry_nextavail(fdtable, nFileNo);
|
||||
INFO("setting the lowest unused file number to %d", fdtable->LowestUnusedFileNo);
|
||||
|
||||
return (nFileNo);
|
||||
}
|
||||
|
||||
int __fdtable_entry_remove(__fdtable_t * fdtable, int fileno)
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
|
||||
__fildes_t *__fdtable_entry_get(__fdtable_t * fdtable, int fileno)
|
||||
{
|
||||
/* this fileno hasn't been allocated */
|
||||
if(fileno >= fdtable->AllocatedDescriptors)
|
||||
return (0);
|
||||
|
||||
return (&fdtable->Descriptors[fileno]);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
83
posix/lib/psxdll/misc/interlock.c
Normal file
83
posix/lib/psxdll/misc/interlock.c
Normal file
@@ -0,0 +1,83 @@
|
||||
/* $Id: interlock.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/misc/interlock.c
|
||||
* PURPOSE: inter-locked increments/decrements
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 20/01/2002: Adapted from lib/kernel32/synch/intrlck.c
|
||||
*/
|
||||
|
||||
/*
|
||||
* NOTE by KJK::Hyperion: I do not understand what's behind these functions.
|
||||
* Don't ask me how they work, or to fix errors in them.
|
||||
* Please refer to the authors referenced in the original
|
||||
* file, lib/kernel32/synch/intrlck.c
|
||||
*/
|
||||
|
||||
/* TODO? move these in some shared library */
|
||||
|
||||
#include <psx/interlock.h>
|
||||
|
||||
int __interlock_inc(int * addend)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
__asm__
|
||||
(
|
||||
" lock\n" /* for SMP systems */
|
||||
" incl (%1)\n"
|
||||
" je 2f\n"
|
||||
" jl 1f\n"
|
||||
" incl %0\n"
|
||||
" jmp 2f\n"
|
||||
"1: dec %0\n"
|
||||
"2:\n"
|
||||
:"=r" (ret):"r" (addend), "0" (0): "memory"
|
||||
);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int __interlock_dec(int * addend)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
__asm__
|
||||
(
|
||||
" lock\n" /* for SMP systems */
|
||||
" decl (%1)\n"
|
||||
" je 2f\n"
|
||||
" jl 1f\n"
|
||||
" incl %0\n"
|
||||
" jmp 2f\n"
|
||||
"1: dec %0\n"
|
||||
"2:\n"
|
||||
:"=r" (ret):"r" (addend), "0" (0): "memory"
|
||||
);
|
||||
|
||||
return (ret);
|
||||
|
||||
}
|
||||
|
||||
int __interlock_add(int * addend, int increment)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
__asm__
|
||||
(
|
||||
" lock\n" /* for SMP systems */
|
||||
" xaddl %0,(%1)"
|
||||
:"=r" (ret)
|
||||
:"r" (addend), "0" (increment)
|
||||
:"memory"
|
||||
);
|
||||
|
||||
return (ret);
|
||||
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
19
posix/lib/psxdll/misc/main.c
Normal file
19
posix/lib/psxdll/misc/main.c
Normal file
@@ -0,0 +1,19 @@
|
||||
/* $Id: main.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/misc/main.c
|
||||
* PURPOSE: psxdll.dll entry point
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 27/12/2001: Created
|
||||
*/
|
||||
|
||||
int __stdcall DllMain(void *hinstDll, unsigned long int dwReason, void *reserved)
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
460
posix/lib/psxdll/misc/path.c
Normal file
460
posix/lib/psxdll/misc/path.c
Normal file
@@ -0,0 +1,460 @@
|
||||
/* $Id: path.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/misc/path.c
|
||||
* PURPOSE: POSIX subsystem path utilities
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 31/01/2002: Created
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <psx/stdlib.h>
|
||||
#include <psx/pdata.h>
|
||||
#include <psx/path.h>
|
||||
|
||||
BOOLEAN
|
||||
__PdxPosixPathGetNextComponent_U
|
||||
(
|
||||
IN UNICODE_STRING PathName,
|
||||
IN OUT PUNICODE_STRING PathComponent,
|
||||
OUT PBOOLEAN TrailingDelimiter OPTIONAL
|
||||
)
|
||||
{
|
||||
int i, j;
|
||||
USHORT l = PathName.Length / sizeof(WCHAR);
|
||||
|
||||
if(PathComponent->Buffer == 0)
|
||||
i = 0;
|
||||
else
|
||||
i = ((ULONG)PathComponent->Buffer - (ULONG)PathName.Buffer + PathComponent->Length) / sizeof(WCHAR);
|
||||
|
||||
/* skip leading empty components */
|
||||
while(1)
|
||||
if(i >= l)
|
||||
{
|
||||
PathComponent->Length = PathComponent->MaximumLength = 0;
|
||||
return (FALSE);
|
||||
}
|
||||
else if(IS_CHAR_DELIMITER_U(PathName.Buffer[i]))
|
||||
i ++;
|
||||
else
|
||||
break;
|
||||
|
||||
if(i > l)
|
||||
{
|
||||
PathComponent->Length = PathComponent->MaximumLength = 0;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
PathComponent->Buffer = &PathName.Buffer[i];
|
||||
|
||||
j = i + 1;
|
||||
|
||||
/* advance until the end of the string, or the next delimiter */
|
||||
while(1)
|
||||
{
|
||||
if(j >= l)
|
||||
{
|
||||
|
||||
if(TrailingDelimiter != 0)
|
||||
*TrailingDelimiter = FALSE;
|
||||
|
||||
break;
|
||||
}
|
||||
else if (IS_CHAR_DELIMITER_U(PathName.Buffer[j]))
|
||||
{
|
||||
|
||||
if(TrailingDelimiter != 0)
|
||||
*TrailingDelimiter = TRUE;
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
j ++;
|
||||
}
|
||||
|
||||
PathComponent->Length = PathComponent->MaximumLength = (j - i) * sizeof(WCHAR);
|
||||
|
||||
return (TRUE);
|
||||
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
__PdxPosixPathResolve_U
|
||||
(
|
||||
IN UNICODE_STRING PathName,
|
||||
OUT PUNICODE_STRING ResolvedPathName,
|
||||
IN WCHAR PathDelimiter OPTIONAL
|
||||
)
|
||||
{
|
||||
UNICODE_STRING wstrThisComponent = {0, 0, NULL};
|
||||
PWCHAR pwcCurPos;
|
||||
PWCHAR pwcStartPos;
|
||||
BOOLEAN bIsDirectory;
|
||||
|
||||
if(PathDelimiter == 0)
|
||||
PathDelimiter = L'/';
|
||||
|
||||
/* start from the beginning of the return buffer */
|
||||
pwcCurPos = ResolvedPathName->Buffer;
|
||||
|
||||
/* path begins with a delimiter (absolute path) */
|
||||
if(IS_CHAR_DELIMITER_U(PathName.Buffer[0]))
|
||||
{
|
||||
/* put a delimiter in front of the return buffer */
|
||||
*pwcCurPos = PathDelimiter;
|
||||
/* move to next character */
|
||||
pwcCurPos ++;
|
||||
}
|
||||
|
||||
pwcStartPos = pwcCurPos;
|
||||
|
||||
/* repeat until the end of the path string */
|
||||
while(__PdxPosixPathGetNextComponent_U(PathName, &wstrThisComponent, &bIsDirectory))
|
||||
{
|
||||
/* ".": skip */
|
||||
if(IS_COMPONENT_DOT_U(wstrThisComponent))
|
||||
continue;
|
||||
/* "..": go back to the last component */
|
||||
else if(IS_COMPONENT_DOTDOT_U(wstrThisComponent))
|
||||
{
|
||||
if(pwcCurPos == pwcStartPos)
|
||||
continue;
|
||||
|
||||
/* skip the last (undefined) character */
|
||||
pwcCurPos --;
|
||||
/* down to the previous path delimiter */
|
||||
do{ pwcCurPos --; }while(!IS_CHAR_DELIMITER_U(*pwcCurPos));
|
||||
/* include the delimiter */
|
||||
pwcCurPos ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* copy this component into the return string */
|
||||
memcpy
|
||||
(
|
||||
pwcCurPos,
|
||||
wstrThisComponent.Buffer,
|
||||
wstrThisComponent.Length
|
||||
);
|
||||
|
||||
/* move the current position to the end of the string */
|
||||
pwcCurPos = (PWCHAR)((PBYTE)pwcCurPos + wstrThisComponent.Length);
|
||||
|
||||
/* component had a trailing delimiter */
|
||||
if(bIsDirectory)
|
||||
{
|
||||
/* append a delimiter */
|
||||
*pwcCurPos = PathDelimiter;
|
||||
/* on to next character */
|
||||
pwcCurPos ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* set the return string's length as the byte offset between the initial buffer
|
||||
position and the current position */
|
||||
ResolvedPathName->Length = ((ULONG)pwcCurPos - (ULONG)ResolvedPathName->Buffer);
|
||||
|
||||
return (TRUE);
|
||||
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
__PdxPosixPathGetNextComponent_A
|
||||
(
|
||||
IN ANSI_STRING PathName,
|
||||
IN OUT PANSI_STRING PathComponent,
|
||||
OUT PBOOLEAN TrailingDelimiter OPTIONAL
|
||||
)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
if(PathComponent->Buffer == 0)
|
||||
i = 0;
|
||||
else
|
||||
i = ((ULONG)PathComponent->Buffer - (ULONG)PathName.Buffer + PathComponent->Length);
|
||||
|
||||
/* skip leading empty components */
|
||||
while(1)
|
||||
if(i >= PathName.Length)
|
||||
{
|
||||
PathComponent->Length = PathComponent->MaximumLength = 0;
|
||||
return (FALSE);
|
||||
}
|
||||
else if(IS_CHAR_DELIMITER_A(PathName.Buffer[i]))
|
||||
i ++;
|
||||
else
|
||||
break;
|
||||
|
||||
if(i > PathName.Length)
|
||||
{
|
||||
PathComponent->Length = PathComponent->MaximumLength = 0;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
PathComponent->Buffer = &PathName.Buffer[i];
|
||||
|
||||
j = i + 1;
|
||||
|
||||
/* advance until the end of the string, or the next delimiter */
|
||||
while(1)
|
||||
{
|
||||
if(j >= PathName.Length)
|
||||
{
|
||||
|
||||
if(TrailingDelimiter != 0)
|
||||
*TrailingDelimiter = FALSE;
|
||||
|
||||
break;
|
||||
}
|
||||
else if (IS_CHAR_DELIMITER_A(PathName.Buffer[j]))
|
||||
{
|
||||
|
||||
if(TrailingDelimiter != 0)
|
||||
*TrailingDelimiter = TRUE;
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
j ++;
|
||||
}
|
||||
|
||||
PathComponent->Length = PathComponent->MaximumLength = j - i;
|
||||
|
||||
return (TRUE);
|
||||
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
__PdxPosixPathResolve_A
|
||||
(
|
||||
IN ANSI_STRING PathName,
|
||||
OUT PANSI_STRING ResolvedPathName,
|
||||
IN CHAR PathDelimiter OPTIONAL
|
||||
)
|
||||
{
|
||||
ANSI_STRING strThisComponent = {0, 0, NULL};
|
||||
PCHAR pcCurPos;
|
||||
PCHAR pcStartPos;
|
||||
BOOLEAN bIsDirectory;
|
||||
|
||||
if(PathDelimiter == 0)
|
||||
PathDelimiter = '/';
|
||||
|
||||
/* start from the beginning of the return buffer */
|
||||
pcCurPos = ResolvedPathName->Buffer;
|
||||
|
||||
/* path begins with a delimiter (absolute path) */
|
||||
if(IS_CHAR_DELIMITER_A(PathName.Buffer[0]))
|
||||
{
|
||||
/* put a delimiter in front of the return buffer */
|
||||
*pcCurPos = PathDelimiter;
|
||||
/* move to next character */
|
||||
pcCurPos ++;
|
||||
}
|
||||
|
||||
pcStartPos = pcCurPos;
|
||||
|
||||
/* repeat until the end of the path string */
|
||||
while(__PdxPosixPathGetNextComponent_A(PathName, &strThisComponent, &bIsDirectory))
|
||||
{
|
||||
/* ".": skip */
|
||||
if(IS_COMPONENT_DOT_A(strThisComponent))
|
||||
continue;
|
||||
/* "..": go back to the last component */
|
||||
else if(IS_COMPONENT_DOTDOT_A(strThisComponent))
|
||||
{
|
||||
if(pcCurPos == pcStartPos)
|
||||
continue;
|
||||
|
||||
/* skip the last (undefined) character */
|
||||
pcCurPos --;
|
||||
/* down to the previous path delimiter */
|
||||
do{ pcCurPos --; }while(!IS_CHAR_DELIMITER_A(*pcCurPos));
|
||||
/* include the delimiter */
|
||||
pcCurPos ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* copy this component into the return string */
|
||||
strncpy
|
||||
(
|
||||
pcCurPos,
|
||||
strThisComponent.Buffer,
|
||||
strThisComponent.Length
|
||||
);
|
||||
|
||||
/* move the current position to the end of the string */
|
||||
pcCurPos = (PCHAR)((PBYTE)pcCurPos + strThisComponent.Length);
|
||||
|
||||
/* component had a trailing delimiter */
|
||||
if(bIsDirectory)
|
||||
{
|
||||
/* append a delimiter */
|
||||
*pcCurPos = PathDelimiter;
|
||||
/* on to next character */
|
||||
pcCurPos ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* set the return string's length as the byte offset between the initial buffer
|
||||
position and the current position */
|
||||
ResolvedPathName->Length = ((ULONG)pcCurPos - (ULONG)ResolvedPathName->Buffer);
|
||||
|
||||
return (TRUE);
|
||||
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
__PdxPosixPathNameToNtPathName
|
||||
(
|
||||
IN PWCHAR PosixPath,
|
||||
OUT PUNICODE_STRING NativePath,
|
||||
IN PUNICODE_STRING CurDir OPTIONAL,
|
||||
IN PUNICODE_STRING RootDir OPTIONAL
|
||||
)
|
||||
{
|
||||
UNICODE_STRING wstrPosixPath;
|
||||
UNICODE_STRING wstrTempString;
|
||||
|
||||
/* parameter validation */
|
||||
if
|
||||
(
|
||||
PosixPath == 0 ||
|
||||
NativePath == 0 ||
|
||||
NativePath->Buffer == 0 ||
|
||||
NativePath->MaximumLength == 0 ||
|
||||
(RootDir != 0 && RootDir->Buffer == 0)
|
||||
)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
RtlInitUnicodeString(&wstrPosixPath, PosixPath);
|
||||
|
||||
/* path is null */
|
||||
if(0 == wstrPosixPath.Length)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/* first, copy the root path into the return buffer */
|
||||
/* if no root dir passed by the caller... */
|
||||
if(RootDir == 0)
|
||||
/* return buffer too small */
|
||||
if(NativePath->MaximumLength < sizeof(WCHAR))
|
||||
{
|
||||
errno = ENOBUFS;
|
||||
return (FALSE);
|
||||
}
|
||||
/* set the first character to a backslash, and set length accordingly */
|
||||
else
|
||||
{
|
||||
NativePath->Buffer[0] = L'\\';
|
||||
NativePath->Length = sizeof(WCHAR);
|
||||
}
|
||||
/* ... else copy the root dir into the return buffer */
|
||||
else
|
||||
/* return buffer too small */
|
||||
if(NativePath->MaximumLength < RootDir->Length)
|
||||
{
|
||||
errno = ENOBUFS;
|
||||
return (FALSE);
|
||||
}
|
||||
/* copy the root directory into the return buffer, and set length */
|
||||
else
|
||||
{
|
||||
memcpy(NativePath->Buffer, RootDir->Buffer, RootDir->Length);
|
||||
NativePath->Length = RootDir->Length;
|
||||
}
|
||||
|
||||
/* path is "/" - our work is done */
|
||||
if(sizeof(WCHAR) == wstrPosixPath.Length && IS_CHAR_DELIMITER_U(wstrPosixPath.Buffer[0]))
|
||||
return (TRUE);
|
||||
|
||||
/* temp string pointing to the tail of the return buffer */
|
||||
wstrTempString.Length = 0;
|
||||
wstrTempString.MaximumLength = NativePath->MaximumLength - NativePath->Length;
|
||||
wstrTempString.Buffer = (PWCHAR)(((PBYTE)(NativePath->Buffer)) + NativePath->Length);
|
||||
|
||||
/* path begins with '/': absolute path. Append the resolved path to the return buffer */
|
||||
if(IS_CHAR_DELIMITER_U(wstrPosixPath.Buffer[0]))
|
||||
{
|
||||
/* copy the resolved path in the return buffer */
|
||||
__PdxPosixPathResolve_U(wstrPosixPath, &wstrTempString, L'\\');
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
UNICODE_STRING wstrAbsolutePath;
|
||||
|
||||
if(CurDir == 0)
|
||||
CurDir = __PdxGetCurDir();
|
||||
|
||||
/* initialize the buffer for the absolute path */
|
||||
wstrAbsolutePath.Length = 0;
|
||||
wstrAbsolutePath.MaximumLength = 0xFFFF;
|
||||
wstrAbsolutePath.Buffer = __malloc(0xFFFF);
|
||||
|
||||
/* if the current directory is not null... */
|
||||
if(!(CurDir->Buffer == 0 || CurDir->Length == 0))
|
||||
{
|
||||
/* copy it into the absolute path buffer */
|
||||
memcpy(wstrAbsolutePath.Buffer, CurDir->Buffer, CurDir->Length);
|
||||
wstrAbsolutePath.Length += CurDir->Length;
|
||||
}
|
||||
|
||||
/* not enough space to append an extra slash */
|
||||
if((wstrAbsolutePath.MaximumLength - wstrAbsolutePath.Length) < (USHORT)sizeof(WCHAR))
|
||||
{
|
||||
__free(wstrAbsolutePath.Buffer);
|
||||
NativePath->Length = 0;
|
||||
errno = ENOBUFS;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/* append an extra slash */
|
||||
wstrAbsolutePath.Buffer[wstrAbsolutePath.Length / sizeof(WCHAR)] = L'/';
|
||||
wstrAbsolutePath.Length += sizeof(WCHAR);
|
||||
|
||||
/* not enough space to copy the relative path */
|
||||
if((wstrAbsolutePath.MaximumLength - wstrAbsolutePath.Length) < wstrPosixPath.Length)
|
||||
{
|
||||
__free(wstrAbsolutePath.Buffer);
|
||||
NativePath->Length = 0;
|
||||
errno = ENOBUFS;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/* append the relative path to the absolute path */
|
||||
memcpy(
|
||||
(PWCHAR)(((PBYTE)wstrAbsolutePath.Buffer) + wstrAbsolutePath.Length),
|
||||
wstrPosixPath.Buffer,
|
||||
wstrPosixPath.Length
|
||||
);
|
||||
wstrAbsolutePath.Length += wstrPosixPath.Length;
|
||||
|
||||
/* resolve the path */
|
||||
__PdxPosixPathResolve_U(wstrAbsolutePath, &wstrTempString, L'\\');
|
||||
|
||||
__free(wstrAbsolutePath.Buffer);
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
45
posix/lib/psxdll/misc/safeobj.c
Normal file
45
posix/lib/psxdll/misc/safeobj.c
Normal file
@@ -0,0 +1,45 @@
|
||||
/* $Id: safeobj.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/misc/safeobj.c
|
||||
* PURPOSE: safe checking of user-provided objects
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 09/01/2002: Created
|
||||
*/
|
||||
|
||||
#include <psx/safeobj.h>
|
||||
#include <psx/debug.h>
|
||||
|
||||
int __safeobj_validate(void *obj, __magic_t refsignature)
|
||||
{
|
||||
if(obj == 0)
|
||||
return (0);
|
||||
else
|
||||
{
|
||||
/* cast the object to a magic number */
|
||||
__magic_t mSignature = *((__magic_t *)obj);
|
||||
|
||||
ERRIF
|
||||
(
|
||||
mSignature != refsignature,
|
||||
"invalid object at %X: signature is \"%c%c%c%c\", should be \"%c%c%c%c\"",
|
||||
obj,
|
||||
MAGIC_DECOMPOSE(refsignature),
|
||||
MAGIC_DECOMPOSE(mSignature)
|
||||
);
|
||||
|
||||
if(mSignature == refsignature)
|
||||
/* signatures match: ok */
|
||||
return (-1);
|
||||
else
|
||||
/* signatures mismatch: fail */
|
||||
return (0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
25
posix/lib/psxdll/misc/template.c
Normal file
25
posix/lib/psxdll/misc/template.c
Normal file
@@ -0,0 +1,25 @@
|
||||
/* $Id: template.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
How to create a new source file from this template:
|
||||
- copy the template in the new file (never edit this file directly, unless
|
||||
that's what you want)
|
||||
- search for the string "EDITME" in the file, and follow the instructions
|
||||
- remove this comment block, all blocks containing DELETEME, and all EDITME
|
||||
instructions
|
||||
- save your file, and Have Fun! (TM)
|
||||
*/
|
||||
/* $ Id $ (EDITME: replace "$ Id $" with "$Id: template.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $")
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: (EDITME: put real path of the file here)
|
||||
* PURPOSE: (EDITME: put a very syntetic description of the file here)
|
||||
* PROGRAMMER: <john.doe@mail.com> (EDITME: your name and e-mail go here)
|
||||
* UPDATE HISTORY:
|
||||
* (EDITME: put here the creation date): Created
|
||||
*/
|
||||
|
||||
/* EDITME: your code here */
|
||||
|
||||
/* EOF */
|
||||
|
143
posix/lib/psxdll/psxdll.def
Normal file
143
posix/lib/psxdll/psxdll.def
Normal file
@@ -0,0 +1,143 @@
|
||||
; $Id: psxdll.def,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
;
|
||||
; ReactOS POSIX+ Client Library
|
||||
;
|
||||
|
||||
LIBRARY PSXDLL.DLL
|
||||
EXPORTS
|
||||
|
||||
;dirent
|
||||
opendir
|
||||
readdir
|
||||
closedir
|
||||
|
||||
;dlfcn
|
||||
dlopen
|
||||
dlclose
|
||||
dlsym
|
||||
dlerror
|
||||
|
||||
;errno
|
||||
__PdxGetThreadErrNum
|
||||
|
||||
;fcntl
|
||||
open
|
||||
creat
|
||||
fcntl
|
||||
|
||||
;libgen
|
||||
basename
|
||||
|
||||
;misc
|
||||
;path
|
||||
__PdxPosixPathGetNextComponent_A
|
||||
__PdxPosixPathGetNextComponent_U
|
||||
__PdxPosixPathResolve_A
|
||||
__PdxPosixPathResolve_U
|
||||
__PdxPosixPathNameToNtPathName
|
||||
;fdtable
|
||||
__fdtable_init
|
||||
__fdtable_free
|
||||
__fdtable_entry_nextavail
|
||||
__fdtable_entry_add
|
||||
__fdtable_entry_remove
|
||||
__fdtable_entry_get
|
||||
;safeobj
|
||||
__safeobj_validate
|
||||
|
||||
;pthread
|
||||
pthread_create
|
||||
pthread_exit
|
||||
pthread_join
|
||||
pthread_mutex_destroy
|
||||
pthread_mutex_init
|
||||
pthread_mutex_lock
|
||||
pthread_mutex_trylock
|
||||
pthread_mutex_unlock
|
||||
pthread_mutex_getprioceiling
|
||||
pthread_mutex_setprioceiling
|
||||
pthread_mutexattr_destroy
|
||||
pthread_mutexattr_getpshared
|
||||
pthread_mutexattr_init
|
||||
pthread_mutexattr_setpshared
|
||||
pthread_mutexattr_gettype
|
||||
pthread_mutexattr_settype
|
||||
pthread_mutexattr_getprioceiling
|
||||
pthread_mutexattr_getprotocol
|
||||
pthread_mutexattr_setprioceiling
|
||||
pthread_mutexattr_setprotocol
|
||||
|
||||
;sched
|
||||
sched_yield
|
||||
|
||||
;signal
|
||||
pthread_kill
|
||||
raise
|
||||
|
||||
;stdio
|
||||
printf
|
||||
gets
|
||||
|
||||
;stdlib
|
||||
abort
|
||||
malloc
|
||||
realloc
|
||||
free
|
||||
calloc
|
||||
exit
|
||||
|
||||
;string
|
||||
;forward-exports to NTDLL
|
||||
memchr
|
||||
memcmp
|
||||
memcpy
|
||||
memmove
|
||||
memset
|
||||
strcat
|
||||
strchr
|
||||
strcmp
|
||||
strcpy
|
||||
strcspn
|
||||
strlen
|
||||
strncat
|
||||
strncmp
|
||||
strncpy
|
||||
strpbrk
|
||||
strrchr
|
||||
strspn
|
||||
strstr
|
||||
;implemented internally
|
||||
strdup
|
||||
|
||||
;sys/utsname
|
||||
uname
|
||||
|
||||
;unistd
|
||||
close
|
||||
dup
|
||||
dup2
|
||||
getcwd
|
||||
getpid
|
||||
getppid
|
||||
|
||||
;wchar
|
||||
;forward-exports to NTDLL
|
||||
wcscat
|
||||
wcschr
|
||||
wcscmp
|
||||
wcscpy
|
||||
wcscspn
|
||||
wcslen
|
||||
wcsncat
|
||||
wcsncmp
|
||||
wcsncpy
|
||||
wcspbrk
|
||||
wcsrchr
|
||||
wcsspn
|
||||
wcsstr
|
||||
wcstol
|
||||
wcstombs
|
||||
wcstoul
|
||||
;implemented internally
|
||||
|
||||
;EOF
|
143
posix/lib/psxdll/psxdll.edf
Normal file
143
posix/lib/psxdll/psxdll.edf
Normal file
@@ -0,0 +1,143 @@
|
||||
; $Id: psxdll.edf,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
;
|
||||
; ReactOS POSIX+ Client Library
|
||||
;
|
||||
|
||||
LIBRARY PSXDLL.DLL
|
||||
EXPORTS
|
||||
|
||||
;dirent
|
||||
opendir=opendir
|
||||
readdir=readdir
|
||||
closedir=closedir
|
||||
|
||||
;dlfcn
|
||||
dlopen=dlopen
|
||||
dlclose=dlclose
|
||||
dlsym=dlsym
|
||||
dlerror=dlerror
|
||||
|
||||
;errno
|
||||
__PdxGetThreadErrNum=__PdxGetThreadErrNum
|
||||
|
||||
;fcntl
|
||||
open=open
|
||||
creat=creat
|
||||
fcntl=fcntl
|
||||
|
||||
;libgen
|
||||
basename=basename
|
||||
|
||||
;misc
|
||||
;path
|
||||
__PdxPosixPathGetNextComponent_A=__PdxPosixPathGetNextComponent_A
|
||||
__PdxPosixPathGetNextComponent_U=__PdxPosixPathGetNextComponent_U
|
||||
__PdxPosixPathResolve_A=__PdxPosixPathResolve_A
|
||||
__PdxPosixPathResolve_U=__PdxPosixPathResolve_U
|
||||
__PdxPosixPathNameToNtPathName=__PdxPosixPathNameToNtPathName
|
||||
;fdtable
|
||||
__fdtable_init=__fdtable_init
|
||||
__fdtable_free=__fdtable_free
|
||||
__fdtable_entry_nextavail=__fdtable_entry_nextavail
|
||||
__fdtable_entry_add=__fdtable_entry_add
|
||||
__fdtable_entry_remove=__fdtable_entry_remove
|
||||
__fdtable_entry_get=__fdtable_entry_get
|
||||
;safeobj
|
||||
__safeobj_validate=__safeobj_validate
|
||||
|
||||
;pthread
|
||||
pthread_create=pthread_create
|
||||
pthread_exit=pthread_exit
|
||||
pthread_join=pthread_join
|
||||
pthread_mutex_destroy=pthread_mutex_destroy
|
||||
pthread_mutex_init=pthread_mutex_init
|
||||
pthread_mutex_lock=pthread_mutex_lock
|
||||
pthread_mutex_trylock=pthread_mutex_trylock
|
||||
pthread_mutex_unlock=pthread_mutex_unlock
|
||||
pthread_mutex_getprioceiling=pthread_mutex_getprioceiling
|
||||
pthread_mutex_setprioceiling=pthread_mutex_setprioceiling
|
||||
pthread_mutexattr_destroy=pthread_mutexattr_destroy
|
||||
pthread_mutexattr_getpshared=pthread_mutexattr_getpshared
|
||||
pthread_mutexattr_init=pthread_mutexattr_init
|
||||
pthread_mutexattr_setpshared=pthread_mutexattr_setpshared
|
||||
pthread_mutexattr_gettype=pthread_mutexattr_gettype
|
||||
pthread_mutexattr_settype=pthread_mutexattr_settype
|
||||
pthread_mutexattr_getprioceiling=pthread_mutexattr_getprioceiling
|
||||
pthread_mutexattr_getprotocol=pthread_mutexattr_getprotocol
|
||||
pthread_mutexattr_setprioceiling=pthread_mutexattr_setprioceiling
|
||||
pthread_mutexattr_setprotocol=pthread_mutexattr_setprotocol
|
||||
|
||||
;sched
|
||||
sched_yield=sched_yield
|
||||
|
||||
;signal
|
||||
pthread_kill=pthread_kill
|
||||
raise=raise
|
||||
|
||||
;stdio
|
||||
printf=MSVCRT.printf
|
||||
gets=MSVCRT.gets
|
||||
|
||||
;stdlib
|
||||
abort=abort
|
||||
malloc=malloc
|
||||
realloc=realloc
|
||||
free=free
|
||||
calloc=calloc
|
||||
exit=exit
|
||||
|
||||
;string
|
||||
;forward-exports to NTDLL
|
||||
memchr=NTDLL.memchr
|
||||
memcmp=NTDLL.memcmp
|
||||
memcpy=NTDLL.memcpy
|
||||
memmove=NTDLL.memmove
|
||||
memset=NTDLL.memset
|
||||
strcat=NTDLL.strcat
|
||||
strchr=NTDLL.strchr
|
||||
strcmp=NTDLL.strcmp
|
||||
strcpy=NTDLL.strcpy
|
||||
strcspn=NTDLL.strcspn
|
||||
strlen=NTDLL.strlen
|
||||
strncat=NTDLL.strncat
|
||||
strncmp=NTDLL.strncmp
|
||||
strncpy=NTDLL.strncpy
|
||||
strpbrk=NTDLL.strpbrk
|
||||
strrchr=NTDLL.strrchr
|
||||
strspn=NTDLL.strspn
|
||||
strstr=NTDLL.strstr
|
||||
;implemented internally
|
||||
strdup
|
||||
|
||||
;sys/utsname
|
||||
uname=uname
|
||||
|
||||
;unistd
|
||||
close=close
|
||||
dup=dup
|
||||
dup2=dup2
|
||||
getcwd=getcwd
|
||||
getpid=getpid
|
||||
getppid=getppid
|
||||
|
||||
;wchar
|
||||
;forward-exports to NTDLL
|
||||
wcscat=NTDLL.wcscat
|
||||
wcschr=NTDLL.wcschr
|
||||
wcscmp=NTDLL.wcscmp
|
||||
wcscpy=NTDLL.wcscpy
|
||||
wcscspn=NTDLL.wcscspn
|
||||
wcslen=NTDLL.wcslen
|
||||
wcsncat=NTDLL.wcsncat
|
||||
wcsncmp=NTDLL.wcsncmp
|
||||
wcsncpy=NTDLL.wcsncpy
|
||||
wcspbrk=NTDLL.wcspbrk
|
||||
wcsrchr=NTDLL.wcsrchr
|
||||
wcsspn=NTDLL.wcsspn
|
||||
wcsstr=NTDLL.wcsstr
|
||||
wcstol=NTDLL.wcstol
|
||||
wcstombs=NTDLL.wcstombs
|
||||
wcstoul=NTDLL.wcstoul
|
||||
;implemented internally
|
||||
|
||||
;EOF
|
@@ -1,11 +1,13 @@
|
||||
#include "../../include/defines.h"
|
||||
#include "../../include/reactos/resource.h"
|
||||
/* $Id: psxdll.rc,v 1.2 2002/02/20 09:17:56 hyperion Exp $
|
||||
*/
|
||||
#include <defines.h>
|
||||
#include <reactos/resource.h>
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
|
||||
PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
|
||||
PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -21,7 +23,7 @@ BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", RES_STR_COMPANY_NAME
|
||||
VALUE "FileDescription", "POSIX+ Subsystem Client DLL\0"
|
||||
VALUE "FileDescription", "POSIX+ Client DLL\0"
|
||||
VALUE "FileVersion", RES_STR_FILE_VERSION
|
||||
VALUE "InternalName", "psxdll\0"
|
||||
VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
|
||||
@@ -35,4 +37,3 @@ BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
198
posix/lib/psxdll/pthread/create.c
Normal file
198
posix/lib/psxdll/pthread/create.c
Normal file
@@ -0,0 +1,198 @@
|
||||
/* $Id: create.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/pthread/create.c
|
||||
* PURPOSE: Thread creation
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 19/12/2001: Created
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <pthread.h>
|
||||
#include <psx/debug.h>
|
||||
#include <psx/errno.h>
|
||||
#include <napi/i386/segment.h>
|
||||
|
||||
/* thread creation code adapted from kernel32's CreateRemoteThread() function */
|
||||
|
||||
static void __threadentry (void *(*start_routine)(void*), void *arg)
|
||||
{
|
||||
INFO("hello world! thread successfully created");
|
||||
|
||||
TODO("initialize thread data");
|
||||
TODO("notify DLLs");
|
||||
TODO("notify psxss");
|
||||
|
||||
INFO("about to call start routine at %#x with argument %#x", start_routine, arg);
|
||||
|
||||
pthread_exit(start_routine(arg));
|
||||
}
|
||||
|
||||
int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
|
||||
void *(*start_routine)(void*), void *arg)
|
||||
{
|
||||
HANDLE hThread;
|
||||
OBJECT_ATTRIBUTES oaThreadAttrs;
|
||||
CLIENT_ID ciId;
|
||||
CONTEXT cxThreadContext;
|
||||
INITIAL_TEB itInitialTeb;
|
||||
BOOLEAN fSuspended;
|
||||
ULONG nOldPageProtection;
|
||||
NTSTATUS nErrCode;
|
||||
|
||||
/* initialize generic object attributes */
|
||||
oaThreadAttrs.Length = sizeof(OBJECT_ATTRIBUTES);
|
||||
oaThreadAttrs.RootDirectory = NULL;
|
||||
oaThreadAttrs.ObjectName = NULL;
|
||||
oaThreadAttrs.Attributes = 0;
|
||||
oaThreadAttrs.SecurityDescriptor = NULL;
|
||||
oaThreadAttrs.SecurityQualityOfService = NULL;
|
||||
|
||||
/* initialize thread attributes */
|
||||
fSuspended = FALSE; /* FIXME? really needed? can we hardcode this to FALSE? */
|
||||
|
||||
/* stack attributes */
|
||||
FIXME("stack size defaulted to 0x100000 - thread attributes ignored");
|
||||
|
||||
/* stack reserve size */
|
||||
itInitialTeb.StackReserve = 0x100000;
|
||||
|
||||
/* stack commit size */
|
||||
itInitialTeb.StackCommit = itInitialTeb.StackReserve - PAGESIZE;
|
||||
|
||||
/* guard page */
|
||||
itInitialTeb.StackCommit += PAGESIZE;
|
||||
|
||||
/* reserve stack */
|
||||
itInitialTeb.StackAllocate = NULL;
|
||||
|
||||
nErrCode = NtAllocateVirtualMemory
|
||||
(
|
||||
NtCurrentProcess(),
|
||||
&itInitialTeb.StackAllocate,
|
||||
0,
|
||||
&itInitialTeb.StackReserve,
|
||||
MEM_RESERVE,
|
||||
PAGE_READWRITE
|
||||
);
|
||||
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
return (__status_to_errno(nErrCode)); /* FIXME? TODO? pthread specific error codes? */
|
||||
}
|
||||
|
||||
itInitialTeb.StackBase = (PVOID)((ULONG)itInitialTeb.StackAllocate + itInitialTeb.StackReserve);
|
||||
itInitialTeb.StackLimit = (PVOID)((ULONG)itInitialTeb.StackBase - itInitialTeb.StackCommit);
|
||||
|
||||
/* commit stack */
|
||||
nErrCode = NtAllocateVirtualMemory
|
||||
(
|
||||
NtCurrentProcess(),
|
||||
&itInitialTeb.StackLimit,
|
||||
0,
|
||||
&itInitialTeb.StackCommit,
|
||||
MEM_COMMIT,
|
||||
PAGE_READWRITE
|
||||
);
|
||||
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
NtFreeVirtualMemory
|
||||
(
|
||||
NtCurrentProcess(),
|
||||
itInitialTeb.StackAllocate,
|
||||
&itInitialTeb.StackReserve,
|
||||
MEM_RELEASE
|
||||
);
|
||||
|
||||
return (__status_to_errno(nErrCode));
|
||||
}
|
||||
|
||||
/* protect guard page */
|
||||
nErrCode = NtProtectVirtualMemory
|
||||
(
|
||||
NtCurrentProcess(),
|
||||
itInitialTeb.StackLimit,
|
||||
PAGESIZE,
|
||||
PAGE_GUARD | PAGE_READWRITE,
|
||||
&nOldPageProtection
|
||||
);
|
||||
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
NtFreeVirtualMemory
|
||||
(
|
||||
NtCurrentProcess(),
|
||||
itInitialTeb.StackAllocate,
|
||||
&itInitialTeb.StackReserve,
|
||||
MEM_RELEASE
|
||||
);
|
||||
|
||||
return (__status_to_errno(nErrCode));
|
||||
}
|
||||
|
||||
/* initialize thread registers */
|
||||
|
||||
//#ifdef __i386__
|
||||
memset(&cxThreadContext, 0, sizeof(CONTEXT));
|
||||
cxThreadContext.Eip = (LONG)__threadentry;
|
||||
cxThreadContext.SegGs = USER_DS;
|
||||
cxThreadContext.SegFs = TEB_SELECTOR;
|
||||
cxThreadContext.SegEs = USER_DS;
|
||||
cxThreadContext.SegDs = USER_DS;
|
||||
cxThreadContext.SegCs = USER_CS;
|
||||
cxThreadContext.SegSs = USER_DS;
|
||||
cxThreadContext.Esp = (ULONG)itInitialTeb.StackBase - 12;
|
||||
cxThreadContext.EFlags = (1<<1) + (1<<9);
|
||||
|
||||
/* initialize call stack */
|
||||
*((PULONG)((ULONG)itInitialTeb.StackBase - 4)) = (ULONG)arg; /* thread argument */
|
||||
*((PULONG)((ULONG)itInitialTeb.StackBase - 8)) = (ULONG)start_routine; /* thread start routine */
|
||||
*((PULONG)((ULONG)itInitialTeb.StackBase - 12)) = 0xDEADBEEF; /* "shouldn't see me" */
|
||||
//#else
|
||||
//#error Unsupported architecture
|
||||
//#endif
|
||||
|
||||
INFO("about to create new thread - start routine at %#x, argument %#x", start_routine, arg);
|
||||
|
||||
/* create thread */
|
||||
nErrCode = NtCreateThread
|
||||
(
|
||||
&hThread,
|
||||
THREAD_ALL_ACCESS,
|
||||
&oaThreadAttrs,
|
||||
NtCurrentProcess(),
|
||||
&ciId,
|
||||
&cxThreadContext,
|
||||
&itInitialTeb,
|
||||
fSuspended
|
||||
);
|
||||
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
NtFreeVirtualMemory
|
||||
(
|
||||
NtCurrentProcess(),
|
||||
itInitialTeb.StackAllocate,
|
||||
&itInitialTeb.StackReserve,
|
||||
MEM_RELEASE
|
||||
);
|
||||
|
||||
return (__status_to_errno(nErrCode));
|
||||
}
|
||||
|
||||
/* FIXME? should we return the thread handle or the thread id? */
|
||||
if(thread != 0)
|
||||
*thread = (pthread_t)&ciId.UniqueThread; /* for the moment, we return the id */
|
||||
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
78
posix/lib/psxdll/pthread/exit.c
Normal file
78
posix/lib/psxdll/pthread/exit.c
Normal file
@@ -0,0 +1,78 @@
|
||||
/* $Id: exit.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/pthread/exit.c
|
||||
* PURPOSE: Thread termination
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 19/12/2001: Created
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ntdll/ldr.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
#include <psx/debug.h>
|
||||
|
||||
void pthread_exit(void *value_ptr)
|
||||
{
|
||||
NTSTATUS nErrCode;
|
||||
BOOLEAN fLastThread;
|
||||
|
||||
/* terminate process if this is the last thread of the current process */
|
||||
nErrCode = NtQueryInformationThread
|
||||
(
|
||||
NtCurrentThread(),
|
||||
ThreadAmILastThread,
|
||||
&fLastThread,
|
||||
sizeof(BOOLEAN),
|
||||
NULL
|
||||
);
|
||||
|
||||
if(NT_SUCCESS(nErrCode))
|
||||
{
|
||||
if(fLastThread)
|
||||
{
|
||||
INFO("this thread is the last in the current process - about to call exit(0)");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WARN
|
||||
(
|
||||
"NtQueryInformationThread(ThreadAmILastThread) failed with status %#x. \
|
||||
Can't determine if the current thread is the last in the process. The process \
|
||||
could hang",
|
||||
nErrCode
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
TODO("Notify psxss of thread termination");
|
||||
|
||||
LdrShutdownThread(); /* detach DLLs */
|
||||
|
||||
/* kill this thread */
|
||||
|
||||
WARNIF(
|
||||
sizeof(ULONG) < sizeof(typeof(value_ptr)),
|
||||
"\
|
||||
the value returned from the current thread will be truncated (pointers shorter \
|
||||
than long integers on this architecture?) - expect trouble"
|
||||
);
|
||||
|
||||
INFO("bye bye. Current thread about to die");
|
||||
|
||||
NtTerminateThread(NtCurrentThread(), (ULONG)value_ptr);
|
||||
|
||||
/* "The pthread_exit() function cannot return to its caller." */
|
||||
NtDelayExecution(FALSE, NULL);
|
||||
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
98
posix/lib/psxdll/pthread/join.c
Normal file
98
posix/lib/psxdll/pthread/join.c
Normal file
@@ -0,0 +1,98 @@
|
||||
/* $Id: join.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/pthread/join.c
|
||||
* PURPOSE: Wait for thread termination
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 19/12/2001: Created
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ntdll/ldr.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <pthread.h>
|
||||
#include <psx/debug.h>
|
||||
#include <psx/errno.h>
|
||||
|
||||
int pthread_join(pthread_t thread, void **value_ptr)
|
||||
{
|
||||
HANDLE hThread;
|
||||
NTSTATUS nErrCode;
|
||||
OBJECT_ATTRIBUTES oaThreadAttrs;
|
||||
CLIENT_ID ciId;
|
||||
THREAD_BASIC_INFORMATION tbiThreadInfo;
|
||||
|
||||
/* "[EDEADLK] A deadlock was detected or the value of thread specifies
|
||||
the calling thread" */
|
||||
if(thread == pthread_self())
|
||||
return (EDEADLK);
|
||||
|
||||
/* initialize id */
|
||||
ciId.UniqueProcess = (HANDLE)-1;
|
||||
ciId.UniqueThread = (HANDLE)thread;
|
||||
|
||||
/* initialize object attributes */
|
||||
oaThreadAttrs.Length = sizeof(OBJECT_ATTRIBUTES);
|
||||
oaThreadAttrs.RootDirectory = NULL;
|
||||
oaThreadAttrs.ObjectName = NULL;
|
||||
oaThreadAttrs.Attributes = 0;
|
||||
oaThreadAttrs.SecurityDescriptor = NULL;
|
||||
oaThreadAttrs.SecurityQualityOfService = NULL;
|
||||
|
||||
/* open the thread */
|
||||
nErrCode = NtOpenThread
|
||||
(
|
||||
&hThread,
|
||||
SYNCHRONIZE | THREAD_QUERY_INFORMATION,
|
||||
&oaThreadAttrs,
|
||||
&ciId
|
||||
);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
return (__status_to_errno(nErrCode));
|
||||
}
|
||||
|
||||
/* wait for thread termination */
|
||||
nErrCode = NtWaitForSingleObject
|
||||
(
|
||||
hThread,
|
||||
FALSE,
|
||||
NULL
|
||||
);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
NtClose(hThread);
|
||||
return (__status_to_errno(nErrCode));
|
||||
}
|
||||
|
||||
/* get thread basic information (includes return code) */
|
||||
nErrCode = NtQueryInformationThread
|
||||
(
|
||||
hThread,
|
||||
ThreadBasicInformation,
|
||||
&tbiThreadInfo,
|
||||
sizeof(THREAD_BASIC_INFORMATION),
|
||||
NULL
|
||||
);
|
||||
|
||||
NtClose(hThread);
|
||||
|
||||
if(!value_ptr)
|
||||
return (EFAULT);
|
||||
|
||||
*value_ptr = (void *)tbiThreadInfo.ExitStatus;
|
||||
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
22
posix/lib/psxdll/pthread/kill.c
Normal file
22
posix/lib/psxdll/pthread/kill.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/* $Id: kill.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/pthread/kill.c
|
||||
* PURPOSE: Send a signal to a thread
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 15/02/2002: Created
|
||||
*/
|
||||
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
|
||||
int pthread_kill(pthread_t thread, int sig)
|
||||
{
|
||||
return (ENOSYS);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
465
posix/lib/psxdll/pthread/mutex.c
Normal file
465
posix/lib/psxdll/pthread/mutex.c
Normal file
@@ -0,0 +1,465 @@
|
||||
/* $Id: mutex.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/pthread/mutex.c
|
||||
* PURPOSE: Mutex functions
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 19/12/2001: Created
|
||||
*/
|
||||
|
||||
#include <ntos.h>
|
||||
#include <ddk/ntddk.h>
|
||||
#include <sys/types.h>
|
||||
#include <pthread.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <psx/debug.h>
|
||||
#include <psx/pthread.h>
|
||||
#include <psx/errno.h>
|
||||
#include <psx/safeobj.h>
|
||||
|
||||
int pthread_mutex_init(pthread_mutex_t *mutex,
|
||||
const pthread_mutexattr_t *attr)
|
||||
{
|
||||
struct __mutex *pmMutex;
|
||||
struct __mutexattr *pmaMutexAttrs;
|
||||
BOOL bShared;
|
||||
OBJECT_ATTRIBUTES oaMutexAttrs;
|
||||
NTSTATUS nErrCode;
|
||||
|
||||
/* invalid return buffer */
|
||||
if(mutex == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
/* object still open */
|
||||
if(__safeobj_validate(*mutex, __PTHREAD_MUTEX_MAGIC))
|
||||
return (EBUSY);
|
||||
|
||||
if(attr == NULL)
|
||||
{
|
||||
/* use default attributes */
|
||||
/* create new mutex object */
|
||||
pmMutex = (struct __mutex *)malloc(sizeof(struct __mutex));
|
||||
|
||||
/* malloc() failure */
|
||||
if(!pmMutex)
|
||||
return (ENOMEM);
|
||||
|
||||
/* set the attributes */
|
||||
bShared = FALSE;
|
||||
pmMutex->type = PTHREAD_MUTEX_RECURSIVE;
|
||||
}
|
||||
else if(__safeobj_validate(*attr, __PTHREAD_MUTEX_ATTR_MAGIC))
|
||||
{
|
||||
/* use provided attributes */
|
||||
/* create new mutex object */
|
||||
pmMutex = (struct __mutex *)malloc(sizeof(struct __mutex));
|
||||
|
||||
/* malloc() failure */
|
||||
if(!pmMutex)
|
||||
return (ENOMEM);
|
||||
|
||||
/* get the attributes object */
|
||||
pmaMutexAttrs = (struct __mutexattr *) *attr;
|
||||
|
||||
/* set the attributes */
|
||||
bShared = (pmaMutexAttrs->pshared != PTHREAD_PROCESS_PRIVATE);
|
||||
pmMutex->type = pmaMutexAttrs->type;
|
||||
}
|
||||
else
|
||||
return (EINVAL);
|
||||
|
||||
/* necessary for the mutex to be considered valid later */
|
||||
pmMutex->signature = __PTHREAD_MUTEX_MAGIC;
|
||||
|
||||
/* creation of the native mutex object */
|
||||
pmMutex->handle = 0;
|
||||
|
||||
/* initialize generic object attributes */
|
||||
oaMutexAttrs.Length = sizeof(OBJECT_ATTRIBUTES);
|
||||
oaMutexAttrs.RootDirectory = NULL;
|
||||
oaMutexAttrs.ObjectName = NULL;
|
||||
oaMutexAttrs.Attributes = 0;
|
||||
oaMutexAttrs.SecurityDescriptor = NULL;
|
||||
oaMutexAttrs.SecurityQualityOfService = NULL;
|
||||
|
||||
/* process-exclusive mutex */
|
||||
if(bShared)
|
||||
oaMutexAttrs.Attributes |= OBJ_EXCLUSIVE;
|
||||
|
||||
/* try to create the object */
|
||||
nErrCode = NtCreateMutant
|
||||
(
|
||||
&pmMutex->handle,
|
||||
MUTANT_ALL_ACCESS,
|
||||
&oaMutexAttrs,
|
||||
FALSE
|
||||
);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
/* free the internal mutex object */
|
||||
free(pmMutex);
|
||||
/* return errno */
|
||||
return (__status_to_errno(nErrCode));
|
||||
}
|
||||
|
||||
/* return the pointer to the mutex */
|
||||
*mutex = (pthread_mutex_t)pmMutex;
|
||||
|
||||
/* success */
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
int pthread_mutex_destroy(pthread_mutex_t *mutex)
|
||||
{
|
||||
struct __mutex *pmMutex;
|
||||
NTSTATUS nErrCode;
|
||||
MUTANT_BASIC_INFORMATION mbiMutexInfo;
|
||||
|
||||
/* invalid pointer or pointer to invalid object */
|
||||
if(mutex == NULL || !__safeobj_validate(*mutex, __PTHREAD_MUTEX_MAGIC))
|
||||
{
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
pmMutex = (struct __mutex *)*mutex;
|
||||
|
||||
/* query the mutex's status */
|
||||
nErrCode = NtQueryMutant
|
||||
(
|
||||
pmMutex->handle,
|
||||
MutantBasicInformation,
|
||||
&mbiMutexInfo,
|
||||
sizeof(MUTANT_BASIC_INFORMATION),
|
||||
NULL
|
||||
);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
return (__status_to_errno(nErrCode));
|
||||
}
|
||||
|
||||
/* the thread is owned - cannot destroy it */
|
||||
if(mbiMutexInfo.Count <= 0)
|
||||
{
|
||||
return (EBUSY);
|
||||
}
|
||||
|
||||
/* try to close the handle */
|
||||
nErrCode = NtClose(pmMutex->handle);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
return (__status_to_errno(nErrCode));
|
||||
}
|
||||
|
||||
/* free the object, nil the pointer */
|
||||
free(*mutex);
|
||||
*mutex = NULL;
|
||||
|
||||
/* success */
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
int pthread_mutex_lock(pthread_mutex_t *mutex)
|
||||
{
|
||||
struct __mutex * pmMutex;
|
||||
NTSTATUS nErrCode;
|
||||
|
||||
/* invalid pointer or pointer to invalid object */
|
||||
if(mutex == NULL || !__safeobj_validate(*mutex, __PTHREAD_MUTEX_MAGIC))
|
||||
return (EINVAL);
|
||||
|
||||
pmMutex = (struct __mutex *)*mutex;
|
||||
|
||||
/* decide the behavior from the mutex type */
|
||||
switch(pmMutex->type)
|
||||
{
|
||||
case PTHREAD_MUTEX_NORMAL:
|
||||
{
|
||||
/* unconditionally try to lock the mutex */
|
||||
/* FIXME? should we "artificially" hang the thread if it's the mutex owner, since
|
||||
NT mutexes always behave recursively? */
|
||||
|
||||
#if 0
|
||||
if(0 /* mutex owner */ == pthread_self() */)
|
||||
NtDelayExecution(FALSE, NULL);
|
||||
#endif
|
||||
|
||||
nErrCode = NtWaitForSingleObject(pmMutex->handle, FALSE, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
case PTHREAD_MUTEX_ERRORCHECK:
|
||||
{
|
||||
/* prevent a thread from recursively locking the same mutex */
|
||||
if(0 /* mutex owner */ == pthread_self()) /* FIXME: implement the correct logic */
|
||||
return (EDEADLK);
|
||||
else
|
||||
nErrCode = NtWaitForSingleObject(pmMutex->handle, FALSE, NULL);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PTHREAD_MUTEX_RECURSIVE:
|
||||
{
|
||||
/* allow recursive locking */
|
||||
/* ASSERT: this is the default behavior for NT */
|
||||
nErrCode = NtWaitForSingleObject(pmMutex->handle, FALSE, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
/* we should never reach this point */
|
||||
INFO("you should never read this");
|
||||
|
||||
}
|
||||
|
||||
if(nErrCode == STATUS_ABANDONED)
|
||||
{
|
||||
FIXME("mutex abandoned, not sure on what to do: should we try to lock the mutex again?");
|
||||
}
|
||||
else if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
return (__status_to_errno(nErrCode));
|
||||
}
|
||||
|
||||
/* success */
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
int pthread_mutex_trylock(pthread_mutex_t *mutex)
|
||||
{
|
||||
struct __mutex * pmMutex;
|
||||
NTSTATUS nErrCode;
|
||||
MUTANT_BASIC_INFORMATION mbiMutexInfo;
|
||||
|
||||
/* invalid pointer or pointer to invalid object */
|
||||
if(mutex == NULL || !__safeobj_validate(*mutex, __PTHREAD_MUTEX_MAGIC))
|
||||
return (EINVAL);
|
||||
|
||||
pmMutex = (struct __mutex *)*mutex;
|
||||
|
||||
/* query the mutex's status */
|
||||
nErrCode = NtQueryMutant
|
||||
(
|
||||
pmMutex->handle,
|
||||
MutantBasicInformation,
|
||||
&mbiMutexInfo,
|
||||
sizeof(MUTANT_BASIC_INFORMATION),
|
||||
NULL
|
||||
);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
return (__status_to_errno(nErrCode));
|
||||
}
|
||||
|
||||
/* mutex already locked */
|
||||
if(mbiMutexInfo.Count <= 0)
|
||||
return (EBUSY);
|
||||
|
||||
/* mutex not locked - mutex type attribute doesn't matter */
|
||||
nErrCode = NtWaitForSingleObject(pmMutex->handle, FALSE, NULL);
|
||||
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
return (__status_to_errno(nErrCode));
|
||||
}
|
||||
|
||||
/* success */
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
int pthread_mutex_unlock(pthread_mutex_t *mutex)
|
||||
{
|
||||
struct __mutex * pmMutex;
|
||||
NTSTATUS nErrCode;
|
||||
|
||||
/* invalid pointer or pointer to invalid object */
|
||||
if(mutex == NULL || !__safeobj_validate(*mutex, __PTHREAD_MUTEX_MAGIC))
|
||||
return (EINVAL);
|
||||
|
||||
pmMutex = (struct __mutex *)*mutex;
|
||||
|
||||
/* try to release the mutex */
|
||||
nErrCode = NtReleaseMutant(pmMutex->handle, NULL);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
return (__status_to_errno(nErrCode));
|
||||
}
|
||||
|
||||
/* success */
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
/* mutex attributes routines */
|
||||
|
||||
int pthread_mutexattr_init(pthread_mutexattr_t *attr)
|
||||
{
|
||||
struct __mutexattr * pmaMutexAttrs;
|
||||
|
||||
/* invalid return pointer */
|
||||
if(!attr)
|
||||
return (EINVAL);
|
||||
|
||||
/* allocate internal structure for mutex attributes */
|
||||
pmaMutexAttrs = (struct __mutexattr *)malloc(sizeof(struct __mutexattr));
|
||||
|
||||
/* failure */
|
||||
if(pmaMutexAttrs == 0)
|
||||
return (ENOMEM);
|
||||
|
||||
/* attribute defaults */
|
||||
pmaMutexAttrs->pshared = PTHREAD_PROCESS_PRIVATE;
|
||||
pmaMutexAttrs->type = PTHREAD_MUTEX_DEFAULT;
|
||||
|
||||
/* return the pointer to the attributes object */
|
||||
*attr = (pthread_mutexattr_t)pmaMutexAttrs;
|
||||
|
||||
/* success */
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
int pthread_mutexattr_destroy(pthread_mutexattr_t *attr)
|
||||
{
|
||||
/* invalid pointer or pointer to invalid object */
|
||||
if(attr == NULL || !__safeobj_validate(*attr, __PTHREAD_MUTEX_ATTR_MAGIC))
|
||||
return (EINVAL);
|
||||
|
||||
/* deallocate internal structure */
|
||||
free(*attr);
|
||||
|
||||
/* success */
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
#define PTHREAD_MUTEXATTR_GET(PATTR,PVAR,FIELD) \
|
||||
if( \
|
||||
(PATTR) == NULL || \
|
||||
(PVAR) == NULL || \
|
||||
!__safeobj_validate(*(PATTR), __PTHREAD_MUTEX_ATTR_MAGIC) \
|
||||
) \
|
||||
return (EINVAL); \
|
||||
else \
|
||||
{ \
|
||||
(*(PVAR)) = ((struct __mutexattr *)*(PATTR))->FIELD; \
|
||||
return (0); \
|
||||
}
|
||||
|
||||
int pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr,
|
||||
int *pshared)
|
||||
{
|
||||
PTHREAD_MUTEXATTR_GET(attr, pshared, pshared)
|
||||
}
|
||||
|
||||
int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type)
|
||||
{
|
||||
PTHREAD_MUTEXATTR_GET(attr, type, type)
|
||||
}
|
||||
|
||||
int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr,
|
||||
int pshared)
|
||||
{
|
||||
/* invalid pointer or pointer to invalid object */
|
||||
if(attr == NULL || !__safeobj_validate(*attr, __PTHREAD_MUTEX_ATTR_MAGIC))
|
||||
return (EINVAL);
|
||||
|
||||
/* validate value */
|
||||
switch(pshared)
|
||||
{
|
||||
case PTHREAD_PROCESS_SHARED: break;
|
||||
case PTHREAD_PROCESS_PRIVATE: break;
|
||||
default: return (EINVAL);
|
||||
}
|
||||
|
||||
((struct __mutexattr *)*attr)->pshared = pshared;
|
||||
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
|
||||
{
|
||||
/* invalid pointer or pointer to invalid object */
|
||||
if(attr == NULL || !__safeobj_validate(*attr, __PTHREAD_MUTEX_ATTR_MAGIC))
|
||||
return (EINVAL);
|
||||
|
||||
/* validate value */
|
||||
switch(type)
|
||||
{
|
||||
case PTHREAD_MUTEX_NORMAL: break;
|
||||
case PTHREAD_MUTEX_ERRORCHECK: break;
|
||||
case PTHREAD_MUTEX_RECURSIVE: break;
|
||||
default: return (EINVAL);
|
||||
}
|
||||
|
||||
((struct __mutexattr *)*attr)->type = type;
|
||||
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
/* STUBS */
|
||||
|
||||
int pthread_mutex_setprioceiling(pthread_mutex_t *mutex,
|
||||
int prioceiling, int *old_ceiling)
|
||||
{
|
||||
TODO("realtime threads not currently implemented");
|
||||
return (ENOSYS);
|
||||
}
|
||||
|
||||
int pthread_mutex_getprioceiling(const pthread_mutex_t *mutex,
|
||||
int *prioceiling)
|
||||
{
|
||||
TODO("realtime threads not currently implemented");
|
||||
return (ENOSYS);
|
||||
}
|
||||
|
||||
int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr,
|
||||
int *protocol)
|
||||
{
|
||||
TODO("realtime threads not currently implemented");
|
||||
return (ENOSYS);
|
||||
}
|
||||
|
||||
int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr,
|
||||
int protocol)
|
||||
{
|
||||
TODO("realtime threads not currently implemented");
|
||||
return (ENOSYS);
|
||||
}
|
||||
|
||||
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr,
|
||||
int prioceiling)
|
||||
{
|
||||
TODO("realtime threads not currently implemented");
|
||||
return (ENOSYS);
|
||||
}
|
||||
|
||||
int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr,
|
||||
int *prioceiling)
|
||||
{
|
||||
TODO("realtime threads not currently implemented");
|
||||
return (ENOSYS);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
23
posix/lib/psxdll/pthread/self.c
Normal file
23
posix/lib/psxdll/pthread/self.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $Id: self.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/pthread/self.c
|
||||
* PURPOSE: get calling thread's ID
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 27/12/2001: Created
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <sys/types.h>
|
||||
#include <pthread.h>
|
||||
|
||||
pthread_t pthread_self(void)
|
||||
{
|
||||
return ((pthread_t)(NtCurrentTeb()->Cid).UniqueThread);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
33
posix/lib/psxdll/sched/yield.c
Normal file
33
posix/lib/psxdll/sched/yield.c
Normal file
@@ -0,0 +1,33 @@
|
||||
/* $Id: yield.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/sched/yield.c
|
||||
* PURPOSE: Yield processor
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 15/02/2002: Created
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <sched.h>
|
||||
#include <psx/errno.h>
|
||||
|
||||
int sched_yield(void)
|
||||
{
|
||||
NTSTATUS nErrCode;
|
||||
|
||||
nErrCode = NtYieldExecution();
|
||||
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
errno = __status_to_errno(nErrCode);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
25
posix/lib/psxdll/signal/raise.c
Normal file
25
posix/lib/psxdll/signal/raise.c
Normal file
@@ -0,0 +1,25 @@
|
||||
/* $Id: raise.c,v 1.2 2002/02/20 09:17:57 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/signal/raise.c
|
||||
* PURPOSE: Send a signal to the executing process
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 15/02/2002: Created
|
||||
*/
|
||||
|
||||
#include <signal.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
|
||||
int raise(int sig)
|
||||
{
|
||||
/* returns zero if pthread_kill() returned zero, non-zero otherwise */
|
||||
/* pthread_kill() returns the error number and doesn't set errno */
|
||||
return (((errno = pthread_kill(pthread_self(), sig))) == 0 ? (0) : (1));
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
22
posix/lib/psxdll/stdlib/abort.c
Normal file
22
posix/lib/psxdll/stdlib/abort.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/* $Id: abort.c,v 1.2 2002/02/20 09:17:58 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/stdlib/abort.c
|
||||
* PURPOSE: Generate an abnormal process abort
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 15/02/2002: Created
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
|
||||
void abort(void)
|
||||
{
|
||||
raise(SIGABRT);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
51
posix/lib/psxdll/stdlib/exit.c
Normal file
51
posix/lib/psxdll/stdlib/exit.c
Normal file
@@ -0,0 +1,51 @@
|
||||
/* $Id: exit.c,v 1.2 2002/02/20 09:17:58 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/stdlib/exit.c
|
||||
* PURPOSE: Terminate a process
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 27/12/2001: Created
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <stdlib.h>
|
||||
#include <psx/debug.h>
|
||||
|
||||
void exit(int status)
|
||||
{
|
||||
TODO("call all functions registered with atexit()");
|
||||
|
||||
TODO("flush all output streams, close all open streams");
|
||||
TODO("remove all files created by tmpfile()");
|
||||
|
||||
TODO("close all of the file descriptors, directory streams,<2C>conversion \
|
||||
descriptors and message catalogue descriptors");
|
||||
TODO("send SIGCHILD to the parent process");
|
||||
TODO("set parent pid of children to pid of psxss");
|
||||
TODO("detach each attached shared-memory segment");
|
||||
TODO("for each semaphore for which the calling process has set a semadj \
|
||||
value(), add the value to the semval of the semaphore.");
|
||||
TODO("if the process is a controlling process, send SIGHUP to each process \
|
||||
in the foreground process group...");
|
||||
TODO("... and disassociate the terminal from the session");
|
||||
TODO("if the exit causes a process group to become orphaned, and if any \
|
||||
member of the newly-orphaned process group is stopped, send SIGHUP and \
|
||||
SIGCONT to each process in the newly-orphaned process group");
|
||||
TODO("all open named semaphores in the calling process are closed");
|
||||
TODO("remove any memory locks");
|
||||
TODO("destroy memory mappings");
|
||||
TODO("close all open message queue descriptors");
|
||||
|
||||
#if 0
|
||||
ExitProcess(status);
|
||||
#endif
|
||||
|
||||
NtTerminateProcess(NtCurrentProcess(), status);
|
||||
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
55
posix/lib/psxdll/stdlib/malloc.c
Normal file
55
posix/lib/psxdll/stdlib/malloc.c
Normal file
@@ -0,0 +1,55 @@
|
||||
/* $Id: malloc.c,v 1.2 2002/02/20 09:17:58 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/stdlib/malloc.c
|
||||
* PURPOSE: Memory allocator
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 27/12/2001: Created
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <psx/stdlib.h>
|
||||
|
||||
void * malloc(size_t size)
|
||||
{
|
||||
void * pTemp = __malloc(size);
|
||||
|
||||
if(!pTemp)
|
||||
errno = ENOMEM;
|
||||
|
||||
return (pTemp);
|
||||
}
|
||||
|
||||
void free(void * ptr)
|
||||
{
|
||||
__free(ptr);
|
||||
}
|
||||
|
||||
void * calloc(size_t nelem, size_t elsize)
|
||||
{
|
||||
return (__malloc(nelem * elsize));
|
||||
}
|
||||
|
||||
void * realloc(void * ptr, size_t size)
|
||||
{
|
||||
void * pTemp;
|
||||
|
||||
if(size == 0)
|
||||
__free(ptr);
|
||||
|
||||
if(ptr == 0)
|
||||
return __malloc(size);
|
||||
|
||||
pTemp = __realloc(ptr, size);
|
||||
|
||||
if(pTemp == 0)
|
||||
errno = ENOMEM;
|
||||
|
||||
return (pTemp);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
23
posix/lib/psxdll/string/strcoll.c
Normal file
23
posix/lib/psxdll/string/strcoll.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/* $Id: strcoll.c,v 1.2 2002/02/20 09:17:58 hyperion Exp $
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS POSIX+ Subsystem
|
||||
* FILE: subsys/psx/lib/psxdll/string/strcoll.c
|
||||
* PURPOSE: string comparison using collating information
|
||||
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
|
||||
* UPDATE HISTORY:
|
||||
* 20/01/2002: Created
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <psx/debug.h>
|
||||
|
||||
int strcoll(const char *s1, const char *s2)
|
||||
{
|
||||
TODO("locale semantics currently unimplemented");
|
||||
return (strcmp(s1, s2));
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user