FreeBSD kernel kern code
subr_msgbuf.c File Reference
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/lock.h>
#include <sys/kernel.h>
#include <sys/mutex.h>
#include <sys/msgbuf.h>
#include <sys/sysctl.h>
Include dependency graph for subr_msgbuf.c:

Go to the source code of this file.

Macros

#define MAXPRIBUF   (sizeof(intmax_t) * NBBY + 3)
 
#define SEQMOD(size)   ((size) * 16)
 

Functions

static u_int msgbuf_cksum (struct msgbuf *mbp)
 
 SYSCTL_INT (_kern, OID_AUTO, msgbuf_show_timestamp, CTLFLAG_RWTUN, &msgbuf_show_timestamp, 0, "Show timestamp in msgbuf")
 
void msgbuf_init (struct msgbuf *mbp, void *ptr, int size)
 
void msgbuf_reinit (struct msgbuf *mbp, void *ptr, int size)
 
void msgbuf_clear (struct msgbuf *mbp)
 
int msgbuf_getcount (struct msgbuf *mbp)
 
static void msgbuf_do_addchar (struct msgbuf *const mbp, const int c)
 
void msgbuf_addchar (struct msgbuf *mbp, int c)
 
void msgbuf_addstr (struct msgbuf *mbp, int pri, const char *str, int filter_cr)
 
int msgbuf_getchar (struct msgbuf *mbp)
 
int msgbuf_getbytes (struct msgbuf *mbp, char *buf, int buflen)
 
int msgbuf_peekbytes (struct msgbuf *mbp, char *buf, int buflen, u_int *seqp)
 
void msgbuf_copy (struct msgbuf *src, struct msgbuf *dst)
 
void msgbuf_duplicate (struct msgbuf *src, struct msgbuf *dst, char *dst_msgptr)
 

Variables

static int msgbuf_show_timestamp = 0
 

Macro Definition Documentation

◆ MAXPRIBUF

#define MAXPRIBUF   (sizeof(intmax_t) * NBBY + 3)

Definition at line 46 of file subr_msgbuf.c.

◆ SEQMOD

#define SEQMOD (   size)    ((size) * 16)

Definition at line 49 of file subr_msgbuf.c.

Function Documentation

◆ msgbuf_addchar()

void msgbuf_addchar ( struct msgbuf *  mbp,
int  c 
)

Definition at line 166 of file subr_msgbuf.c.

References msgbuf_do_addchar().

Referenced by msgbuf_copy(), msglogchar(), and prf_putchar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ msgbuf_addstr()

void msgbuf_addstr ( struct msgbuf *  mbp,
int  pri,
const char *  str,
int  filter_cr 
)

Definition at line 186 of file subr_msgbuf.c.

References buf, MAXPRIBUF, msgbuf_do_addchar(), msgbuf_show_timestamp, snprintf(), sprintf(), and time_uptime.

Referenced by msglogstr(), and prf_putbuf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ msgbuf_cksum()

static u_int msgbuf_cksum ( struct msgbuf *  mbp)
static

Definition at line 391 of file subr_msgbuf.c.

Referenced by msgbuf_reinit().

Here is the caller graph for this function:

◆ msgbuf_clear()

void msgbuf_clear ( struct msgbuf *  mbp)

Definition at line 119 of file subr_msgbuf.c.

Referenced by msgbuf_init(), msgbuf_reinit(), and sysctl_kern_msgbuf_clear().

Here is the caller graph for this function:

◆ msgbuf_copy()

void msgbuf_copy ( struct msgbuf *  src,
struct msgbuf *  dst 
)

Definition at line 405 of file subr_msgbuf.c.

References msgbuf_addchar(), msgbuf_getchar(), and src.

Referenced by msgbufinit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ msgbuf_do_addchar()

static void msgbuf_do_addchar ( struct msgbuf *const  mbp,
const int  c 
)
static

Definition at line 150 of file subr_msgbuf.c.

Referenced by msgbuf_addchar(), and msgbuf_addstr().

Here is the caller graph for this function:

◆ msgbuf_duplicate()

void msgbuf_duplicate ( struct msgbuf *  src,
struct msgbuf *  dst,
char *  dst_msgptr 
)

Definition at line 418 of file subr_msgbuf.c.

References src.

◆ msgbuf_getbytes()

int msgbuf_getbytes ( struct msgbuf *  mbp,
char *  buf,
int  buflen 
)

Definition at line 311 of file subr_msgbuf.c.

References buf.

Referenced by logread().

Here is the caller graph for this function:

◆ msgbuf_getchar()

int msgbuf_getchar ( struct msgbuf *  mbp)

Definition at line 283 of file subr_msgbuf.c.

Referenced by constty_clear(), constty_timeout(), and msgbuf_copy().

Here is the caller graph for this function:

◆ msgbuf_getcount()

int msgbuf_getcount ( struct msgbuf *  mbp)

Definition at line 133 of file subr_msgbuf.c.

Referenced by logioctl(), logkqread(), logpoll(), and logread().

Here is the caller graph for this function:

◆ msgbuf_init()

void msgbuf_init ( struct msgbuf *  mbp,
void *  ptr,
int  size 
)

Definition at line 66 of file subr_msgbuf.c.

References msgbuf_clear(), and SEQMOD.

Referenced by constty_set(), and msgbuf_reinit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ msgbuf_peekbytes()

int msgbuf_peekbytes ( struct msgbuf *  mbp,
char *  buf,
int  buflen,
u_int *  seqp 
)

Definition at line 350 of file subr_msgbuf.c.

References buf.

Referenced by sysctl_kern_msgbuf().

Here is the caller graph for this function:

◆ msgbuf_reinit()

void msgbuf_reinit ( struct msgbuf *  mbp,
void *  ptr,
int  size 
)

Definition at line 86 of file subr_msgbuf.c.

References bootverbose, msgbuf_cksum(), msgbuf_clear(), msgbuf_init(), printf(), and SEQMOD.

Referenced by msgbufinit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYSCTL_INT()

SYSCTL_INT ( _kern  ,
OID_AUTO  ,
msgbuf_show_timestamp  ,
CTLFLAG_RWTUN  ,
msgbuf_show_timestamp,
,
"Show timestamp in msgbuf"   
)

Variable Documentation

◆ msgbuf_show_timestamp

int msgbuf_show_timestamp = 0
static

Definition at line 57 of file subr_msgbuf.c.

Referenced by msgbuf_addstr().