#
39152b4f |
| 26-Jul-2022 |
cheloha <cheloha@openbsd.org> |
moncontrol(3): remove hertz() fallback function
In the moncontrol(3) code in libc there is a fallback function, hertz(). The idea is, if getting kern.clockrate from sysctl(2) fails, we fall back to
moncontrol(3): remove hertz() fallback function
In the moncontrol(3) code in libc there is a fallback function, hertz(). The idea is, if getting kern.clockrate from sysctl(2) fails, we fall back to deriving the value of hz(9) using setitimer(2)'s rounding behavior.
This is extremely clever, but it actually sucks. Calling setitimer(2) quietly cancels any extant ITIMER_REAL timer, so moncontrol(3) cannot be safely used alongside setitimer(2). This fact is not documented.
kern.clockrate is not blocked by pledge(2), so outside of stack corruption (which we can't do anything about anyway) I don't see a way for the sysctl(2) call to ever fail on OpenBSD. So hertz() is also pointless.
Hence this patch: get rid of hertz().
Thread: https://marc.info/?l=openbsd-tech&m=163881542813633&w=2
ok guenther@
show more ...
|
#
87afc19e |
| 12-Oct-2020 |
deraadt <deraadt@openbsd.org> |
make fixed-sized fixed-value mib[] arrays be const ok guenther tb millert
|
#
df69c215 |
| 28-Jun-2019 |
deraadt <deraadt@openbsd.org> |
When system calls indicate an error they return -1, not some arbitrary value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if
When system calls indicate an error they return -1, not some arbitrary value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
show more ...
|
#
3240e6a8 |
| 21-Sep-2016 |
guenther <guenther@openbsd.org> |
Delete casts to off_t and size_t that are implied by assignments or prototypes. Ditto for some of the char* and void* casts too.
verified no change to instructions on ILP32 (i386) and LP64 (amd64)
Delete casts to off_t and size_t that are implied by assignments or prototypes. Ditto for some of the char* and void* casts too.
verified no change to instructions on ILP32 (i386) and LP64 (amd64) ok natano@ abluhm@ deraadt@ millert@
show more ...
|
#
dbf5b26b |
| 07-May-2016 |
guenther <guenther@openbsd.org> |
Declare moncontrol(3) APIs in <sys/gmon.h> Export _gmonparam again. Make gcrt0.o use an reserved name for _monstartup()
ok millert@
|
#
e72220c0 |
| 14-Mar-2016 |
mmcc <mmcc@openbsd.org> |
(char *)0 -> NULL
|
#
e4224292 |
| 13-Mar-2016 |
guenther <guenther@openbsd.org> |
environ and __progname are not declared in a public header; declare them in libc's hidden/stdlib.h instead of in each .c file that needs one
ok deraadt@ gsoares@ mpi@
|
#
25a9e580 |
| 19-Jan-2016 |
mmcc <mmcc@openbsd.org> |
replace (void *)0 with NULL
|
#
cbc0cb74 |
| 14-Sep-2015 |
guenther <guenther@openbsd.org> |
Wrap moncontrol() so that internal calls go direct and it's a weak symbol
|
#
ee993850 |
| 06-May-2015 |
jsg <jsg@openbsd.org> |
fix a fd leak in an error path in code under #ifdef DEBUG
|
#
aea60bee |
| 16-Jan-2015 |
deraadt <deraadt@openbsd.org> |
Move to the <limits.h> universe. review by millert, binary checking process with doug, concept with guenther
|
#
0f288458 |
| 12-Feb-2013 |
mpi <mpi@openbsd.org> |
Back out per-CPU kernel profiling, it shouldn't modify a public header at this moment.
|
#
6509ae56 |
| 12-Feb-2013 |
mpi <mpi@openbsd.org> |
Unbreak the tree by adding missing defines. Forgot to sync in previous spotted by todd@.
|
#
7f1ef45a |
| 20-Nov-2005 |
millert <millert@openbsd.org> |
Allocate space for profiling data using mmap instead of sbrk. Tested by myself and pedro@
|
#
c2c925de |
| 08-Aug-2005 |
espie <espie@openbsd.org> |
zap remaining rcsid.
Kill old files that are no longer compiled.
okay theo
|
#
f2c97eb2 |
| 21-Apr-2005 |
deraadt <deraadt@openbsd.org> |
be more careful about snprintf return value; ok beck cloder
|
#
ee40e6f6 |
| 23-Mar-2005 |
otto <otto@openbsd.org> |
deregister & ansify. ok deraad@ marco@ cloder@
|
#
74637cb2 |
| 25-Jun-2003 |
deraadt <deraadt@openbsd.org> |
protos
|
#
6580fee3 |
| 02-Jun-2003 |
millert <millert@openbsd.org> |
Remove the advertising clause in the UCB license which Berkeley rescinded 22 July 1999. Proofed by myself and Theo.
|
#
672e980c |
| 24-Nov-2002 |
cloder <cloder@openbsd.org> |
Zero out the reserved fields of struct gmonhdr rather than leaving stack garbage in them. From FreeBSD.
OK deraadt@
|
#
c364cbbd |
| 25-May-2002 |
deraadt <deraadt@openbsd.org> |
remaining easy snprintf conversions
|
#
c72b5b24 |
| 16-Feb-2002 |
millert <millert@openbsd.org> |
Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be don
Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
show more ...
|
#
3e7612c7 |
| 15-Jul-1998 |
millert <millert@openbsd.org> |
make that 0664 until we find out why umask is not being applied
|
#
bb728603 |
| 15-Jul-1998 |
millert <millert@openbsd.org> |
open gmon.out mode 0644, not 0666
|
#
3bfa8ee4 |
| 05-Jul-1998 |
deraadt <deraadt@openbsd.org> |
use STDERR_FILENO; kleink
|