aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2019-08-07 19:23:07 +0000
committerConrad Meyer <cem@FreeBSD.org>2019-08-07 19:23:07 +0000
commit71db411eb627601a5f9a3464f88d75741927ce60 (patch)
tree5d8502ef6a3f77d7a07d6353221adb9872310040 /sys/sys
parent29bf090e15533714696dc0eb8c3fe5550e89c569 (diff)
downloadsrc-71db411eb627601a5f9a3464f88d75741927ce60.tar.gz
src-71db411eb627601a5f9a3464f88d75741927ce60.zip
sbuf(9): Add NOWAIT dynamic buffer extension mode
The goal is to avoid some kinds of low-memory deadlock when formatting heap-allocated buffers. Reviewed by: vangyzen Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21015
Notes
Notes: svn path=/head/; revision=350691
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/sbuf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h
index 4010f3b7d31c..3b099fe3f512 100644
--- a/sys/sys/sbuf.h
+++ b/sys/sys/sbuf.h
@@ -52,6 +52,7 @@ struct sbuf {
#define SBUF_AUTOEXTEND 0x00000001 /* automatically extend buffer */
#define SBUF_INCLUDENUL 0x00000002 /* nulterm byte is counted in len */
#define SBUF_DRAINTOEOR 0x00000004 /* use section 0 as drain EOR marker */
+#define SBUF_NOWAIT 0x00000008 /* Extend with non-blocking malloc */
#define SBUF_USRFLAGMSK 0x0000ffff /* mask of flags the user may specify */
#define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */
#define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */