FreeBSD/sys/kern/kern_rctl.c
/*
 * Routine used by RCTL syscalls to read in input string.
 */
Routine used by RCTL syscalls to read in input string.
Routine used by RCTL syscalls to read in input string .
static int
rctl_read_inbuf(char **inputstr, const char *inbufp, size_t inbuflen)
{
	char *str;
	int error;
	ASSERT_RACCT_ENABLED();
	if (inbuflen <= 0)
		return (EINVAL);
	if (inbuflen > RCTL_MAX_INBUFSIZE)
		return (E2BIG);
	str = malloc(inbuflen + 1, M_RCTL, M_WAITOK);
	error = copyinstr(inbufp, str, inbuflen, NULL);
	if (error != 0) {
		free(str, M_RCTL);
		return (error);
	}
	*inputstr = str;
	return (0);
}
static int rctl_read_inbuf ( char * * inputstr , const char * inbufp , size_t inbuflen ) { char * str ; int error ; ASSERT_RACCT_ENABLED ( ) ; if ( inbuflen <= 0 ) return ( EINVAL ) ; if ( inbuflen > RCTL_MAX_INBUFSIZE ) return ( E2BIG ) ; str = malloc ( inbuflen + 1 , M_RCTL , M_WAITOK ) ; error = copyinstr ( inbufp , str , inbuflen , NULL ) ; if ( error != 0 ) { free ( str , M_RCTL ) ; return ( error ) ; } * inputstr = str ; return ( 0 ) ; }
Routine used by RCTL syscalls to read in input string.
Routine used by RCTL syscalls to read in input string .