Deleted Added
full compact
freebsd32_misc.c (107849) freebsd32_misc.c (109623)
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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 *
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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 107849 2002-12-14 01:56:26Z alfred $
26 * $FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 109623 2003-01-21 08:56:16Z alfred $
27 */
28
29#include "opt_compat.h"
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/bus.h>
34#include <sys/dkstat.h>

--- 66 unchanged lines hidden (view full) ---

101 size_t len, sz;
102 char *buf, *cp, *ptr;
103 struct ucred *ucred;
104 struct nameidata nd;
105 struct nameidata ndroot;
106 struct vattr vat;
107 struct vattr vatroot;
108
27 */
28
29#include "opt_compat.h"
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/bus.h>
34#include <sys/dkstat.h>

--- 66 unchanged lines hidden (view full) ---

101 size_t len, sz;
102 char *buf, *cp, *ptr;
103 struct ucred *ucred;
104 struct nameidata nd;
105 struct nameidata ndroot;
106 struct vattr vat;
107 struct vattr vatroot;
108
109 buf = (char *) malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
109 buf = (char *) malloc(MAXPATHLEN, M_TEMP, 0);
110 *pbuf = path;
111
112 for (ptr = buf; (*ptr = *prefix) != '\0'; ptr++, prefix++)
113 continue;
114
115 sz = MAXPATHLEN - (ptr - buf);
116
117 /*

--- 646 unchanged lines hidden (view full) ---

764 sg = stackgap_init();
765
766 if (uap->iovcnt > (STACKGAPLEN / sizeof (struct iovec)))
767 return (EINVAL);
768
769 osize = uap->iovcnt * sizeof (struct iovec32);
770 nsize = uap->iovcnt * sizeof (struct iovec);
771
110 *pbuf = path;
111
112 for (ptr = buf; (*ptr = *prefix) != '\0'; ptr++, prefix++)
113 continue;
114
115 sz = MAXPATHLEN - (ptr - buf);
116
117 /*

--- 646 unchanged lines hidden (view full) ---

764 sg = stackgap_init();
765
766 if (uap->iovcnt > (STACKGAPLEN / sizeof (struct iovec)))
767 return (EINVAL);
768
769 osize = uap->iovcnt * sizeof (struct iovec32);
770 nsize = uap->iovcnt * sizeof (struct iovec);
771
772 oio = malloc(osize, M_TEMP, M_WAITOK);
773 nio = malloc(nsize, M_TEMP, M_WAITOK);
772 oio = malloc(osize, M_TEMP, 0);
773 nio = malloc(nsize, M_TEMP, 0);
774
775 error = 0;
776 if ((error = copyin(uap->iovp, oio, osize)))
777 goto punt;
778 for (i = 0; i < uap->iovcnt; i++) {
779 nio[i].iov_base = PTRIN(oio[i].iov_base);
780 nio[i].iov_len = oio[i].iov_len;
781 }

--- 28 unchanged lines hidden (view full) ---

810 sg = stackgap_init();
811
812 if (uap->iovcnt > (STACKGAPLEN / sizeof (struct iovec)))
813 return (EINVAL);
814
815 osize = uap->iovcnt * sizeof (struct iovec32);
816 nsize = uap->iovcnt * sizeof (struct iovec);
817
774
775 error = 0;
776 if ((error = copyin(uap->iovp, oio, osize)))
777 goto punt;
778 for (i = 0; i < uap->iovcnt; i++) {
779 nio[i].iov_base = PTRIN(oio[i].iov_base);
780 nio[i].iov_len = oio[i].iov_len;
781 }

--- 28 unchanged lines hidden (view full) ---

810 sg = stackgap_init();
811
812 if (uap->iovcnt > (STACKGAPLEN / sizeof (struct iovec)))
813 return (EINVAL);
814
815 osize = uap->iovcnt * sizeof (struct iovec32);
816 nsize = uap->iovcnt * sizeof (struct iovec);
817
818 oio = malloc(osize, M_TEMP, M_WAITOK);
819 nio = malloc(nsize, M_TEMP, M_WAITOK);
818 oio = malloc(osize, M_TEMP, 0);
819 nio = malloc(nsize, M_TEMP, 0);
820
821 error = 0;
822 if ((error = copyin(uap->iovp, oio, osize)))
823 goto punt;
824 for (i = 0; i < uap->iovcnt; i++) {
825 nio[i].iov_base = PTRIN(oio[i].iov_base);
826 nio[i].iov_len = oio[i].iov_len;
827 }

--- 533 unchanged lines hidden ---
820
821 error = 0;
822 if ((error = copyin(uap->iovp, oio, osize)))
823 goto punt;
824 for (i = 0; i < uap->iovcnt; i++) {
825 nio[i].iov_base = PTRIN(oio[i].iov_base);
826 nio[i].iov_len = oio[i].iov_len;
827 }

--- 533 unchanged lines hidden ---