Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_msgbuf.c
Show First 20 Lines • Show All 408 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
msgbuf_copy(struct msgbuf *src, struct msgbuf *dst) | msgbuf_copy(struct msgbuf *src, struct msgbuf *dst) | ||||
{ | { | ||||
int c; | int c; | ||||
while ((c = msgbuf_getchar(src)) >= 0) | while ((c = msgbuf_getchar(src)) >= 0) | ||||
msgbuf_addchar(dst, c); | msgbuf_addchar(dst, c); | ||||
} | } | ||||
/* | |||||
* Get a snapshot of the message buffer, without modifying its internal state | |||||
* (i.e. don't mark any new characters as read). | |||||
*/ | |||||
void | |||||
msgbuf_duplicate(struct msgbuf *src, struct msgbuf *dst, char *dst_msgptr) | |||||
{ | |||||
markj: Style no longer requires this blank line. | |||||
mtx_lock_spin(&src->msg_lock); | |||||
bcopy(src, dst, sizeof(struct msgbuf)); | |||||
dst->msg_ptr = dst_msgptr; | |||||
bcopy(src->msg_ptr, dst->msg_ptr, src->msg_size); | |||||
mtx_unlock_spin(&src->msg_lock); | |||||
} |
Style no longer requires this blank line.