diff options
Diffstat (limited to 'mbr/mbr.ha')
| -rw-r--r-- | mbr/mbr.ha | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -29,22 +29,3 @@ export fn validate(self: *mbr) bool = { return true; }; - -// Gets a handle to the MBR of a partition. -// Return value is returned to user. Resource should be freed with mbr::finish. -export fn from(fd: io::file) (*mbr | nombr | errors::error) = { - const self = io::mmap(null, sector::length, io::prot::READ | io::prot::WRITE, io::mflags::SHARED, fd, sector::lba(mbr_lba))!: *mbr; - - if (!validate(self)) { - io::munmap(self, sector::length)?; - return nombr; - }; - - return self; -}; - -// Frees the resources associated with the MBR partition. -// User revokes ownership. -export fn finish(self: *mbr) (void | errors::error) = { - io::munmap(self, sector::length)?; -}; |
