mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-25 22:14:37 +00:00
linux: Add more debug messages for newfstatat syscall
This commit is contained in:
parent
acabadaaab
commit
547ae94f80
@ -2902,10 +2902,11 @@ static long linux_newfstatat(SysFrm *, int dirfd, const char *pathname,
|
||||
if (pPathname == nullptr || pStatbuf == nullptr)
|
||||
return -linux_EFAULT;
|
||||
|
||||
debug("%s %#lx %#lx", pPathname, pathname, statbuf);
|
||||
debug("\"%s\" %#lx %#lx", pPathname, pathname, statbuf);
|
||||
|
||||
if (fs->PathIsAbsolute(pPathname))
|
||||
{
|
||||
debug("path \"%s\" is absolute", pPathname);
|
||||
struct kstat nstat = KStatToStat(*pStatbuf);
|
||||
int ret = fdt->usr_stat(pPathname, &nstat);
|
||||
*pStatbuf = StatToKStat(nstat);
|
||||
@ -2916,6 +2917,7 @@ static long linux_newfstatat(SysFrm *, int dirfd, const char *pathname,
|
||||
{
|
||||
case linux_AT_FDCWD:
|
||||
{
|
||||
debug("dirfd is AT_FDCWD for \"%s\"", pPathname);
|
||||
FileNode *node = fs->GetByPath(pPathname, pcb->CWD);
|
||||
if (!node)
|
||||
return -linux_ENOENT;
|
||||
@ -2927,12 +2929,14 @@ static long linux_newfstatat(SysFrm *, int dirfd, const char *pathname,
|
||||
}
|
||||
default:
|
||||
{
|
||||
debug("dirfd is %d for \"%s\"", dirfd, pPathname);
|
||||
auto it = fdt->FileMap.find(dirfd);
|
||||
if (it == fdt->FileMap.end())
|
||||
ReturnLogError(-linux_EBADF, "Invalid fd %d", dirfd);
|
||||
|
||||
vfs::FileDescriptorTable::Fildes &fildes = it->second;
|
||||
FileNode *node = fs->GetByPath(pPathname, fildes.Node);
|
||||
debug("node: %s", node->GetPath().c_str());
|
||||
if (!node)
|
||||
return -linux_ENOENT;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user