asst3-Virtual Memory Translation/kern/syscall/runprogram.c
static
int
argbuf_fromkernel(struct argbuf *buf, const char *progname)
{
	size_t len;
	int result;

	len = strlen(progname) + 1;

	result = argbuf_allocate(buf, len);
	if (result) {
		return result;
	}
	strcpy(buf->data, progname);
	buf->len = len;
	buf->nargs = 1;

	return 0;
}
/*
 * Prepare an argv buffer for runprogram, using a kernel pointer.
 *
 * This only accepts a program name (not arbitrary arguments) from the
 * menu, but could easily be extended to support arbitrary arguments.
 */
Prepare an argv buffer for runprogram, using a kernel pointer.
This only accepts a program name (not arbitrary arguments) from the
menu, but could easily be extended to support arbitrary arguments.
Prepare an argv buffer for runprogram using a kernel pointer . This only accepts a program name ( not arbitrary arguments ) from the menu but could easily be extended to support arbitrary arguments .
static
int
argbuf_fromkernel(struct argbuf *buf, const char *progname)
{
	size_t len;
	int result;
	len = strlen(progname) + 1;
	result = argbuf_allocate(buf, len);
	if (result) {
		return result;
	}
	strcpy(buf->data, progname);
	buf->len = len;
	buf->nargs = 1;
	return 0;
}
static int argbuf_fromkernel ( struct argbuf * buf , const char * progname ) { size_t len ; int result ; len = strlen ( progname ) + 1 ; result = argbuf_allocate ( buf , len ) ; if ( result ) { return result ; } strcpy ( buf -> data , progname ) ; buf -> len = len ; buf -> nargs = 1 ; return 0 ; }
Prepare an argv buffer for runprogram, using a kernel pointer.
Prepare an argv buffer for runprogram using a kernel pointer .