FreeBSD/sys/kern/kern_rctl.c
/*
 * Routine used by RCTL syscalls to write out output string.
 */
Routine used by RCTL syscalls to write out output string.
Routine used by RCTL syscalls to write out output string .
static int
rctl_write_outbuf(struct sbuf *outputsbuf, char *outbufp, size_t outbuflen)
{
	int error;
	ASSERT_RACCT_ENABLED();
	if (outputsbuf == NULL)
		return (0);
	sbuf_finish(outputsbuf);
	if (outbuflen < sbuf_len(outputsbuf) + 1) {
		sbuf_delete(outputsbuf);
		return (ERANGE);
	}
	error = copyout(sbuf_data(outputsbuf), outbufp,
	    sbuf_len(outputsbuf) + 1);
	sbuf_delete(outputsbuf);
	return (error);
}
static int rctl_write_outbuf ( struct sbuf * outputsbuf , char * outbufp , size_t outbuflen ) { int error ; ASSERT_RACCT_ENABLED ( ) ; if ( outputsbuf == NULL ) return ( 0 ) ; sbuf_finish ( outputsbuf ) ; if ( outbuflen < sbuf_len ( outputsbuf ) + 1 ) { sbuf_delete ( outputsbuf ) ; return ( ERANGE ) ; } error = copyout ( sbuf_data ( outputsbuf ) , outbufp , sbuf_len ( outputsbuf ) + 1 ) ; sbuf_delete ( outputsbuf ) ; return ( error ) ; }
Routine used by RCTL syscalls to write out output string.
Routine used by RCTL syscalls to write out output string .