kern_linker.c (159588) | kern_linker.c (159596) |
---|---|
1/*- 2 * Copyright (c) 1997-2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997-2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/kern/kern_linker.c 159588 2006-06-13 21:28:18Z jhb $"); | 28__FBSDID("$FreeBSD: head/sys/kern/kern_linker.c 159596 2006-06-14 03:01:06Z marcel $"); |
29 30#include "opt_ddb.h" 31#include "opt_hwpmc_hooks.h" 32#include "opt_mac.h" 33 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/systm.h> --- 754 unchanged lines hidden (view full) --- 791 mtx_unlock(&Giant); 792 return (error); 793} 794 795int 796kldload(struct thread *td, struct kldload_args *uap) 797{ 798 char *pathname = NULL; | 29 30#include "opt_ddb.h" 31#include "opt_hwpmc_hooks.h" 32#include "opt_mac.h" 33 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/systm.h> --- 754 unchanged lines hidden (view full) --- 791 mtx_unlock(&Giant); 792 return (error); 793} 794 795int 796kldload(struct thread *td, struct kldload_args *uap) 797{ 798 char *pathname = NULL; |
799 int error; | 799 int error, fileid; |
800 801 td->td_retval[0] = -1; 802 803 pathname = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); 804 error = copyinstr(uap->file, pathname, MAXPATHLEN, NULL); | 800 801 td->td_retval[0] = -1; 802 803 pathname = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); 804 error = copyinstr(uap->file, pathname, MAXPATHLEN, NULL); |
805 if (error == 0) 806 error = kern_kldload(td, pathname, &td->td_retval[0]); 807 | 805 if (error == 0) { 806 error = kern_kldload(td, pathname, &fileid); 807 if (error == 0) 808 td->td_retval[0] = fileid; 809 } |
808 free(pathname, M_TEMP); 809 return (error); 810} 811 812/* 813 * MPSAFE 814 */ 815int --- 1103 unchanged lines hidden --- | 810 free(pathname, M_TEMP); 811 return (error); 812} 813 814/* 815 * MPSAFE 816 */ 817int --- 1103 unchanged lines hidden --- |