MCPcopy Create free account
hub / github.com/Inori/GPCS4 / scek_fstat

Function scek_fstat

GPCS4/SceModules/SceLibkernel/sce_kernel_file.cpp:230–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228
229
230int PS4API scek_fstat(int fd, SceKernelStat *sb)
231{
232 LOG_SCE_TRACE("fd %d sb %p", fd, sb);
233
234 struct stat stat;
235 int ret = fstat(fd, &stat);
236 sb->st_mode = getSceFileMode(stat.st_mode);
237 sb->st_size = stat.st_size;
238 if (stat.st_mode & _S_IFMT & _S_IFDIR)
239 {
240 // TODO
241 sb->st_blocks = 0; // UtilPath::FileCountInDirectory(pcPath);
242 sb->st_blksize = sizeof(SceKernelDirent);
243 }
244 else
245 {
246 sb->st_blocks = stat.st_size / SSD_BLOCK_SIZE + (stat.st_size % SSD_BLOCK_SIZE) ? 1 : 0;
247 sb->st_blksize = SSD_BLOCK_SIZE;
248 }
249 return ret;
250}
251
252
253int PS4API sceKernelStat(const char *path, SceKernelStat *sb)

Callers

nothing calls this directly

Calls 1

getSceFileModeFunction · 0.85

Tested by

no test coverage detected