FreeBSD/sys/kern/subr_msgbuf.c
/*
 * Initialize a message buffer of the specified size at the specified
 * location. This also zeros the buffer area.
 */
Initialize a message buffer of the specified size at the specified
location. This also zeros the buffer area.
Initialize a message buffer of the specified size at the specified location . This also zeros the buffer area .
void
msgbuf_init(struct msgbuf *mbp, void *ptr, int size)
{
	mbp->msg_ptr = ptr;
	mbp->msg_size = size;
	mbp->msg_seqmod = SEQMOD(size);
	msgbuf_clear(mbp);
	mbp->msg_magic = MSG_MAGIC;
	mbp->msg_lastpri = -1;
	mbp->msg_flags = 0;
	bzero(&mbp->msg_lock, sizeof(mbp->msg_lock));
	mtx_init(&mbp->msg_lock, "msgbuf", NULL, MTX_SPIN);
}
void msgbuf_init ( struct msgbuf * mbp , void * ptr , int size ) { mbp -> msg_ptr = ptr ; mbp -> msg_size = size ; mbp -> msg_seqmod = SEQMOD ( size ) ; msgbuf_clear ( mbp ) ; mbp -> msg_magic = MSG_MAGIC ; mbp -> msg_lastpri = -1 ; mbp -> msg_flags = 0 ; bzero ( & mbp -> msg_lock , sizeof ( mbp -> msg_lock ) ) ; mtx_init ( & mbp -> msg_lock , " " , NULL , MTX_SPIN ) ; }
Initialize a message buffer of the specified size at the specified
 location.
Initialize a message buffer of the specified size at the specified location .