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

Function msgbuf_do_addchar

freebsd/kern/subr_msgbuf.c:149–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 */
148
149static void
150msgbuf_do_addchar(struct msgbuf * const mbp, u_int * const seq, const int c)
151{
152 u_int pos;
153
154 /* Make sure we properly wrap the sequence number. */
155 pos = MSGBUF_SEQ_TO_POS(mbp, *seq);
156 mbp->msg_cksum += (u_int)(u_char)c -
157 (u_int)(u_char)mbp->msg_ptr[pos];
158 mbp->msg_ptr[pos] = c;
159 *seq = MSGBUF_SEQNORM(mbp, *seq + 1);
160}
161
162/*
163 * Append a character to a message buffer.

Callers 2

msgbuf_addcharFunction · 0.85
msgbuf_addstrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected