aboutsummaryrefslogtreecommitdiffstats
path: root/com32/gplinclude/disk
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-04-21 09:56:11 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-04-21 09:56:11 -0700
commitbdeb4237ed17d2deab8ecf3cb95721047731cc3c (patch)
treeab4f653c7f7577fb951b2a8acbac6512733fb863 /com32/gplinclude/disk
parent731660cc2060f3bfdf5cd916bce1573985df6408 (diff)
downloadsyslinux-bdeb4237ed17d2deab8ecf3cb95721047731cc3c.tar.gz
syslinux-bdeb4237ed17d2deab8ecf3cb95721047731cc3c.tar.xz
syslinux-bdeb4237ed17d2deab8ecf3cb95721047731cc3c.zip
gpllib: Propagate error codes in disk library
It is worth propagating read/write error codes back to the caller. He can pass NULL to ignore them, or an int* that will be populated. To decode it, one can use the get_error function (see disk/error.c). Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32/gplinclude/disk')
-rw-r--r--com32/gplinclude/disk/read.h11
-rw-r--r--com32/gplinclude/disk/write.h17
2 files changed, 17 insertions, 11 deletions
diff --git a/com32/gplinclude/disk/read.h b/com32/gplinclude/disk/read.h
index 79c79524..fee10daf 100644
--- a/com32/gplinclude/disk/read.h
+++ b/com32/gplinclude/disk/read.h
@@ -1,7 +1,10 @@
#ifndef _READ_H_
#define _READ_H_
-void *read_mbr(int drive);
-void *dev_read(int drive, unsigned int lba, int sectors);
-void *read_sectors(struct driveinfo* drive_info, const unsigned int lba,
- const int sectors);
+
+#include <disk/geom.h>
+
+void *read_mbr(int, int*);
+void *dev_read(int, unsigned int, int, int*);
+void *read_sectors(struct driveinfo*, const unsigned int,
+ const int, int *);
#endif /* _READ_H */
diff --git a/com32/gplinclude/disk/write.h b/com32/gplinclude/disk/write.h
index 89ca8736..be6494fa 100644
--- a/com32/gplinclude/disk/write.h
+++ b/com32/gplinclude/disk/write.h
@@ -1,11 +1,14 @@
#ifndef _WRITE_H_
#define _WRITE_H_
-int write_sectors(const struct driveinfo* drive_info, const unsigned int lba,
- const void *data, const int size);
+
+#include <disk/geom.h>
+
+int write_sectors(const struct driveinfo*, const unsigned int,
+ const void *, const int, int *);
int write_verify_sector(struct driveinfo* drive_info,
- const unsigned int lba,
- const void *data);
-int write_verify_sectors(struct driveinfo* drive_info,
- const unsigned int lba,
- const void *data, const int size);
+ const unsigned int,
+ const void *, int*);
+int write_verify_sectors(struct driveinfo*,
+ const unsigned int,
+ const void *, const int, int *);
#endif