linux_machdep.c (68519) | linux_machdep.c (68520) |
---|---|
1/*- 2 * Copyright (c) 2000 Marcel Moolenaar 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 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 2000 Marcel Moolenaar 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 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/i386/linux/linux_machdep.c 68519 2000-11-09 07:27:55Z marcel $ | 28 * $FreeBSD: head/sys/i386/linux/linux_machdep.c 68520 2000-11-09 08:25:48Z marcel $ |
29 */ 30 31#include <sys/param.h> 32#include <sys/mman.h> 33#include <sys/proc.h> 34#include <sys/sysproto.h> 35#include <sys/systm.h> 36#include <sys/unistd.h> --- 626 unchanged lines hidden (view full) --- 663 ss = NULL; 664 } else { 665 error = copyin(uap->uss, &lss, sizeof(linux_stack_t)); 666 if (error) 667 return (error); 668 669 ss = stackgap_alloc(&sg, sizeof(stack_t)); 670 ss->ss_sp = lss.ss_sp; | 29 */ 30 31#include <sys/param.h> 32#include <sys/mman.h> 33#include <sys/proc.h> 34#include <sys/sysproto.h> 35#include <sys/systm.h> 36#include <sys/unistd.h> --- 626 unchanged lines hidden (view full) --- 663 ss = NULL; 664 } else { 665 error = copyin(uap->uss, &lss, sizeof(linux_stack_t)); 666 if (error) 667 return (error); 668 669 ss = stackgap_alloc(&sg, sizeof(stack_t)); 670 ss->ss_sp = lss.ss_sp; |
671 ss->ss_size = (lss.ss_size >= LINUX_MINSIGSTKSZ && 672 lss.ss_size < MINSIGSTKSZ) ? MINSIGSTKSZ : lss.ss_size; | 671 ss->ss_size = lss.ss_size; |
673 ss->ss_flags = linux_to_bsd_sigaltstack(lss.ss_flags); 674 } 675 oss = (uap->uoss != NULL) 676 ? stackgap_alloc(&sg, sizeof(stack_t)) 677 : NULL; 678 679 bsd.ss = ss; 680 bsd.oss = oss; 681 error = sigaltstack(p, &bsd); 682 683 if (!error && oss != NULL) { 684 lss.ss_sp = oss->ss_sp; 685 lss.ss_size = oss->ss_size; 686 lss.ss_flags = bsd_to_linux_sigaltstack(oss->ss_flags); 687 error = copyout(&lss, uap->uoss, sizeof(linux_stack_t)); 688 } | 672 ss->ss_flags = linux_to_bsd_sigaltstack(lss.ss_flags); 673 } 674 oss = (uap->uoss != NULL) 675 ? stackgap_alloc(&sg, sizeof(stack_t)) 676 : NULL; 677 678 bsd.ss = ss; 679 bsd.oss = oss; 680 error = sigaltstack(p, &bsd); 681 682 if (!error && oss != NULL) { 683 lss.ss_sp = oss->ss_sp; 684 lss.ss_size = oss->ss_size; 685 lss.ss_flags = bsd_to_linux_sigaltstack(oss->ss_flags); 686 error = copyout(&lss, uap->uoss, sizeof(linux_stack_t)); 687 } |
689 if (!error && (ss != NULL) && (lss.ss_size < ss->ss_size)) 690 p->p_sigstk.ss_size = lss.ss_size; | |
691 692 return (error); 693} | 688 689 return (error); 690} |