From 03ca6dbdb80da79408f135d823fbd9a00fd4f25b Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Mon, 11 May 2026 12:49:13 +0300 Subject: ntsync(4) The driver implements the ntsync interface as specified in the Linux 7.0-rc3 document Documentation/userspace-api/ntsync.rst. Only the documentation and the userspace tests (Linux' tools/testing/selftests/drivers/ntsync/ntsync.c) were used for reference. When the documentation contradicted the tests, tests behavior was implemented. One quirk is that Linux API needs to return an error from ioctl() and to copyout the modified ioctl() argument. Our generic ioctl() is not flexible enough to implement this, so the ntsync_ioctl_copyout() hack allows to copyout the ioctl parameter directly from the ioctl method, instead of relying on the ioctl infra. The FreeBSD port of the tests, that can be compiled both on FreeBSD and Linux, is available at https://github.com/kostikbel/freebsd-ntsync-test. The Linux binary compiled with the Linux test harness, cannot be run under linuxolator due to unimplemented syscalls, but the shims in freebsd-ntsync-test can be compiled on Linux and resulting Linux/glibc binary run on linuxolator to test linux compat. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57038 --- sys/modules/Makefile | 1 + sys/modules/ntsync/Makefile | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 sys/modules/ntsync/Makefile (limited to 'sys/modules') diff --git a/sys/modules/Makefile b/sys/modules/Makefile index f21f22c174cd..9b31035aa89d 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -296,6 +296,7 @@ SUBDIR= \ nlsysevent \ nge \ nmdm \ + ntsync \ nullfs \ ${_ntb} \ nvd \ diff --git a/sys/modules/ntsync/Makefile b/sys/modules/ntsync/Makefile new file mode 100644 index 000000000000..00062a3455cc --- /dev/null +++ b/sys/modules/ntsync/Makefile @@ -0,0 +1,6 @@ +.PATH: ${SRCTOP}/sys/dev/ntsync + +KMOD= ntsync +SRCS= ntsync.c + +.include -- cgit v1.3