uipc_usrreq.c (337975) | uipc_usrreq.c (338617) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. 4 * Copyright (c) 2004-2009 Robert N. M. Watson 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 42 unchanged lines hidden (view full) --- 51 * 52 * TODO: 53 * RDM 54 * rethink name space problems 55 * need a proper out-of-band 56 */ 57 58#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. 4 * Copyright (c) 2004-2009 Robert N. M. Watson 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 42 unchanged lines hidden (view full) --- 51 * 52 * TODO: 53 * RDM 54 * rethink name space problems 55 * need a proper out-of-band 56 */ 57 58#include <sys/cdefs.h> |
59__FBSDID("$FreeBSD: stable/11/sys/kern/uipc_usrreq.c 337975 2018-08-17 16:04:20Z markj $"); | 59__FBSDID("$FreeBSD: stable/11/sys/kern/uipc_usrreq.c 338617 2018-09-12 18:52:18Z sobomax $"); |
60 61#include "opt_ddb.h" 62 63#include <sys/param.h> 64#include <sys/capsicum.h> 65#include <sys/domain.h> 66#include <sys/fcntl.h> 67#include <sys/malloc.h> /* XXX must be before <sys/file.h> */ --- 1835 unchanged lines hidden (view full) --- 1903 struct proc *p = td->td_proc; 1904 struct filedesc *fdesc = p->p_fd; 1905 struct bintime *bt; 1906 struct cmsghdr *cm = mtod(control, struct cmsghdr *); 1907 struct cmsgcred *cmcred; 1908 struct filedescent *fde, **fdep, *fdev; 1909 struct file *fp; 1910 struct timeval *tv; | 60 61#include "opt_ddb.h" 62 63#include <sys/param.h> 64#include <sys/capsicum.h> 65#include <sys/domain.h> 66#include <sys/fcntl.h> 67#include <sys/malloc.h> /* XXX must be before <sys/file.h> */ --- 1835 unchanged lines hidden (view full) --- 1903 struct proc *p = td->td_proc; 1904 struct filedesc *fdesc = p->p_fd; 1905 struct bintime *bt; 1906 struct cmsghdr *cm = mtod(control, struct cmsghdr *); 1907 struct cmsgcred *cmcred; 1908 struct filedescent *fde, **fdep, *fdev; 1909 struct file *fp; 1910 struct timeval *tv; |
1911 struct timespec *ts; |
|
1911 int i, *fdp; 1912 void *data; 1913 socklen_t clen = control->m_len, datalen; 1914 int error, oldfds; 1915 u_int newlen; 1916 1917 UNP_LINK_UNLOCK_ASSERT(); 1918 --- 104 unchanged lines hidden (view full) --- 2023 error = ENOBUFS; 2024 goto out; 2025 } 2026 bt = (struct bintime *) 2027 CMSG_DATA(mtod(*controlp, struct cmsghdr *)); 2028 bintime(bt); 2029 break; 2030 | 1912 int i, *fdp; 1913 void *data; 1914 socklen_t clen = control->m_len, datalen; 1915 int error, oldfds; 1916 u_int newlen; 1917 1918 UNP_LINK_UNLOCK_ASSERT(); 1919 --- 104 unchanged lines hidden (view full) --- 2024 error = ENOBUFS; 2025 goto out; 2026 } 2027 bt = (struct bintime *) 2028 CMSG_DATA(mtod(*controlp, struct cmsghdr *)); 2029 bintime(bt); 2030 break; 2031 |
2032 case SCM_REALTIME: 2033 *controlp = sbcreatecontrol(NULL, sizeof(*ts), 2034 SCM_REALTIME, SOL_SOCKET); 2035 if (*controlp == NULL) { 2036 error = ENOBUFS; 2037 goto out; 2038 } 2039 ts = (struct timespec *) 2040 CMSG_DATA(mtod(*controlp, struct cmsghdr *)); 2041 nanotime(ts); 2042 break; 2043 2044 case SCM_MONOTONIC: 2045 *controlp = sbcreatecontrol(NULL, sizeof(*ts), 2046 SCM_MONOTONIC, SOL_SOCKET); 2047 if (*controlp == NULL) { 2048 error = ENOBUFS; 2049 goto out; 2050 } 2051 ts = (struct timespec *) 2052 CMSG_DATA(mtod(*controlp, struct cmsghdr *)); 2053 nanouptime(ts); 2054 break; 2055 |
|
2031 default: 2032 error = EINVAL; 2033 goto out; 2034 } 2035 2036 controlp = &(*controlp)->m_next; 2037 if (CMSG_SPACE(datalen) < clen) { 2038 clen -= CMSG_SPACE(datalen); --- 542 unchanged lines hidden --- | 2056 default: 2057 error = EINVAL; 2058 goto out; 2059 } 2060 2061 controlp = &(*controlp)->m_next; 2062 if (CMSG_SPACE(datalen) < clen) { 2063 clen -= CMSG_SPACE(datalen); --- 542 unchanged lines hidden --- |