MCPcopy Create free account
hub / github.com/F-Stack/f-stack / msgbuf_init

Function msgbuf_init

freebsd/kern/subr_msgbuf.c:65–78  ·  view source on GitHub ↗

* Initialize a message buffer of the specified size at the specified * location. This also zeros the buffer area. */

Source from the content-addressed store, hash-verified

63 * location. This also zeros the buffer area.
64 */
65void
66msgbuf_init(struct msgbuf *mbp, void *ptr, int size)
67{
68
69 mbp->msg_ptr = ptr;
70 mbp->msg_size = size;
71 mbp->msg_seqmod = SEQMOD(size);
72 msgbuf_clear(mbp);
73 mbp->msg_magic = MSG_MAGIC;
74 mbp->msg_lastpri = -1;
75 mbp->msg_flags = 0;
76 bzero(&mbp->msg_lock, sizeof(mbp->msg_lock));
77 mtx_init(&mbp->msg_lock, "msgbuf", NULL, MTX_SPIN);
78}
79
80/*
81 * Reinitialize a message buffer, retaining its previous contents if

Callers 2

msgbuf_reinitFunction · 0.85
constty_setFunction · 0.85

Calls 3

msgbuf_clearFunction · 0.85
bzeroFunction · 0.85
mtx_initFunction · 0.85

Tested by

no test coverage detected