kern_exec.c (253953) | kern_exec.c (254025) |
---|---|
1/*- 2 * Copyright (c) 1993, David Greenman 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) 1993, David Greenman 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_exec.c 253953 2013-08-05 08:55:35Z attilio $"); | 28__FBSDID("$FreeBSD: head/sys/kern/kern_exec.c 254025 2013-08-07 06:21:20Z jeff $"); |
29 30#include "opt_capsicum.h" 31#include "opt_hwpmc_hooks.h" 32#include "opt_kdtrace.h" 33#include "opt_ktrace.h" 34#include "opt_vm.h" 35 36#include <sys/param.h> --- 1150 unchanged lines hidden (view full) --- 1187 * Allocate temporary demand-paged, zero-filled memory for the file name, 1188 * argument, and environment strings. Returns zero if the allocation succeeds 1189 * and ENOMEM otherwise. 1190 */ 1191int 1192exec_alloc_args(struct image_args *args) 1193{ 1194 | 29 30#include "opt_capsicum.h" 31#include "opt_hwpmc_hooks.h" 32#include "opt_kdtrace.h" 33#include "opt_ktrace.h" 34#include "opt_vm.h" 35 36#include <sys/param.h> --- 1150 unchanged lines hidden (view full) --- 1187 * Allocate temporary demand-paged, zero-filled memory for the file name, 1188 * argument, and environment strings. Returns zero if the allocation succeeds 1189 * and ENOMEM otherwise. 1190 */ 1191int 1192exec_alloc_args(struct image_args *args) 1193{ 1194 |
1195 args->buf = (char *)kmem_alloc_wait(exec_map, PATH_MAX + ARG_MAX); | 1195 args->buf = (char *)kmap_alloc_wait(exec_map, PATH_MAX + ARG_MAX); |
1196 return (args->buf != NULL ? 0 : ENOMEM); 1197} 1198 1199void 1200exec_free_args(struct image_args *args) 1201{ 1202 1203 if (args->buf != NULL) { | 1196 return (args->buf != NULL ? 0 : ENOMEM); 1197} 1198 1199void 1200exec_free_args(struct image_args *args) 1201{ 1202 1203 if (args->buf != NULL) { |
1204 kmem_free_wakeup(exec_map, (vm_offset_t)args->buf, | 1204 kmap_free_wakeup(exec_map, (vm_offset_t)args->buf, |
1205 PATH_MAX + ARG_MAX); 1206 args->buf = NULL; 1207 } 1208 if (args->fname_buf != NULL) { 1209 free(args->fname_buf, M_TEMP); 1210 args->fname_buf = NULL; 1211 } 1212} --- 288 unchanged lines hidden --- | 1205 PATH_MAX + ARG_MAX); 1206 args->buf = NULL; 1207 } 1208 if (args->fname_buf != NULL) { 1209 free(args->fname_buf, M_TEMP); 1210 args->fname_buf = NULL; 1211 } 1212} --- 288 unchanged lines hidden --- |