aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/sbuf.h
diff options
context:
space:
mode:
authorMikolaj Golub <trociny@FreeBSD.org>2013-04-11 19:49:18 +0000
committerMikolaj Golub <trociny@FreeBSD.org>2013-04-11 19:49:18 +0000
commitddb9b61248f4aa43b5eb2b8fb2f97a84b235130f (patch)
treead015bcc03bc8ebc760b1e4dc73bf45246ccc1a8 /sys/sys/sbuf.h
parent408b98ef5a21ba60b2ee58d70b24fe8f72fcaa46 (diff)
downloadsrc-ddb9b61248f4aa43b5eb2b8fb2f97a84b235130f.tar.gz
src-ddb9b61248f4aa43b5eb2b8fb2f97a84b235130f.zip
Add sbuf_start_section() and sbuf_end_section() functions, which can
be used for automatic section alignment. Discussed with: kib Reviewed by: kib MFC after: 1 month
Notes
Notes: svn path=/head/; revision=249377
Diffstat (limited to 'sys/sys/sbuf.h')
-rw-r--r--sys/sys/sbuf.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h
index 2a9cb0e9c1f0..9816a4cd6c54 100644
--- a/sys/sys/sbuf.h
+++ b/sys/sys/sbuf.h
@@ -52,7 +52,9 @@ struct sbuf {
#define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */
#define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */
#define SBUF_DYNSTRUCT 0x00080000 /* sbuf must be freed */
+#define SBUF_INSECTION 0x00100000 /* set by sbuf_start_section() */
int s_flags; /* flags */
+ ssize_t s_sect_len; /* current length of section */
};
__BEGIN_DECLS
@@ -81,6 +83,8 @@ char *sbuf_data(struct sbuf *);
ssize_t sbuf_len(struct sbuf *);
int sbuf_done(const struct sbuf *);
void sbuf_delete(struct sbuf *);
+void sbuf_start_section(struct sbuf *, ssize_t *);
+ssize_t sbuf_end_section(struct sbuf *, ssize_t, size_t, int);
#ifdef _KERNEL
struct uio;