mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-09 07:19:21 +01:00
690bd6ccbd
This reverts commit 865af4609c49015c64f4092fd53315a1110b8042. Turns out it is for whole filesystem. oops.
31 lines
663 B
C
31 lines
663 B
C
#include "devoptab_fs.h"
|
|
|
|
int
|
|
__wut_fs_fstat(struct _reent *r,
|
|
void *fd,
|
|
struct stat *st)
|
|
{
|
|
FSStatus rc;
|
|
FSStat fsstat;
|
|
__wut_fs_file_t *file = (__wut_fs_file_t *)fd;
|
|
|
|
// Set up command block
|
|
FSCmdBlock fsCmd;
|
|
FSInitCmdBlock(&fsCmd);
|
|
|
|
rc = FSGetStatFile(__wut_devoptab_fs_client, &fsCmd, file->fd, &fsstat, -1);
|
|
|
|
if (rc >= 0) {
|
|
memset(st, 0, sizeof(struct stat));
|
|
st->st_size = fsstat.size;
|
|
st->st_uid = fsstat.owner;
|
|
st->st_gid = fsstat.group;
|
|
st->st_nlink = 1;
|
|
st->st_mode = fsstat.mode;
|
|
return 0;
|
|
}
|
|
|
|
r->_errno = __wut_fs_translate_error(rc);
|
|
return -1;
|
|
}
|