OPNsense - FreeBSD source
Find a file
Mark Johnston dabde7d976 libdtrace: Permit taking the address of an identifier without type info
Symbols defined using assembler directives lack type info, but in this
case one ought to be able to cast a pointer to the symbol and
dereference the pointer to get a value.  Without this change, D
disallows this trick since it requires all identifiers to have a type.

Relax the rules slightly and allow an identifier to have type "void" if
we know we're just taking its address.

As a result, the following dtrace invocation works:

  dtrace -n 'tick-1s {printf("%d", *(int *)&`ticks);}'

In particular, since commit b2b974f7ef ("clock: Simplify subr_ticks
and rename"), "ticks" does not have any type info associated with it, so
its value couldn't be printed.  This trick provides a workaround and is
probably generally useful.

Add a regression test which exercises this functionality.

PR:		287752
Reviewed by:	avg
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D51417
2025-07-21 14:57:58 +00:00
.cirrus-ci
.github GitHub: Provide more context in pull request issue comment 2025-07-16 10:34:20 -04:00
bin manpages: prefer linking to xo_options.7 over xo_parse_args.3 2025-07-16 12:02:24 -06:00
cddl libdtrace: Permit taking the address of an identifier without type info 2025-07-21 14:57:58 +00:00
contrib MFV: less v679. 2025-07-20 10:33:52 -07:00
crypto openssh: Support building with MIT KRB5 2025-06-15 19:49:36 -07:00
etc examples: Add a demo program for inotify 2025-07-04 14:42:34 +00:00
gnu build: remove the last vestiges of lint support 2025-06-06 00:55:34 +01:00
include libc: Rename fscandir{,_b}() to fdscandir{,_b}(). 2025-06-23 15:03:10 +02:00
kerberos5 build: remove the last vestiges of lint support 2025-06-06 00:55:34 +01:00
krb5 krb5: Install the libkrb5clnt.so symlink with the .so 2025-07-08 06:54:27 -07:00
lib libusb: implement libusb_fill_bulk_stream_transfer 2025-07-21 02:16:41 -04:00
libexec rtld: do not relocate tlsinit address twice 2025-07-21 08:29:05 +03:00
release release: Generalise the OCI image build's pkg config 2025-07-21 13:43:21 +01:00
rescue nvmf: Switch several ioctls to using nvlists 2024-12-30 13:52:21 -05:00
sbin if_gif(4): Support the NOCLAMP flag to change MTU handling for IPv6 2025-07-21 22:47:28 +09:00
secure openssh: Support building with MIT KRB5 2025-06-15 19:49:36 -07:00
share KRB5: Enable MIT KRB5 by default 2025-07-21 07:07:22 -07:00
stand stand: Add print_delay environment variable in loader 2025-07-21 16:33:20 +02:00
sys amd64: Make a comment less confusing 2025-07-21 14:57:58 +00:00
targets build: remove the last vestiges of lint support 2025-06-06 00:55:34 +01:00
tests pf tests: make mbuf:inet6_in_mbuf_len more robust 2025-07-18 21:12:18 +02:00
tools stress2/fullpath2: Clean up the vn_fullpath DTrace one-liner 2025-07-18 22:24:38 +02:00
usr.bin man.sh: avoid endless loop 2025-07-21 07:23:45 +00:00
usr.sbin trim(8): fix usage line 2025-07-20 17:42:27 +07:00
.arcconfig arcanist: use FreeBSD/git project repository instead of FreeBSD/svn 2022-08-23 14:16:41 +00:00
.arclint
.cirrus.yml .cirrus.yml: Switch to manual mode for internal CI 2025-07-06 14:40:24 +02:00
.clang-format clang-format: Minor tweaks 2024-04-30 17:33:43 -04:00
.git-blame-ignore-revs git-blame-ignore-revs: iflib style(9) tweaks 2025-06-06 18:07:06 +08:00
.gitattributes Remove SVN related Git attributes 2023-12-26 10:28:28 -07:00
.gitignore .gitignore: add sys/*/compile 2024-02-02 09:20:36 -07:00
.mailmap mailmap: Add Joyu Liao 2025-06-26 14:13:21 +02:00
CONTRIBUTING.md CONTRIBUTING.md/style: spring cleaning 2024-05-10 15:07:03 -06:00
COPYRIGHT copyright: Happy New Year 2025 2025-01-01 00:04:28 +00:00
LOCKS Update LOCKS for Git 2023-12-26 10:28:25 -07:00
MAINTAINERS man filesystems: fix more xrefs after move to s4 2024-06-27 18:32:05 -06:00
Makefile powerpc: Disconnect 32-bit powerpc from make universe 2025-07-14 11:01:09 -04:00
Makefile.inc1 packages: make UCL files required 2025-07-15 06:12:44 +01:00
Makefile.libcompat Makefile: Hook MIT KRB5 into the build 2025-06-15 19:49:37 -07:00
Makefile.sys.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ObsoleteFiles.inc md(4): Stop symlinking vn.4 to md.4 2025-07-16 16:23:41 +02:00
README.md Update README.md to add pointer to release page. 2024-05-09 20:40:46 -06:00
RELNOTES RELNOTES: Document the addition of inotify 2025-07-04 15:13:43 +00:00
UPDATING KRB5: Enable MIT KRB5 by default 2025-07-21 07:07:22 -07:00

FreeBSD Source:

This is the top level of the FreeBSD source directory.

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), FreeBSD handbook on building userland, and Handbook for kernels for more information, including setting make(1) variables.

For information on the CPU architectures and platforms supported by FreeBSD, see the FreeBSD website's Platforms page.

For official FreeBSD bootable images, see the release page.

Source Roadmap:

Directory Description
bin System/user commands.
cddl Various commands and libraries under the Common Development and Distribution License.
contrib Packages contributed by 3rd parties.
crypto Cryptography stuff (see crypto/README).
etc Template files for /etc.
gnu Commands and libraries under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see gnu/COPYING and gnu/COPYING.LIB for more information.
include System include files.
kerberos5 Kerberos5 (Heimdal) package.
lib System libraries.
libexec System daemons.
release Release building Makefile & associated tools.
rescue Build system for statically linked /rescue utilities.
sbin System commands.
secure Cryptographic libraries and commands.
share Shared resources.
stand Boot loader sources.
sys Kernel sources (see sys/README.md).
targets Support for experimental DIRDEPS_BUILD
tests Regression tests which can be run by Kyua. See tests/README for additional information.
tools Utilities for regression testing and miscellaneous tasks.
usr.bin User commands.
usr.sbin System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see FreeBSD Handbook.