Page MenuHomeFreeBSD

D45422.1794281826.diff
No OneTemporary

Authored By
Unknown
Size
783 B
Referenced Files
None
Subscribers
None

D45422.1794281826.diff

diff --git a/sys/sys/_iovec.h b/sys/sys/_iovec.h
--- a/sys/sys/_iovec.h
+++ b/sys/sys/_iovec.h
@@ -44,4 +44,22 @@
size_t iov_len; /* Length. */
};
+#define IOVEC_INIT(iovp, base, len) do { \
+ (iovp)->iov_base = (base); \
+ (iovp)->iov_len = (len); \
+} while(0)
+
+#define IOVEC_INIT_STR(iovp, str) \
+ IOVEC_INIT(iovp, str, strlen(str) + 1)
+#define IOVEC_INIT_OBJ(iovp, obj) \
+ IOVEC_INIT(iovp, &(obj), sizeof(obj))
+
+#define IOVEC_ADVANCE(iovp, amt) do { \
+ size_t amount = (amt); \
+ KASSERT(amount <= (iovp)->iov_len, ("%s: amount %zu > iov_len \
+ %zu", __func__, amount, (iovp)->iov_len)); \
+ (iovp)->iov_base = (char *)((iovp)->iov_base) + amount; \
+ (iovp)->iov_len -= amount; \
+} while(0)
+
#endif /* !_SYS__IOVEC_H_ */

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 10, 3:37 AM (7 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41626042
Default Alt Text
D45422.1794281826.diff (783 B)

Event Timeline