From 5fa3142cdbb67cbb8287b2ec4fc35ee6532b3c6d Mon Sep 17 00:00:00 2001 From: Kiyoshi Aman Date: Thu, 16 May 2019 11:47:54 -0500 Subject: bin/dd: make buildable with libbsd --- bin/dd/dd.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'bin/dd/dd.h') diff --git a/bin/dd/dd.h b/bin/dd/dd.h index 2b2712d..c630c0a 100644 --- a/bin/dd/dd.h +++ b/bin/dd/dd.h @@ -36,6 +36,10 @@ */ #include +#include +#include +#include +#include struct ddfops { int (*op_init)(void); @@ -44,7 +48,7 @@ struct ddfops { int (*op_close)(int); int (*op_fcntl)(int, int, ...); - int (*op_ioctl)(int, unsigned long, ...); + int (*op_ioctl)(int, int, ...); int (*op_fstat)(int, struct stat *); int (*op_fsync)(int); @@ -56,10 +60,10 @@ struct ddfops { ssize_t (*op_write)(int, const void *, size_t); }; -#define ddop_open(dir, a1, a2, ...) dir.ops->op_open(a1, a2, __VA_ARGS__) +#define ddop_open(dir, a1, a2, ...) dir.ops->op_open(a1, a2, ##__VA_ARGS__) #define ddop_close(dir, a1) dir.ops->op_close(a1) -#define ddop_fcntl(dir, a1, a2, ...) dir.ops->op_fcntl(a1, a2, __VA_ARGS__) -#define ddop_ioctl(dir, a1, a2, ...) dir.ops->op_ioctl(a1, a2, __VA_ARGS__) +#define ddop_fcntl(dir, a1, a2, ...) dir.ops->op_fcntl(a1, a2, ##__VA_ARGS__) +#define ddop_ioctl(dir, a1, a2, ...) dir.ops->op_ioctl(a1, a2, ##__VA_ARGS__) #define ddop_fsync(dir, a1) dir.ops->op_fsync(a1) #define ddop_ftruncate(dir, a1, a2) dir.ops->op_ftruncate(a1, a2) #define ddop_lseek(dir, a1, a2, a3) dir.ops->op_lseek(a1, a2, a3) @@ -68,8 +72,8 @@ struct ddfops { /* Input/output stream state. */ typedef struct { - u_char *db; /* buffer address */ - u_char *dbp; /* current buffer I/O address */ + unsigned char *db; /* buffer address */ + unsigned char *dbp; /* current buffer I/O address */ uint64_t dbcnt; /* current buffer byte count */ int64_t dbrcnt; /* last read byte count */ uint64_t dbsz; /* buffer size */ @@ -78,7 +82,7 @@ typedef struct { #define ISPIPE 0x02 /* pipe (not truncatable) */ #define ISTAPE 0x04 /* tape (not seekable) */ #define NOREAD 0x08 /* not readable */ - u_int flags; + unsigned int flags; const char *name; /* name */ int fd; /* file descriptor */ -- cgit v1.2.3-60-g2f50