summaryrefslogtreecommitdiff
path: root/mbr.h
diff options
context:
space:
mode:
authorsrs5694 <srs5694@users.sourceforge.net>2010-01-12 18:18:36 -0500
committersrs5694 <srs5694@users.sourceforge.net>2010-01-12 18:18:36 -0500
commitba00fed2efd6c0cba60da9afb0ce3dff84fc69f9 (patch)
tree195d68fe263771efd95eccf4035750efbd975d9b /mbr.h
parent73ba4794a4b05c4bf4ff191bff2e023e706744fb (diff)
downloadsgdisk-ba00fed2efd6c0cba60da9afb0ce3dff84fc69f9.tar.gz
sgdisk program, misc. bug fixes
Diffstat (limited to 'mbr.h')
-rw-r--r--mbr.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/mbr.h b/mbr.h
index 8f7dfbc..0cd4d2a 100644
--- a/mbr.h
+++ b/mbr.h
@@ -30,6 +30,7 @@ using namespace std;
// Data for a single MBR partition record
// Note that firstSector and lastSector are in CHS addressing, which
// splits the bits up in a weird way.
+#pragma pack(1)
struct MBRRecord {
uint8_t status;
uint8_t firstSector[3];
@@ -43,6 +44,7 @@ struct MBRRecord {
// go, for the benefit of FreeBSD which seems to flake out when loading
// from block devices in multiples other than the block size.
// Also used when loading logical partitions.
+#pragma pack(1)
struct TempMBR {
uint8_t code[440];
uint32_t diskSignature;
@@ -81,12 +83,13 @@ public:
// File I/O functions...
int ReadMBRData(char* deviceFilename);
void ReadMBRData(int fd, int checkBlockSize = 1);
+ // ReadLogicalPart() returns last partition # read to logicals[] array,
+ // or -1 if there was a problem....
int ReadLogicalPart(int fd, uint32_t extendedStart, uint32_t diskOffset,
int partNum);
int WriteMBRData(void);
void WriteMBRData(int fd);
- // ReadLogicalPart() returns last partition # read to logicals[] array,
- // or -1 if there was a problem....
+ int WriteMBRData(char* deviceFilename);
// Display data for user...
void DisplayMBRData(void);