mirror of
https://github.com/ksherlock/mpw.git
synced 2024-06-08 18:29:28 +00:00
OS::Close
This commit is contained in:
parent
1aa5c048ad
commit
9e6176001a
|
@ -273,6 +273,30 @@ namespace OS
|
|||
return false;
|
||||
}
|
||||
|
||||
uint16_t Close(uint16_t trap)
|
||||
{
|
||||
uint32_t d0;
|
||||
uint32_t parm = cpuGetAReg(0);
|
||||
|
||||
Log("%04x Close(%08x)\n", trap, parm);
|
||||
|
||||
//uint32_t ioCompletion = memoryReadLong(parm + 12);
|
||||
uint16_t ioRefNum = memoryReadWord(parm + 24);
|
||||
|
||||
int rv = ::close(ioRefNum);
|
||||
if (rv < 0)
|
||||
{
|
||||
d0 = errno_to_oserr(errno);
|
||||
}
|
||||
else
|
||||
{
|
||||
d0 = 0;
|
||||
}
|
||||
|
||||
|
||||
memoryWriteWord(d0, parm + 16);
|
||||
return d0;
|
||||
}
|
||||
|
||||
|
||||
uint16_t Create(uint16_t trap)
|
||||
|
|
|
@ -126,6 +126,7 @@ namespace OS
|
|||
|
||||
|
||||
#pragma mark FS Utilities
|
||||
uint16_t Close(uint16_t trap);
|
||||
uint16_t Create(uint16_t trap);
|
||||
uint16_t Delete(uint16_t trap);
|
||||
|
||||
|
|
|
@ -34,6 +34,10 @@ namespace ToolBox {
|
|||
d0 = OS::Open(trap);
|
||||
break;
|
||||
|
||||
case 0xa001:
|
||||
d0 = OS::Close(trap);
|
||||
break;
|
||||
|
||||
case 0xa002:
|
||||
d0 = OS::Read(trap);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue
Block a user