Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/KASSERT.9
| Show All 23 Lines | |||||
| .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, | .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||||
| .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||||
| .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||||
| .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||||
| .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||||
| .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||||
| .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
| .\" | .\" | ||||
| .Dd March 19, 2024 | .Dd April 1, 2026 | ||||
| .Dt KASSERT 9 | .Dt KASSERT 9 | ||||
| .Os | .Os | ||||
| .Sh NAME | .Sh NAME | ||||
| .Nm KASSERT | .Nm KASSERT | ||||
| .Nd kernel expression verification macros | .Nd kernel expression verification macros | ||||
| .Sh SYNOPSIS | .Sh SYNOPSIS | ||||
| .Cd "options INVARIANTS" | .Cd "options INVARIANTS" | ||||
| .Pp | .Pp | ||||
| ▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | |||||
| .Xr ddb 4 | .Xr ddb 4 | ||||
| .Pc . | .Pc . | ||||
| .Pp | .Pp | ||||
| The assertion | The assertion | ||||
| .Bd -literal -offset indent | .Bd -literal -offset indent | ||||
| MPASS(td == curthread); | MPASS(td == curthread); | ||||
| .Ed | .Ed | ||||
| .Pp | .Pp | ||||
| located on line 87 of a file named foo.c would generate the following panic | located in a function named | ||||
| .Fn bar | |||||
| on line 87 of a file named foo.c would generate the following panic | |||||
| message: | message: | ||||
| .Bd -literal -offset indent | .Bd -literal -offset indent | ||||
| panic: Assertion td == curthread failed at foo.c:87 | panic: Assertion td == curthread failed at foo.c:87 (bar) | ||||
| .Ed | .Ed | ||||
| .Pp | .Pp | ||||
| This is a simple condition, and the message provides enough information to | This is a simple condition, and the message provides enough information to | ||||
| investigate the failure. | investigate the failure. | ||||
| .Pp | .Pp | ||||
| The assertion | The assertion | ||||
| .Bd -literal -offset indent | .Bd -literal -offset indent | ||||
| MPASS(td == curthread && (sz >= SIZE_MIN && sz <= SIZE_MAX)); | MPASS(td == curthread && (sz >= SIZE_MIN && sz <= SIZE_MAX)); | ||||
| Show All 34 Lines | |||||