Deleted Added
full compact
freebsd32_misc.c (151582) freebsd32_misc.c (151720)
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: head/sys/compat/freebsd32/freebsd32_misc.c 151582 2005-10-23 10:43:14Z ps $");
28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 151720 2005-10-26 22:19:51Z peter $");
29
30#include "opt_compat.h"
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/bus.h>
35#include <sys/exec.h>
36#include <sys/fcntl.h>

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

1392 CP(osa, s32, sa_mask);
1393 error = copyout(&s32, uap->oact, sizeof(s32));
1394 }
1395 return (error);
1396}
1397#endif
1398
1399#ifdef COMPAT_43
29
30#include "opt_compat.h"
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/bus.h>
35#include <sys/exec.h>
36#include <sys/fcntl.h>

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

1392 CP(osa, s32, sa_mask);
1393 error = copyout(&s32, uap->oact, sizeof(s32));
1394 }
1395 return (error);
1396}
1397#endif
1398
1399#ifdef COMPAT_43
1400struct freebsd3_sigaction32 {
1400struct osigaction32 {
1401 u_int32_t sa_u;
1402 osigset_t sa_mask;
1403 int sa_flags;
1404};
1405
1406#define ONSIG 32
1407
1408int
1401 u_int32_t sa_u;
1402 osigset_t sa_mask;
1403 int sa_flags;
1404};
1405
1406#define ONSIG 32
1407
1408int
1409freebsd3_freebsd32_sigaction(struct thread *td,
1410 struct freebsd3_freebsd32_sigaction_args *uap)
1409ofreebsd32_sigaction(struct thread *td,
1410 struct ofreebsd32_sigaction_args *uap)
1411{
1411{
1412 struct freebsd3_sigaction32 s32;
1412 struct osigaction32 s32;
1413 struct sigaction sa, osa, *sap;
1414 int error;
1415
1416 if (uap->signum <= 0 || uap->signum >= ONSIG)
1417 return (EINVAL);
1418
1419 if (uap->nsa) {
1420 error = copyin(uap->nsa, &s32, sizeof(s32));

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

1432 CP(osa, s32, sa_flags);
1433 SIG2OSIG(osa.sa_mask, s32.sa_mask);
1434 error = copyout(&s32, uap->osa, sizeof(s32));
1435 }
1436 return (error);
1437}
1438
1439int
1413 struct sigaction sa, osa, *sap;
1414 int error;
1415
1416 if (uap->signum <= 0 || uap->signum >= ONSIG)
1417 return (EINVAL);
1418
1419 if (uap->nsa) {
1420 error = copyin(uap->nsa, &s32, sizeof(s32));

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

1432 CP(osa, s32, sa_flags);
1433 SIG2OSIG(osa.sa_mask, s32.sa_mask);
1434 error = copyout(&s32, uap->osa, sizeof(s32));
1435 }
1436 return (error);
1437}
1438
1439int
1440freebsd3_freebsd32_sigprocmask(struct thread *td,
1441 struct freebsd3_freebsd32_sigprocmask_args *uap)
1440ofreebsd32_sigprocmask(struct thread *td,
1441 struct ofreebsd32_sigprocmask_args *uap)
1442{
1443 sigset_t set, oset;
1444 int error;
1445
1446 OSIG2SIG(uap->mask, set);
1447 error = kern_sigprocmask(td, uap->how, &set, &oset, 1);
1448 SIG2OSIG(oset, td->td_retval[0]);
1449 return (error);
1450}
1451
1452int
1442{
1443 sigset_t set, oset;
1444 int error;
1445
1446 OSIG2SIG(uap->mask, set);
1447 error = kern_sigprocmask(td, uap->how, &set, &oset, 1);
1448 SIG2OSIG(oset, td->td_retval[0]);
1449 return (error);
1450}
1451
1452int
1453freebsd3_freebsd32_sigpending(struct thread *td,
1454 struct freebsd3_freebsd32_sigpending_args *uap)
1453ofreebsd32_sigpending(struct thread *td,
1454 struct ofreebsd32_sigpending_args *uap)
1455{
1456 struct proc *p = td->td_proc;
1457 sigset_t siglist;
1458
1459 PROC_LOCK(p);
1460 siglist = p->p_siglist;
1461 SIGSETOR(siglist, td->td_siglist);
1462 PROC_UNLOCK(p);
1463 SIG2OSIG(siglist, td->td_retval[0]);
1464 return (0);
1465}
1466
1467struct sigvec32 {
1468 u_int32_t sv_handler;
1469 int sv_mask;
1470 int sv_flags;
1471};
1472
1473int
1455{
1456 struct proc *p = td->td_proc;
1457 sigset_t siglist;
1458
1459 PROC_LOCK(p);
1460 siglist = p->p_siglist;
1461 SIGSETOR(siglist, td->td_siglist);
1462 PROC_UNLOCK(p);
1463 SIG2OSIG(siglist, td->td_retval[0]);
1464 return (0);
1465}
1466
1467struct sigvec32 {
1468 u_int32_t sv_handler;
1469 int sv_mask;
1470 int sv_flags;
1471};
1472
1473int
1474freebsd3_freebsd32_sigvec(struct thread *td,
1475 struct freebsd3_freebsd32_sigvec_args *uap)
1474ofreebsd32_sigvec(struct thread *td,
1475 struct ofreebsd32_sigvec_args *uap)
1476{
1477 struct sigvec32 vec;
1478 struct sigaction sa, osa, *sap;
1479 int error;
1480
1481 if (uap->signum <= 0 || uap->signum >= ONSIG)
1482 return (EINVAL);
1483

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

1500 vec.sv_flags &= ~SA_NOCLDWAIT;
1501 vec.sv_flags ^= SA_RESTART;
1502 error = copyout(&vec, uap->osv, sizeof(vec));
1503 }
1504 return (error);
1505}
1506
1507int
1476{
1477 struct sigvec32 vec;
1478 struct sigaction sa, osa, *sap;
1479 int error;
1480
1481 if (uap->signum <= 0 || uap->signum >= ONSIG)
1482 return (EINVAL);
1483

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

1500 vec.sv_flags &= ~SA_NOCLDWAIT;
1501 vec.sv_flags ^= SA_RESTART;
1502 error = copyout(&vec, uap->osv, sizeof(vec));
1503 }
1504 return (error);
1505}
1506
1507int
1508freebsd3_freebsd32_sigblock(struct thread *td,
1509 struct freebsd3_freebsd32_sigblock_args *uap)
1508ofreebsd32_sigblock(struct thread *td,
1509 struct ofreebsd32_sigblock_args *uap)
1510{
1511 struct proc *p = td->td_proc;
1512 sigset_t set;
1513
1514 OSIG2SIG(uap->mask, set);
1515 SIG_CANTMASK(set);
1516 PROC_LOCK(p);
1517 SIG2OSIG(td->td_sigmask, td->td_retval[0]);
1518 SIGSETOR(td->td_sigmask, set);
1519 PROC_UNLOCK(p);
1520 return (0);
1521}
1522
1523int
1510{
1511 struct proc *p = td->td_proc;
1512 sigset_t set;
1513
1514 OSIG2SIG(uap->mask, set);
1515 SIG_CANTMASK(set);
1516 PROC_LOCK(p);
1517 SIG2OSIG(td->td_sigmask, td->td_retval[0]);
1518 SIGSETOR(td->td_sigmask, set);
1519 PROC_UNLOCK(p);
1520 return (0);
1521}
1522
1523int
1524freebsd3_freebsd32_sigsetmask(struct thread *td,
1525 struct freebsd3_freebsd32_sigsetmask_args *uap)
1524ofreebsd32_sigsetmask(struct thread *td,
1525 struct ofreebsd32_sigsetmask_args *uap)
1526{
1527 struct proc *p = td->td_proc;
1528 sigset_t set;
1529
1530 OSIG2SIG(uap->mask, set);
1531 SIG_CANTMASK(set);
1532 PROC_LOCK(p);
1533 SIG2OSIG(td->td_sigmask, td->td_retval[0]);
1534 SIGSETLO(td->td_sigmask, set);
1535 signotify(td);
1536 PROC_UNLOCK(p);
1537 return (0);
1538}
1539
1540int
1526{
1527 struct proc *p = td->td_proc;
1528 sigset_t set;
1529
1530 OSIG2SIG(uap->mask, set);
1531 SIG_CANTMASK(set);
1532 PROC_LOCK(p);
1533 SIG2OSIG(td->td_sigmask, td->td_retval[0]);
1534 SIGSETLO(td->td_sigmask, set);
1535 signotify(td);
1536 PROC_UNLOCK(p);
1537 return (0);
1538}
1539
1540int
1541freebsd3_freebsd32_sigsuspend(struct thread *td,
1542 struct freebsd3_freebsd32_sigsuspend_args *uap)
1541ofreebsd32_sigsuspend(struct thread *td,
1542 struct ofreebsd32_sigsuspend_args *uap)
1543{
1544 struct proc *p = td->td_proc;
1545 sigset_t mask;
1546
1547 PROC_LOCK(p);
1548 td->td_oldsigmask = td->td_sigmask;
1549 td->td_pflags |= TDP_OLDMASK;
1550 OSIG2SIG(uap->mask, mask);

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

1559}
1560
1561struct sigstack32 {
1562 u_int32_t ss_sp;
1563 int ss_onstack;
1564};
1565
1566int
1543{
1544 struct proc *p = td->td_proc;
1545 sigset_t mask;
1546
1547 PROC_LOCK(p);
1548 td->td_oldsigmask = td->td_sigmask;
1549 td->td_pflags |= TDP_OLDMASK;
1550 OSIG2SIG(uap->mask, mask);

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

1559}
1560
1561struct sigstack32 {
1562 u_int32_t ss_sp;
1563 int ss_onstack;
1564};
1565
1566int
1567freebsd3_freebsd32_sigstack(struct thread *td,
1568 struct freebsd3_freebsd32_sigstack_args *uap)
1567ofreebsd32_sigstack(struct thread *td,
1568 struct ofreebsd32_sigstack_args *uap)
1569{
1570 struct sigstack32 s32;
1571 struct sigstack nss, oss;
1572 int error = 0;
1573
1574 if (uap->nss != NULL) {
1575 error = copyin(uap->nss, &s32, sizeof(s32));
1576 if (error)

--- 132 unchanged lines hidden ---
1569{
1570 struct sigstack32 s32;
1571 struct sigstack nss, oss;
1572 int error = 0;
1573
1574 if (uap->nss != NULL) {
1575 error = copyin(uap->nss, &s32, sizeof(s32));
1576 if (error)

--- 132 unchanged lines hidden ---