Changeset 1750
- Timestamp:
- Dec 21, 2004, 2:38:04 AM (21 years ago)
- Location:
- trunk/src/emx
- Files:
-
- 10 edited
-
include/emx/io.h (modified) (1 diff, 1 prop)
-
src/lib/sys/__dup.c (modified) (1 diff, 1 prop)
-
src/lib/sys/__dup2.c (modified) (1 diff, 1 prop)
-
src/lib/sys/b_fs.h (modified) (3 diffs, 1 prop)
-
src/lib/sys/b_fsDirCreate.c (modified) (1 diff, 1 prop)
-
src/lib/sys/b_fsFileStatFH.c (modified) (1 diff, 1 prop)
-
src/lib/sys/b_fsNativeFileStat.c (modified) (1 diff, 1 prop)
-
src/lib/sys/b_ioFileOpen.c (modified) (3 diffs, 1 prop)
-
src/lib/sys/filehandles.c (modified) (1 diff, 1 prop)
-
src/lib/sys/fs.c (modified) (3 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/emx/io.h
-
Property cvs2svn:cvs-rev
changed from
1.13to1.14
r1749 r1750 373 373 __LIBC_PCFHOPS pOps; 374 374 375 376 377 378 379 380 381 382 375 383 } __LIBC_FH; 376 384 /** Pointer to filehandle. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__dup.c
-
Property cvs2svn:cvs-rev
changed from
1.6to1.7
r1749 r1750 57 57 pFHNew->fFlags = pFH->fFlags; 58 58 pFHNew->iLookAhead = pFH->iLookAhead; 59 60 59 61 } 60 62 else -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__dup2.c
-
Property cvs2svn:cvs-rev
changed from
1.5to1.6
r1749 r1750 90 90 pFHNew->fFlags = pFH->fFlags; 91 91 pFHNew->iLookAhead = pFH->iLookAhead; 92 93 92 94 } 93 95 else -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fs.h
-
Property cvs2svn:cvs-rev
changed from
1.2to1.3
r1749 r1750 31 31 #include <sys/syslimits.h> 32 32 #include <sys/types.h> 33 33 34 #include <InnoTekLIBC/sharedpm.h> 34 35 #include "backend.h" … … 136 137 /** 137 138 * Creates the unix EAs for a new file or directory. 139 138 140 * @returns 0 on success. 139 141 * @returns Negative errno on failure. 140 142 * @param hFile File handle to the newly created fs object. If no 141 143 * handle handy, set to -1. 142 * @param pszNativePath Native path of the newly created fs object. If 143 * handle is give this will be ignored. 144 * @param pszNativePath Native path to the newly created fs object. 144 145 * @param mode The specified file permission mode mask. 145 */ 146 int __libc_back_fsUnixAttribsSet(int hFile, const char *pszNativePath, mode_t mode); 146 * @param pDev Where to store the dev number. 147 * @param pInode Where to store the calculated inode number. 148 */ 149 int __libc_back_fsUnixAttribsSet(int hFile, const char *pszNativePath, mode_t mode, dev_t *pDev, ino_t *pInode); 147 150 148 151 /** … … 197 200 int __libc_back_fsNativeFileStat(const char *pszNativePath, struct stat *pStat); 198 201 202 203 204 205 206 207 208 209 210 211 212 199 213 200 214 __END_DECLS -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsDirCreate.c
-
Property cvs2svn:cvs-rev
changed from
1.5to1.6
r1749 r1750 71 71 if (!rc) 72 72 { 73 __libc_back_fsUnixAttribsSet(-1, &szNativePath[0], Mode );73 __libc_back_fsUnixAttribsSet(-1, &szNativePath[0], Mode); 74 74 LIBCLOG_RETURN_INT(0); 75 75 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsFileStatFH.c
-
Property cvs2svn:cvs-rev
changed from
1.6to1.7
r1749 r1750 93 93 pStat->st_uid = 0; 94 94 pStat->st_gid = 0; 95 pStat->st_ino = _sys_ino++; 96 if (_sys_ino == 0) 97 _sys_ino = 1; 98 pStat->st_dev = 0; 95 pStat->st_ino = pFH->Inode; 96 pStat->st_dev = pFH->Dev; 99 97 pStat->st_rdev = 0; 100 98 pStat->st_nlink = 1; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsNativeFileStat.c
-
Property cvs2svn:cvs-rev
changed from
1.6to1.7
r1749 r1750 188 188 pStat->st_uid = 0; 189 189 pStat->st_gid = 0; 190 pStat->st_ino = _sys_ino++; 191 if (_sys_ino == 0) 192 _sys_ino = 1; 193 pStat->st_dev = 0; 190 pStat->st_dev = __libc_back_fsPathCalcInodeAndDev(pszNativePath, &pStat->st_ino); 194 191 pStat->st_rdev = 0; 195 192 pStat->st_nlink = 1; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_ioFileOpen.c
-
Property cvs2svn:cvs-rev
changed from
1.3to1.4
r1749 r1750 174 174 ULONG fulType; 175 175 ULONG fulDevFlags; 176 177 176 178 177 179 /* … … 180 182 if ( (ulAction == FILE_CREATED) 181 183 && !__libc_gfNoUnix) 182 __libc_back_fsUnixAttribsSet(hFile, NULL, Mode); 184 __libc_back_fsUnixAttribsSet(hFile, pszFile, Mode, &Dev, &Inode); 185 else 186 Dev = __libc_back_fsPathCalcInodeAndDev(szNativePath, &(*ppFH)->Inode); 187 183 188 184 189 /* … … 203 208 204 209 /* 205 * Register the handle. 210 * Register the handle and calc Dev and Inode. 211 * We calc the Dev/Inode regardless of whether it's stored in an EA or not. 206 212 */ 207 213 rc = __libc_FHAllocate(hFile, fLibc, sizeof(LIBCFH), NULL, ppFH, NULL); 208 LIBCLOG_MSG("hFile=%#lx fLibc=%#x fulType=%#lx ulAction=%lu\n", 209 hFile, fLibc, fulType, ulAction); 214 if (!rc) 215 { 216 if (ppFH) 217 { 218 (*ppFH)->Dev = Dev; 219 (*ppFH)->Inode = Inode; 220 } 221 LIBCLOG_MSG("hFile=%#lx fLibc=%#x fulType=%#lx ulAction=%lu Dev=%#x Inode=%#llx\n", 222 hFile, fLibc, fulType, ulAction, Dev, Inode); 223 } 210 224 } 211 225 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/filehandles.c
-
Property cvs2svn:cvs-rev
changed from
1.16to1.17
r1749 r1750 735 735 pFH->iLookAhead = -1; 736 736 pFH->pOps = pOps; 737 738 739 740 737 741 738 742 /* -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/fs.c
-
Property cvs2svn:cvs-rev
changed from
1.12to1.13
r1749 r1750 187 187 *******************************************************************************/ 188 188 static int fsResolveUnix(const char *pszUserPath, unsigned fFlags, char *pszNativePath, int *pfInUnixTree); 189 190 191 189 192 190 193 … … 1234 1237 /** 1235 1238 * Creates the unix EAs for a new file or directory. 1239 1236 1240 * @returns 0 on success. 1237 1241 * @returns Negative errno on failure. 1238 1242 * @param hFile File handle to the newly created fs object. If no 1239 1243 * handle handy, set to -1. 1240 * @param pszNativePath Native path to the newly created fs object. If 1241 * handle is give this will be ignored. 1244 * @param pszNativePath Native path to the newly created fs object. 1242 1245 * @param mode The specified file permission mode mask. 1246 1247 1243 1248 */ 1244 int __libc_back_fsUnixAttribsSet(int hFile, const char *pszNativePath, mode_t mode) 1245 { 1246 /* later */ 1249 int __libc_back_fsUnixAttribsSet(int hFile, const char *pszNativePath, mode_t mode, dev_t *pDev, ino_t *pInode) 1250 { 1251 /* 1252 * Calc device. 1253 */ 1254 dev_t Dev; 1255 char chDrv = *pszNativePath; 1256 if (chDrv == '/' || chDrv == '\\') 1257 Dev = makedev('U', 0); /* U as in UNC */ 1258 else 1259 { 1260 /* ASSUMES that pszNativePath contains a driveletter! If not fix the resolver!!! */ 1261 if (chDrv >= 'a' && chDrv <= 'z') 1262 chDrv -= 'a' - 'A'; 1263 Dev = makedev('V', chDrv); /* V as in Volume */ 1264 } 1265 1266 /* 1267 * Calc Inode number. 1268 * 1269 * Whether to use another hash algorithm here is a bit in the blue now 1270 * because the stored value might be inaccessible at times. 1271 */ 1272 const char *psz = pszNativePath; 1273 if (psz[1] == ':') 1274 psz += 2; 1275 ino_t Inode = ((uint64_t)crc32str(psz) << 32) | (uint64_t)djb2(psz); 1276 1277 /** @todo Save unix EAs! */ 1278 if (pDev) 1279 *pDev = Dev; 1280 if (pInode) 1281 *pInode = (Inode & 0xffffffff00000000ULL) | (uint64_t)sdbm(psz); 1247 1282 return 0; 1248 1283 } 1284 1249 1285 1250 1286 /** … … 1339 1375 1340 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
