Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177393559
D45422.1794281826.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
783 B
Referenced Files
None
Subscribers
None
D45422.1794281826.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D45422: iovec: macros to manipulate len and base together
Attached
Detach File
Event Timeline