comparison src/nt.c @ 462:0784d089fdc9 r21-2-46

Import from CVS: tag r21-2-46
author cvs
date Mon, 13 Aug 2007 11:44:37 +0200
parents c33ae14dd6d0
children 666d73d6ac56
comparison
equal deleted inserted replaced
461:120ed4009e51 462:0784d089fdc9
1419 buf->st_nlink = 2; /* doesn't really matter */ 1419 buf->st_nlink = 2; /* doesn't really matter */
1420 fake_inode = 0; /* this doesn't either I think */ 1420 fake_inode = 0; /* this doesn't either I think */
1421 } 1421 }
1422 else 1422 else
1423 { 1423 {
1424 buf->st_nlink = info.nNumberOfLinks; 1424 buf->st_nlink = (short) info.nNumberOfLinks;
1425 /* Might as well use file index to fake inode values, but this 1425 /* Might as well use file index to fake inode values, but this
1426 is not guaranteed to be unique unless we keep a handle open 1426 is not guaranteed to be unique unless we keep a handle open
1427 all the time (even then there are situations where it is 1427 all the time (even then there are situations where it is
1428 not unique). Reputedly, there are at most 48 bits of info 1428 not unique). Reputedly, there are at most 48 bits of info
1429 (on NTFS, presumably less on FAT). */ 1429 (on NTFS, presumably less on FAT). */
1430 fake_inode = info.nFileIndexLow ^ info.nFileIndexHigh; 1430 fake_inode = info.nFileIndexLow ^ info.nFileIndexHigh;
1431 } 1431 }
1432 1432
1433 /* MSVC defines _ino_t to be short; other libc's might not. */ 1433 /* MSVC defines _ino_t to be short; other libc's might not. */
1434 if (sizeof (buf->st_ino) == 2) 1434 if (sizeof (buf->st_ino) == 2)
1435 buf->st_ino = fake_inode ^ (fake_inode >> 16); 1435 buf->st_ino = (unsigned short) (fake_inode ^ (fake_inode >> 16));
1436 else 1436 else
1437 buf->st_ino = fake_inode; 1437 buf->st_ino = (unsigned short) fake_inode;
1438 1438
1439 /* consider files to belong to current user */ 1439 /* consider files to belong to current user */
1440 buf->st_uid = 0; 1440 buf->st_uid = 0;
1441 buf->st_gid = 0; 1441 buf->st_gid = 0;
1442 1442
1616 1616
1617 /* #### MSVC defines _ino_t to be short; other libc's might not. */ 1617 /* #### MSVC defines _ino_t to be short; other libc's might not. */
1618 buf->st_ino = (unsigned short) (fake_inode ^ (fake_inode >> 16)); 1618 buf->st_ino = (unsigned short) (fake_inode ^ (fake_inode >> 16));
1619 1619
1620 /* consider files to belong to current user */ 1620 /* consider files to belong to current user */
1621 buf->st_uid = buf->st_gid = nt_fake_unix_uid; 1621 buf->st_uid = buf->st_gid = (short) nt_fake_unix_uid;
1622 1622
1623 /* volume_info is set indirectly by map_win32_filename */ 1623 /* volume_info is set indirectly by map_win32_filename */
1624 buf->st_dev = volume_info.serialnum; 1624 buf->st_dev = volume_info.serialnum;
1625 buf->st_rdev = volume_info.serialnum; 1625 buf->st_rdev = volume_info.serialnum;
1626 1626