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_RW|CTLFLAG_TUN,&msgbuf_show_timestamp, 0,"Show timestamp in msgbuf")
 
 TUNABLE_INT ("kern.msgbuf_show_timestamp",&msgbuf_show_timestamp)
 
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, u_int *const seq, const int c)
 
void msgbuf_addchar (struct msgbuf *mbp, int c)
 
void msgbuf_addstr (struct msgbuf *mbp, int pri, 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)
 

Variables

static int msgbuf_show_timestamp = 0
 

Macro Definition Documentation

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

Definition at line 44 of file subr_msgbuf.c.

Referenced by msgbuf_addstr().

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

Definition at line 47 of file subr_msgbuf.c.

Referenced by msgbuf_init(), and msgbuf_reinit().

Function Documentation

void msgbuf_addchar ( struct msgbuf *  mbp,
int  c 
)

Definition at line 165 of file subr_msgbuf.c.

References msgbuf_do_addchar().

Referenced by msgbuf_copy(), and msglogchar().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 183 of file subr_msgbuf.c.

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

Referenced by msglogstr(), and putbuf().

Here is the call graph for this function:

Here is the caller graph for this function:

static u_int msgbuf_cksum ( struct msgbuf *  mbp)
static

Definition at line 398 of file subr_msgbuf.c.

Referenced by msgbuf_reinit().

Here is the caller graph for this function:

void msgbuf_clear ( struct msgbuf *  mbp)

Definition at line 118 of file subr_msgbuf.c.

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

Here is the caller graph for this function:

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

Definition at line 412 of file subr_msgbuf.c.

References msgbuf_addchar(), and msgbuf_getchar().

Referenced by msgbufinit().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 149 of file subr_msgbuf.c.

Referenced by msgbuf_addchar(), and msgbuf_addstr().

Here is the caller graph for this function:

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

Definition at line 321 of file subr_msgbuf.c.

Referenced by logread().

Here is the caller graph for this function:

int msgbuf_getchar ( struct msgbuf *  mbp)

Definition at line 293 of file subr_msgbuf.c.

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

Here is the caller graph for this function:

int msgbuf_getcount ( struct msgbuf *  mbp)

Definition at line 131 of file subr_msgbuf.c.

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

Here is the caller graph for this function:

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

Definition at line 65 of file subr_msgbuf.c.

References msgbuf_clear(), mtx_init(), 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:

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

Definition at line 360 of file subr_msgbuf.c.

Referenced by sysctl_kern_msgbuf().

Here is the caller graph for this function:

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

Definition at line 85 of file subr_msgbuf.c.

References bootverbose, msgbuf_cksum(), msgbuf_clear(), msgbuf_init(), mtx_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 ( _kern  ,
OID_AUTO  ,
msgbuf_show_timestamp  ,
CTLFLAG_RW|  CTLFLAG_TUN,
msgbuf_show_timestamp,
,
"Show timestamp in msgbuf"   
)
TUNABLE_INT ( "kern.msgbuf_show_timestamp"  ,
msgbuf_show_timestamp 
)

Variable Documentation

int msgbuf_show_timestamp = 0
static

Definition at line 55 of file subr_msgbuf.c.

Referenced by msgbuf_addstr().