Commit e4e4829
authored
Rollup merge of rust-lang#146269 - weihanglo:solaris-flock, r=Mark-Simulacrum
feat(std): emulate flock for solaris via fcntl
Upstream Solaris flock emulation to libstd from cargo.
This is borrowed from
https://github.com/rust-lang/cargo/blob/3b379fcc541b39321a7758552d37e5e0cc4277b9/src/cargo/util/flock.rs#L502-L536 which was implemented by an Oracle employee.
The code has been in cargo since 2022-12.
Python's `fcntl.flock` emulates like this as well: https://github.com/python/cpython/blob/c919d02edecfe9d75fe374756fb8aa1db8d95f55/Modules/fcntlmodule.c#L337-L400
We did the same thing in
https://github.com/rust-lang/rust/blob/0d0f4eac8b98133e5da6d3604d86a8f3b5a67844/compiler/rustc_data_structures/src/flock/unix.rs#L13-L39
However, should we just always falls back to fcntl for all Unix, instead of "unsupported"?
try-job: `*-solaris`2 files changed
+70
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
249 | 250 | | |
250 | 251 | | |
251 | 252 | | |
| 253 | + | |
252 | 254 | | |
253 | 255 | | |
254 | 256 | | |
| |||
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
| 278 | + | |
276 | 279 | | |
277 | 280 | | |
278 | 281 | | |
| |||
294 | 297 | | |
295 | 298 | | |
296 | 299 | | |
| 300 | + | |
297 | 301 | | |
298 | 302 | | |
299 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1293 | 1293 | | |
1294 | 1294 | | |
1295 | 1295 | | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
1296 | 1305 | | |
1297 | 1306 | | |
1298 | 1307 | | |
1299 | 1308 | | |
1300 | 1309 | | |
1301 | 1310 | | |
1302 | 1311 | | |
| 1312 | + | |
1303 | 1313 | | |
1304 | 1314 | | |
1305 | 1315 | | |
| |||
1320 | 1330 | | |
1321 | 1331 | | |
1322 | 1332 | | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
1323 | 1342 | | |
1324 | 1343 | | |
1325 | 1344 | | |
1326 | 1345 | | |
1327 | 1346 | | |
1328 | 1347 | | |
1329 | 1348 | | |
| 1349 | + | |
1330 | 1350 | | |
1331 | 1351 | | |
1332 | 1352 | | |
| |||
1355 | 1375 | | |
1356 | 1376 | | |
1357 | 1377 | | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1358 | 1395 | | |
1359 | 1396 | | |
1360 | 1397 | | |
1361 | 1398 | | |
1362 | 1399 | | |
1363 | 1400 | | |
1364 | 1401 | | |
| 1402 | + | |
1365 | 1403 | | |
1366 | 1404 | | |
1367 | 1405 | | |
| |||
1393 | 1431 | | |
1394 | 1432 | | |
1395 | 1433 | | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
1396 | 1451 | | |
1397 | 1452 | | |
1398 | 1453 | | |
1399 | 1454 | | |
1400 | 1455 | | |
1401 | 1456 | | |
1402 | 1457 | | |
| 1458 | + | |
1403 | 1459 | | |
1404 | 1460 | | |
1405 | 1461 | | |
| |||
1423 | 1479 | | |
1424 | 1480 | | |
1425 | 1481 | | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
1426 | 1491 | | |
1427 | 1492 | | |
1428 | 1493 | | |
1429 | 1494 | | |
1430 | 1495 | | |
1431 | 1496 | | |
1432 | 1497 | | |
| 1498 | + | |
1433 | 1499 | | |
1434 | 1500 | | |
1435 | 1501 | | |
| |||
0 commit comments