Deleted Added
full compact
linux_ipc.c (140839) linux_ipc.c (141471)
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
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

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

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
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
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

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

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
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/compat/linux/linux_ipc.c 140839 2005-01-26 00:46:36Z sobomax $");
30__FBSDID("$FreeBSD: head/sys/compat/linux/linux_ipc.c 141471 2005-02-07 18:44:55Z jhb $");
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/syscallsubr.h>
35#include <sys/sysproto.h>
36#include <sys/proc.h>
37#include <sys/limits.h>
38#include <sys/msg.h>

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

632}
633
634int
635linux_msgctl(struct thread *td, struct linux_msgctl_args *args)
636{
637 int error, bsd_cmd;
638 struct l_msqid_ds linux_msqid;
639 struct msqid_ds bsd_msqid;
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/syscallsubr.h>
35#include <sys/sysproto.h>
36#include <sys/proc.h>
37#include <sys/limits.h>
38#include <sys/msg.h>

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

632}
633
634int
635linux_msgctl(struct thread *td, struct linux_msgctl_args *args)
636{
637 int error, bsd_cmd;
638 struct l_msqid_ds linux_msqid;
639 struct msqid_ds bsd_msqid;
640 struct msqid_ds *bsd_msqptr;
641
642 error = linux_msqid_pullup(args->cmd & LINUX_IPC_64,
643 &linux_msqid, (caddr_t)PTRIN(args->buf));
644 if (error != 0)
645 return (error);
646 bsd_cmd = args->cmd & ~LINUX_IPC_64;
647 if (bsd_cmd == LINUX_IPC_SET)
648 linux_to_bsd_msqid_ds(&linux_msqid, &bsd_msqid);
649
640
641 error = linux_msqid_pullup(args->cmd & LINUX_IPC_64,
642 &linux_msqid, (caddr_t)PTRIN(args->buf));
643 if (error != 0)
644 return (error);
645 bsd_cmd = args->cmd & ~LINUX_IPC_64;
646 if (bsd_cmd == LINUX_IPC_SET)
647 linux_to_bsd_msqid_ds(&linux_msqid, &bsd_msqid);
648
650 error = kern_msgctl(td, args->msqid, bsd_cmd, &bsd_msqid, &bsd_msqptr);
649 error = kern_msgctl(td, args->msqid, bsd_cmd, &bsd_msqid);
651 if (error != 0)
652 if (bsd_cmd != LINUX_IPC_RMID || error != EINVAL)
653 return (error);
654
655 if (bsd_cmd == LINUX_IPC_STAT) {
650 if (error != 0)
651 if (bsd_cmd != LINUX_IPC_RMID || error != EINVAL)
652 return (error);
653
654 if (bsd_cmd == LINUX_IPC_STAT) {
656 bsd_to_linux_msqid_ds(bsd_msqptr, &linux_msqid);
655 bsd_to_linux_msqid_ds(&bsd_msqid, &linux_msqid);
657 return (linux_msqid_pushdown(args->cmd & LINUX_IPC_64,
658 &linux_msqid, (caddr_t)PTRIN(args->buf)));
659 }
660
661 return (0);
662}
663
664int

--- 153 unchanged lines hidden ---
656 return (linux_msqid_pushdown(args->cmd & LINUX_IPC_64,
657 &linux_msqid, (caddr_t)PTRIN(args->buf)));
658 }
659
660 return (0);
661}
662
663int

--- 153 unchanged lines hidden ---