1 /* ----------------------------------------------------------------------- *
3 * Copyright 2010 Intel Corp. - All Rights Reserved
4 * Copyright 2015 Paulo Alcantara <pcacjr@zytor.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 * Boston MA 02111-1307, USA; either version 2 of the License, or
10 * (at your option) any later version; incorporated herein by reference.
12 * ----------------------------------------------------------------------- */
23 static void die(const char *msg
)
30 * read/write wrapper functions
32 ssize_t
xpread(int fd
, void *buf
, size_t count
, off_t offset
)
34 char *bufp
= (char *)buf
;
39 rv
= pread(fd
, bufp
, count
, offset
);
42 } else if (rv
== -1) {
59 ssize_t
xpwrite(int fd
, const void *buf
, size_t count
, off_t offset
)
61 const char *bufp
= (const char *)buf
;
66 rv
= pwrite(fd
, bufp
, count
, offset
);
69 } else if (rv
== -1) {