diff --git a/src/emx/src/lib/sys/b_fsFileStat.c b/src/emx/src/lib/sys/b_fsFileStat.c
index d544018..b49339f 100755
a
|
b
|
int __libc_Back_fsFileStat(const char *pszPath, struct stat *pStat)
|
53 | 53 | char szNativePath[PATH_MAX]; |
54 | 54 | int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL | BACKFS_FLAGS_RESOLVE_DIR_MAYBE, szNativePath, NULL); |
55 | 55 | if (!rc) |
| 56 | { |
| 57 | /* |
| 58 | * Check if DASD mode is requested. |
| 59 | */ |
| 60 | if (pszPath[1] == ':' && pszPath[2] == '\0') |
| 61 | szNativePath[2] = '\0'; |
| 62 | |
56 | 63 | rc = __libc_back_fsNativeFileStat(szNativePath, pStat); |
| 64 | } |
57 | 65 | |
58 | 66 | if (!rc) |
59 | 67 | LIBCLOG_RETURN_INT(rc); |
diff --git a/src/emx/src/lib/sys/b_fsFileStatFH.c b/src/emx/src/lib/sys/b_fsFileStatFH.c
index b987bde..3f7a9fb 100755
a
|
b
|
int __libc_Back_fsFileStatFH(int fh, struct stat *pStat)
|
86 | 86 | pStat->st_nlink = 1; |
87 | 87 | pStat->st_blksize = 4096*12; /* 48KB */ |
88 | 88 | |
89 | | if ((pFH->fFlags & __LIBC_FH_TYPEMASK) == F_FILE) |
| 89 | int fDasdMode = 0; |
| 90 | ULONG fulMode; |
| 91 | |
| 92 | if (!DosQueryFHState(fh, &fulMode)) |
| 93 | fDasdMode = fulMode & OPEN_FLAGS_DASD; |
| 94 | |
| 95 | if ((pFH->fFlags & __LIBC_FH_TYPEMASK) == F_FILE && !fDasdMode) |
90 | 96 | { |
91 | 97 | /* |
92 | 98 | * Regular OS/2 file. |
diff --git a/src/emx/src/lib/sys/b_fsNativeFileStat.c b/src/emx/src/lib/sys/b_fsNativeFileStat.c
index 713bf5c..9f9e8a8 100755
a
|
b
|
int __libc_back_fsNativeFileStat(const char *pszNativePath, struct stat *pStat)
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /* |
| 119 | * If a drive in DASD mode, make a fake unix sutff |
| 120 | */ |
| 121 | if ( (pszNativePath[0] >= 'A' && pszNativePath[0] <= 'Z') |
| 122 | && (pszNativePath[1] == ':' && !pszNativePath[2])) |
| 123 | { |
| 124 | ULONG ulDiskNum = pszNativePath[0] - 'A' + 1; |
| 125 | FSALLOCATE fsalloc; |
| 126 | FSINFO fsinfo; |
| 127 | int rc; |
| 128 | |
| 129 | rc = DosQueryFSInfo(ulDiskNum, FSIL_ALLOC, &fsalloc, sizeof(fsalloc)); |
| 130 | if (rc) |
| 131 | { |
| 132 | rc = -__libc_native2errno(rc); |
| 133 | LIBCLOG_ERROR_RETURN_INT(rc); |
| 134 | } |
| 135 | |
| 136 | /* fake unix stuff */ |
| 137 | /** @todo this doesn't entirely match the open and file handle stat code. |
| 138 | * Fortunately, the user will not see that unless won't have the filename... */ |
| 139 | pStat->st_dev = __libc_back_fsPathCalcInodeAndDev(pszNativePath, &pStat->st_ino); |
| 140 | pStat->st_attr = FILE_NORMAL; |
| 141 | pStat->st_mode = S_IFREG | S_IRWXO | S_IRWXG | S_IRWXU; |
| 142 | pStat->st_uid = 0; |
| 143 | pStat->st_gid = 0; |
| 144 | pStat->st_rdev = 0; /* b_ioFileOpen depends on this being 0 for devices! */ |
| 145 | pStat->st_nlink = 1; |
| 146 | pStat->st_size = (off_t)fsalloc.cUnit * fsalloc.cSectorUnit * fsalloc.cbSector; |
| 147 | pStat->st_blocks = pStat->st_size / S_BLKSIZE; |
| 148 | pStat->st_blksize = 4096 * 12; /* 48kb */ |
| 149 | pStat->st_atime = 0; |
| 150 | pStat->st_mtime = 0; |
| 151 | pStat->st_ctime = 0; |
| 152 | pStat->st_birthtime = 0; |
| 153 | LIBCLOG_RETURN_INT(0); |
| 154 | } |
| 155 | |
| 156 | /* |
119 | 157 | * Get path info. |
120 | 158 | */ |
121 | 159 | FS_SAVE_LOAD(); |
diff --git a/src/emx/src/lib/sys/b_ioFileOpen.c b/src/emx/src/lib/sys/b_ioFileOpen.c
index cf2b05c..7cdb43a 100755
a
|
b
|
int __libc_Back_ioFileOpen(const char *pszFile, unsigned fLibc, int fShare, off_
|
153 | 153 | if (rc) |
154 | 154 | LIBCLOG_ERROR_RETURN_INT(rc); |
155 | 155 | |
| 156 | /* |
| 157 | * Check if DASD mode is requsted. |
| 158 | */ |
| 159 | if (pszFile[1] == ':' && !pszFile[2]) |
| 160 | { |
| 161 | szNativePath[2] = '\0'; |
| 162 | flOpenMode |= OPEN_FLAGS_DASD; |
| 163 | } |
| 164 | |
156 | 165 | dev_t Dev = 0; |
157 | 166 | ino_t Inode = 0; |
158 | 167 | PEAOP2 pEaOp2 = NULL; |