jcs's openbsd hax
openbsd
1.\" $OpenBSD: feenableexcept.3,v 1.4 2025/06/07 10:33:06 schwarze Exp $
2.\"
3.\" Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: June 7 2025 $
18.Dt FEENABLEEXCEPT 3
19.Os
20.Sh NAME
21.Nm feenableexcept ,
22.Nm fedisableexcept ,
23.Nm fegetexcept
24.Nd control floating-point exception masks
25.Sh SYNOPSIS
26.Lb libm
27.In fenv.h
28.Ft int
29.Fn feenableexcept "int excepts"
30.Ft int
31.Fn fedisableexcept "int excepts"
32.Ft int
33.Fn fegetexcept void
34.Sh DESCRIPTION
35These functions provide control of the floating-point exception
36masks.
37The
38.Fa excepts
39input argument is a bitmask specifying an exception type and
40containing any of the values listed in
41.Xr feclearexcept 3 .
42.Pp
43The
44.Fn feenableexcept
45function unmasks the floating-point exceptions represented by
46.Fa excepts .
47The future floating-point operations that produce
48.Fa excepts
49will trap, and a
50.Dv SIGFPE
51will be delivered to the process.
52.Pp
53The
54.Fn fedisableexcept
55function masks the floating-point exceptions represented by
56.Fa excepts .
57All exceptions are masked by default.
58.Pp
59The
60.Fn fegetexcept
61function returns the current exception mask.
62.Sh RETURN VALUES
63The
64.Fn feenableexcept ,
65and
66.Fn fedisableexcept
67functions return the previous exception mask.
68The
69.Fn fegetexcept
70function returns the current exception mask.
71.Sh SEE ALSO
72.Xr sigaction 2 ,
73.Xr feclearexcept 3 ,
74.Xr fegetenv 3 ,
75.Xr fegetround 3
76.Sh STANDARDS
77The
78.Fn feenableexcept ,
79.Fn fedisableexcept ,
80and
81.Fn fegetexcept
82functions are
83.Ox
84extensions.
85.Sh HISTORY
86These functions first appeared in
87.Ox 5.0 .