freebsd32_misc.c (318244) | freebsd32_misc.c (325866) |
---|---|
1/*- 2 * Copyright (c) 2002 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) 2002 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: stable/11/sys/compat/freebsd32/freebsd32_misc.c 318244 2017-05-12 17:40:34Z brooks $"); | 28__FBSDID("$FreeBSD: stable/11/sys/compat/freebsd32/freebsd32_misc.c 325866 2017-11-15 22:34:15Z gordon $"); |
29 30#include "opt_compat.h" 31#include "opt_inet.h" 32#include "opt_inet6.h" 33 34#define __ELF_WORD_SIZE 32 35 36#include <sys/param.h> --- 2908 unchanged lines hidden (view full) --- 2945 suword32(vectp, 0); 2946 2947 return ((register_t *)stack_base); 2948} 2949 2950int 2951freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap) 2952{ | 29 30#include "opt_compat.h" 31#include "opt_inet.h" 32#include "opt_inet6.h" 33 34#define __ELF_WORD_SIZE 32 35 36#include <sys/param.h> --- 2908 unchanged lines hidden (view full) --- 2945 suword32(vectp, 0); 2946 2947 return ((register_t *)stack_base); 2948} 2949 2950int 2951freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap) 2952{ |
2953 struct kld_file_stat stat; 2954 struct kld32_file_stat stat32; | 2953 struct kld_file_stat *stat; 2954 struct kld32_file_stat *stat32; |
2955 int error, version; 2956 2957 if ((error = copyin(&uap->stat->version, &version, sizeof(version))) 2958 != 0) 2959 return (error); 2960 if (version != sizeof(struct kld32_file_stat_1) && 2961 version != sizeof(struct kld32_file_stat)) 2962 return (EINVAL); 2963 | 2955 int error, version; 2956 2957 if ((error = copyin(&uap->stat->version, &version, sizeof(version))) 2958 != 0) 2959 return (error); 2960 if (version != sizeof(struct kld32_file_stat_1) && 2961 version != sizeof(struct kld32_file_stat)) 2962 return (EINVAL); 2963 |
2964 error = kern_kldstat(td, uap->fileid, &stat); 2965 if (error != 0) 2966 return (error); 2967 2968 bcopy(&stat.name[0], &stat32.name[0], sizeof(stat.name)); 2969 CP(stat, stat32, refs); 2970 CP(stat, stat32, id); 2971 PTROUT_CP(stat, stat32, address); 2972 CP(stat, stat32, size); 2973 bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname)); 2974 return (copyout(&stat32, uap->stat, version)); | 2964 stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO); 2965 stat32 = malloc(sizeof(*stat32), M_TEMP, M_WAITOK | M_ZERO); 2966 error = kern_kldstat(td, uap->fileid, stat); 2967 if (error == 0) { 2968 bcopy(&stat->name[0], &stat32->name[0], sizeof(stat->name)); 2969 CP(*stat, *stat32, refs); 2970 CP(*stat, *stat32, id); 2971 PTROUT_CP(*stat, *stat32, address); 2972 CP(*stat, *stat32, size); 2973 bcopy(&stat->pathname[0], &stat32->pathname[0], 2974 sizeof(stat->pathname)); 2975 error = copyout(stat32, uap->stat, version); 2976 } 2977 free(stat, M_TEMP); 2978 free(stat32, M_TEMP); 2979 return (error); |
2975} 2976 2977int 2978freebsd32_posix_fallocate(struct thread *td, 2979 struct freebsd32_posix_fallocate_args *uap) 2980{ 2981 int error; 2982 --- 171 unchanged lines hidden --- | 2980} 2981 2982int 2983freebsd32_posix_fallocate(struct thread *td, 2984 struct freebsd32_posix_fallocate_args *uap) 2985{ 2986 int error; 2987 --- 171 unchanged lines hidden --- |