freebsd-dev/lib/libc/sys
Maxim Sobolev 339efd75a4 Add a new socket option SO_TS_CLOCK to pick from several different clock
sources to return timestamps when SO_TIMESTAMP is enabled. Two additional
clock sources are:

o nanosecond resolution realtime clock (equivalent of CLOCK_REALTIME);
o nanosecond resolution monotonic clock (equivalent of CLOCK_MONOTONIC).

In addition to this, this option provides unified interface to get bintime
(equivalent of using SO_BINTIME), except it also supported with IPv6 where
SO_BINTIME has never been supported. The long term plan is to depreciate
SO_BINTIME and move everything to using SO_TS_CLOCK.

Idea for this enhancement has been briefly discussed on the Net session
during dev summit in Ottawa last June and the general input was positive.

This change is believed to benefit network benchmarks/profiling as well
as other scenarios where precise time of arrival measurement is necessary.

There are two regression test cases as part of this commit: one extends unix
domain test code (unix_cmsg) to test new SCM_XXX types and another one
implementis totally new test case which exchanges UDP packets between two
processes using both conventional methods (i.e. calling clock_gettime(2)
before recv(2) and after send(2)), as well as using setsockopt()+recv() in
receive path. The resulting delays are checked for sanity for all supported
clock types.

Reviewed by:    adrian, gnn
Differential Revision:  https://reviews.freebsd.org/D9171
2017-01-16 17:46:38 +00:00
..
__error.c
__vdso_gettimeofday.c Implement userspace gettimeofday(2) with HPET timecounter. 2016-08-17 09:52:09 +00:00
_exit.2 intro(2),_exit(2): Update for reaper (procctl(PROC_REAP_ACQUIRE)). 2016-09-08 21:50:03 +00:00
_umtx_op.2 Fix markup. 2016-06-04 20:20:14 +00:00
abort2.2
accept4.c
accept.2
accept.c
access.2
acct.2
adjtime.2
aio_cancel.2
aio_error.2
aio_fsync.2 Fix various nits in the aio operation manpages. 2016-08-19 17:37:32 +00:00
aio_mlock.2 Fix various nits in the aio operation manpages. 2016-08-19 17:37:32 +00:00
aio_read.2 Fix various nits in the aio operation manpages. 2016-08-19 17:37:32 +00:00
aio_return.2 Fully handle size_t lengths in AIO requests. 2016-03-21 21:37:33 +00:00
aio_suspend.2
aio_suspend.c
aio_waitcomplete.2 Fully handle size_t lengths in AIO requests. 2016-03-21 21:37:33 +00:00
aio_write.2 Fix various nits in the aio operation manpages. 2016-08-19 17:37:32 +00:00
bind.2 Remove <sys/types.h> from the SYNOPSIS. 2016-08-18 06:39:09 +00:00
bindat.2
brk.2
cap_enter.2 Add an article. 2016-09-30 15:47:13 +00:00
cap_fcntls_limit.2
cap_ioctls_limit.2
cap_rights_limit.2
chdir.2
chflags.2
chmod.2
chown.2
chroot.2
clock_gettime.2
clock_gettime.c
close.2
close.c
closefrom.2
connect.2 Remove <sys/types.h> from the SYNOPSIS. 2016-08-18 06:39:09 +00:00
connect.c
connectat.2
cpuset_getaffinity.2 Improve errno documentation in pthread_create(3) and thr_new(2) 2016-06-03 14:30:32 +00:00
cpuset.2
dup.2
execve.2
extattr_get_file.2
fcntl.2 fcntl(2): Document interrupt/restart for file locks. 2016-07-07 21:44:59 +00:00
fcntl.c
fdatasync.c The fdatasync(2) call must be cancellation point. 2016-08-16 08:27:03 +00:00
ffclock.2
fhopen.2
flock.2
fork.2
fork.c
fsync.2 Add fdatasync(2) man page, combined with fsync(2). 2016-08-17 10:16:42 +00:00
fsync.c
futimens.c Update futimens/utimensat for MFC to stable/10: 2016-01-12 20:53:57 +00:00
getdirentries.2 Fix spelling of MAXNAMLEN. 2016-03-09 13:45:03 +00:00
getdtablesize.2 sysconf(2) -> sysconf(3) 2016-02-29 17:20:04 +00:00
getfh.2
getfsstat.2 Rename the 'flags' argument to getfsstat() to 'mode' and validate it. 2016-12-27 20:21:11 +00:00
getgid.2
getgroups.2
getitimer.2
getlogin.2
getloginclass.2 Add some .Xrs to getloginclass(2). 2016-07-12 06:00:57 +00:00
getpeername.2
getpgrp.2
getpid.2
getpriority.2
getrlimit.2 Minor markup and wording fixes. 2016-09-30 13:04:18 +00:00
getrusage.2
getsid.2
getsockname.2
getsockopt.2 Add a new socket option SO_TS_CLOCK to pick from several different clock 2017-01-16 17:46:38 +00:00
gettimeofday.2
gettimeofday.c
getuid.2
interposing_table.c The fdatasync(2) call must be cancellation point. 2016-08-16 08:27:03 +00:00
intro.2 intro(2),_exit(2): Update for reaper (procctl(PROC_REAP_ACQUIRE)). 2016-09-08 21:50:03 +00:00
ioctl.2
issetugid.2
jail.2 Mark jail(2), and the sysctls that it (and only it) uses as deprecated. 2016-05-30 05:21:24 +00:00
kenv.2
kevent.c
kill.2
kldfind.2
kldfirstmod.2
kldload.2
kldnext.2
kldstat.2
kldsym.2 Use 'cmd' rather than 'command' to match the function prototype. 2016-10-17 22:36:37 +00:00
kldunload.2
kqueue.2 Improve grammar. 2016-10-06 17:35:50 +00:00
ktrace.2 Document KTRFAC_FAULT and KTRFAC_FAULTEND. 2016-03-31 23:55:19 +00:00
link.2
lio_listio.2 Add documentation for the sigevent structure. 2016-07-15 15:12:56 +00:00
listen.2 Remove <sys/types.h> from the SYNOPSIS. 2016-08-18 06:39:09 +00:00
lseek.2 Bump .Dd for r295764 2016-02-18 18:50:03 +00:00
madvise.2
Makefile.inc Document thr_suspend(2) and thr_wake(2). 2016-09-26 08:18:34 +00:00
mincore.2
minherit.2
mkdir.2
mkfifo.2
mknod.2
mlock.2
mlockall.2
mmap.2 Launder VPO_NOSYNC pages upon vnode deactivation. 2016-11-26 21:00:27 +00:00
modfind.2 Use the right argumant name 2016-03-18 08:47:17 +00:00
modnext.2
modstat.2
mount.2
mprotect.2 mprotect(): Change prototype to comply to POSIX. 2016-08-03 06:33:04 +00:00
mq_close.2
mq_getattr.2
mq_notify.2 Add documentation for the sigevent structure. 2016-07-15 15:12:56 +00:00
mq_open.2
mq_receive.2
mq_send.2
mq_setattr.2
msgctl.2
msgget.2
msgrcv.2 Change the return type of msgrcv() to ssize_t as required by POSIX. 2016-07-28 12:22:01 +00:00
msgsnd.2
msync.2
msync.c
munmap.2
nanosleep.2
nanosleep.c
nfssvc.2
ntp_adjtime.2
numa_getaffinity.2
open.2 open(2): Clarify non-POSIX error when opening a symlink with O_NOFOLLOW. 2016-11-22 22:30:55 +00:00
open.c
openat.c
pathconf.2
pdfork.2 Introduce the PD_CLOEXEC for pdfork(2). 2016-06-08 02:09:14 +00:00
pipe.2 Change wording to use function rather than system call in the description 2016-07-20 18:16:58 +00:00
pipe.c Replace use of the pipe(2) system call with pipe2(2) with a zero flags 2016-06-22 21:11:27 +00:00
poll.2
poll.c
posix_fadvise.2
posix_fallocate.2
posix_openpt.2 posix_openpt.2: Sort includes per style(9) 2016-09-21 17:51:27 +00:00
ppoll.c
procctl.2 Editing fixes for r306257, documentation for trapcap. 2016-09-27 11:31:53 +00:00
profil.2
pselect.2
pselect.c
ptrace.2 Typesetting fixes. 2016-08-29 19:53:13 +00:00
ptrace.c Rewrite ptrace(2) wrappers in C. 2016-08-29 18:47:51 +00:00
quotactl.2
rctl_add_rule.2 Add manpage for rctl_* system calls 2016-09-19 02:25:30 +00:00
read.2
read.c
readlink.2
readv.c
reboot.2 kenv(8) -> kenv(1) 2016-02-29 17:22:34 +00:00
recv.2 Remove <sys/types.h> from the SYNOPSIS. 2016-08-18 06:39:09 +00:00
recvfrom.c
recvmsg.c
rename.2
revoke.2 Restore flushing of output for revoke(2) again. Document revoke()'s 2016-01-26 07:57:44 +00:00
rfork.2
rmdir.2
rtprio.2
sched_get_priority_max.2
sched_setparam.2
sched_setscheduler.2
sched_yield.2
sctp_generic_recvmsg.2
sctp_generic_sendmsg.2
sctp_peeloff.2
select.2
select.c
semctl.2
semget.2 semget(2): Add missing [EINVAL] conditions. 2016-02-07 21:25:08 +00:00
semop.2
send.2 Remove <sys/types.h> from the SYNOPSIS. 2016-08-18 06:39:09 +00:00
sendfile.2 Add flag SF_USER_READAHEAD to sendfile(2). When specified, the syscall won't 2016-11-17 21:36:18 +00:00
sendmsg.c
sendto.c
setcontext.c
setfib.2
setgroups.2
setpgid.2
setregid.2
setresuid.2
setreuid.2
setsid.2
setuid.2
shm_open.2 Update the shm_open.2 man page to reflect objective reality. 2017-01-13 19:41:02 +00:00
shmat.2
shmctl.2
shmget.2
shutdown.2
sigaction.2 Reinstate Xr macros that were accidentally removed in a previous 2016-09-30 13:05:32 +00:00
sigaction.c
sigaltstack.2
sigpending.2
sigprocmask.2
sigprocmask.c
sigqueue.2
sigreturn.2
sigstack.2
sigsuspend.2
sigsuspend.c
sigtimedwait.c
sigwait.2
sigwait.c
sigwaitinfo.2
sigwaitinfo.c
socket.2 Remove <sys/types.h> from the SYNOPSIS. 2016-08-18 06:39:09 +00:00
socketpair.2
stat.2 - Add the 'restrict' type qualifier to match function prototype. 2016-01-14 01:33:16 +00:00
statfs.2
swapcontext.c
swapon.2
Symbol.map Garbage collect _umtx_lock(2)/_umtx_unlock(2) references removed in r263318. 2016-08-17 10:20:05 +00:00
symlink.2
sync.2
sysarch.2
syscall.2
thr_exit.2 thr_*(2): Add xrefs to what libthr implements using each syscall. 2016-06-01 21:58:13 +00:00
thr_kill.2 thr_*(2): Add xrefs to what libthr implements using each syscall. 2016-06-01 21:58:13 +00:00
thr_new.2 Improve errno documentation in pthread_create(3) and thr_new(2) 2016-06-03 14:30:32 +00:00
thr_self.2 thr_*(2): Add xrefs to what libthr implements using each syscall. 2016-06-01 21:58:13 +00:00
thr_set_name.2 thr_set_name(): silently truncate the given name as needed 2016-12-03 01:14:21 +00:00
thr_suspend.2 Reword the statement. 2016-09-30 16:02:25 +00:00
thr_wake.2 Document thr_suspend(2) and thr_wake(2). 2016-09-26 08:18:34 +00:00
timer_create.2 Add documentation for the sigevent structure. 2016-07-15 15:12:56 +00:00
timer_delete.2
timer_settime.2
trivial-vdso_tc.c Implement userspace gettimeofday(2) with HPET timecounter. 2016-08-17 09:52:09 +00:00
truncate.2
umask.2
undelete.2
unlink.2
utimensat.2 utimensat(2): Correct description of [EINVAL] error. 2016-01-17 21:14:27 +00:00
utimensat.c Update futimens/utimensat for MFC to stable/10: 2016-01-12 20:53:57 +00:00
utimes.2 utimes(2),utime(3): Add deprecation in favour of utimensat(2) and futimens(2). 2016-06-09 22:14:58 +00:00
utrace.2 mdoc: sort Xr 2016-01-18 20:21:38 +00:00
uuidgen.2
vfork.2 vfork(2): Mention some risks of calling vfork() from application code. 2016-05-22 13:32:45 +00:00
wait4.c
wait6.c
wait.2 Document behavior of wait introduced in the r286698. 2016-06-01 19:49:38 +00:00
write.2
write.c
writev.c