implement rename ioctl

This commit is contained in:
Kelvin Sherlock 2015-09-23 22:54:33 -04:00
parent 115acb493b
commit 4af7d59c9c

View File

@ -124,7 +124,6 @@ namespace MPW
uint32_t ftrap_delete(uint32_t name)
{
std::string sname;
int rv;
@ -139,6 +138,22 @@ namespace MPW
}
uint32_t ftrap_rename(uint32_t src, uint32_t dest)
{
std::string sname;
std::string dname;
int rv;
sname = ToolBox::ReadCString(src, true);
dname = ToolBox::ReadCString(dest, true);
Log(" rename(%s, %s)\n", sname.c_str(), dname.c_str());
rv = rename(sname.c_str(), dname.c_str());
if (rv < 0) return 0x40000000 | mpw_errno_from_errno();
return 0;
}
uint32_t ftrap_open(uint32_t name, uint32_t parm)
{
@ -252,6 +267,10 @@ namespace MPW
d0 = ftrap_delete(name);
break;
case kF_RENAME:
d0 = ftrap_rename(name, parm);
break;
case kF_GTABINFO:
d0 = ftrap_get_tab_info(name, parm);
break;