Deleted Added
full compact
uipc_mqueue.c (350263) uipc_mqueue.c (351257)
1/*-
2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
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

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

38 * times at different mount points but shows same contents.
39 *
40 * 2) Standard POSIX message queue API. The syscalls do not use vfs layer,
41 * but directly operate on internal data structure, this allows user to
42 * use the IPC facility without having to mount mqueue file system.
43 */
44
45#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
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

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

38 * times at different mount points but shows same contents.
39 *
40 * 2) Standard POSIX message queue API. The syscalls do not use vfs layer,
41 * but directly operate on internal data structure, this allows user to
42 * use the IPC facility without having to mount mqueue file system.
43 */
44
45#include <sys/cdefs.h>
46__FBSDID("$FreeBSD: stable/11/sys/kern/uipc_mqueue.c 350263 2019-07-23 21:15:28Z emaste $");
46__FBSDID("$FreeBSD: stable/11/sys/kern/uipc_mqueue.c 351257 2019-08-20 17:46:22Z emaste $");
47
48#include "opt_capsicum.h"
49#include "opt_compat.h"
50
51#include <sys/param.h>
52#include <sys/kernel.h>
53#include <sys/systm.h>
54#include <sys/limits.h>

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

2783 int waitok;
2784
2785 error = getmq_write(td, uap->mqd, &fp, NULL, &mq);
2786 if (error)
2787 return (error);
2788 if (uap->abs_timeout != NULL) {
2789 error = copyin(uap->abs_timeout, &ets32, sizeof(ets32));
2790 if (error != 0)
47
48#include "opt_capsicum.h"
49#include "opt_compat.h"
50
51#include <sys/param.h>
52#include <sys/kernel.h>
53#include <sys/systm.h>
54#include <sys/limits.h>

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

2783 int waitok;
2784
2785 error = getmq_write(td, uap->mqd, &fp, NULL, &mq);
2786 if (error)
2787 return (error);
2788 if (uap->abs_timeout != NULL) {
2789 error = copyin(uap->abs_timeout, &ets32, sizeof(ets32));
2790 if (error != 0)
2791 return (error);
2791 goto out;
2792 CP(ets32, ets, tv_sec);
2793 CP(ets32, ets, tv_nsec);
2794 abs_timeout = &ets;
2795 } else
2796 abs_timeout = NULL;
2797 waitok = !(fp->f_flag & O_NONBLOCK);
2798 error = mqueue_send(mq, uap->msg_ptr, uap->msg_len,
2799 uap->msg_prio, waitok, abs_timeout);
2792 CP(ets32, ets, tv_sec);
2793 CP(ets32, ets, tv_nsec);
2794 abs_timeout = &ets;
2795 } else
2796 abs_timeout = NULL;
2797 waitok = !(fp->f_flag & O_NONBLOCK);
2798 error = mqueue_send(mq, uap->msg_ptr, uap->msg_len,
2799 uap->msg_prio, waitok, abs_timeout);
2800out:
2800 fdrop(fp, td);
2801 return (error);
2802}
2803
2804int
2805freebsd32_kmq_timedreceive(struct thread *td,
2806 struct freebsd32_kmq_timedreceive_args *uap)
2807{

--- 116 unchanged lines hidden ---
2801 fdrop(fp, td);
2802 return (error);
2803}
2804
2805int
2806freebsd32_kmq_timedreceive(struct thread *td,
2807 struct freebsd32_kmq_timedreceive_args *uap)
2808{

--- 116 unchanged lines hidden ---