summaryrefslogtreecommitdiff
path: root/sys/kern/subr_prf.c
AgeCommit message (Collapse)Author
2016-05-17Allow sendsyslog(2) with LOG_CONS even when /dev/console has notAlexander Bluhm
been opened during init(8). Only log with cnwrite() if cn_devvp exists, otherwise use cnputc() as fallback. While there move extern declarations to dev/cons.h. input and OK deraadt@
2015-09-29Delete the final, inscrutable NOSTRICT and VARARGS lint commentsPhilip Guenther
ok millert@
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2015-01-13Add dmesg -s support, to view the output of rc(8) system startup messages.Marco Pfatschbacher
Help and feedback by Theo and Miod. OK deraadt@, manpage-ok jmc@
2014-07-13KASSERTMSG(9): New kernel assertion with messageMasao Uebayashi
KASSERT() is annoying as it only prints the expression as a string. If you (developers) want to know a little more information, you have to do: #ifdef DIAGNOSTIC if (bad) panic(...); #endif KASSERTMSG() replaces it into a single line: KASSERTMSG(!bad, ...); Taken from NetBSD. (There is a concern that KASSERT() messages are too long; consume more memory, and not friendly for small monitors. This have to be considered & revisited later.) "Like" from henning@ Man page review & advices from jmc@ and schwarze@
2014-07-11reboot(9): Add MI reboot entry functionMasao Uebayashi
Now, for kernel to "reboot" (reboot, halt, or shutdown), MD boot(9) is called in some places. This change introduces a new MI function reboot(9) which is simply a wrapper to call MD boot(9). OK kettenis@ deraadt@
2013-12-12Add db_vprintf(), and then use it in ACPI's db_disprint() instead ofPhilip Guenther
formatting into a local buffer. ok miod@
2013-11-25disable %n in printf(9); there is no need for it in the kernel besidesDamien Miller
making format-string vulnerabilities exploitable; inspired by similar change made by Kees Cook to Linux; ok deraadt@
2013-08-07After a panic, do not fill up the dmesg with splassert messages.Alexander Bluhm
They scroll away the important information. Disable splassert in panic(). OK deraadt@ uebayasi@ sthen@
2013-07-03add support for %td for ptrdiff_t in kernel printfStefan Fritsch
this also adds support in gcc 4.x kprintf format checks ok kettenis@
2013-03-28do not include machine/cpu.h from a .c file; it is the responsibility ofTheo de Raadt
.h files to pull it in, if needed ok tedu
2011-04-03Allow kernel printfs to go to console if in ddb instead of being redirectedDale Rahn
to xconsole. ok deraadt@ guenther@
2010-07-26Correct the links between threads, processes, pgrps, and sessions,Philip Guenthe
so that the process-level stuff is to/from struct process and not struct proc. This fixes a bunch of problem cases in rthreads. Based on earlier work by blambert and myself, but mostly written at c2k10. Tested by many: deraadt, sthen, krw, ray, and in snapshots
2008-06-27Do not disallow kernel crash dumps on panic if swap encryption is enabled,Miod Vallat
as dumpsys() will now clear the sensitive information. ok djm@ (and dumpsys changes too)
2007-12-30Remove unused variable consintr. ok mbalmerAlexander Bluhm
2007-10-08Introduce %z for printf(9), like %z for printf(3). Used to printRay Lai
size_t and ssize_t variables. OK miod and cthulhu.
2007-09-01Remove support for ddb-only %r, %z, and the ddb-specific handling of %n fromMiod Vallat
the kernel printf. This will allow support for the real %z in the near future.
2007-04-26enable splassert (1) by default; requested and ok manyTheo de Raadt
2006-12-11allow bit 32 to be printed; bug spotted and fix tested by dlgTheo de Raadt
2006-11-17missing punctuation in comments; from bret lambertJason McIntyre
2006-07-06Make the ddb.log sysctl available as an in-ddb variable, $log, for consistency.Miod Vallat
2006-06-01the bit shifted should be a type at least as wide as the comparison (u_quad_t)Jason Wright
2006-05-29extend %b support so that it will allow for arguments with more than 32 bits.Jason Wright
2005-12-27tprintf() is now only necessary for NFS, so do not compile it for kernelsMiod Vallat
which like NFSSERVER and NFSCLIENT.
2005-12-09ansi and deregister. No binary change.Jonathan Gray
2005-09-27typo in comment: sprintf -> snprintf, ok markus@Alexander von Gernler
2005-04-14Try to start log message buffer on a new line. Helps install scripts avoidKenneth R Westerback
detecting phantom devices when scanning dmesg output. Suggested by miod@, ok deraadt@.
2004-07-20protect printf with a mutex instead of SIMPLELOCK.Artur Grabowski
2004-06-13debranch SMP, have funNiklas Hallqvist
2004-01-03put an mi wrapper around stdarg.h/varargs.h. gcc3 moved stdarg/varargs macrosMarc Espie
to built-ins, so eventually we will have one version of these files. Special adjustments for the kernel to cope: machine/stdarg.h -> sys/stdarg.h and machine/ansi.h needs to have a _BSD_VA_LIST_ for syslog* prototypes. okay millert@, drahn@, miod@.
2003-12-21Kill non-standard kernel printf %: braindead extension for good.Miod Vallat
ok markus@ drahn@
2003-06-28option to log ddb output to kernel message buffer, via sysctl ddb.logTed Unangst
ok deraadt@ henric@ djm@
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-05-29Add kern.splassert=3. deraadt@ ok.Hakan Olsson
2003-05-27typos in comments; From: Bengt Wessling <bengt@lemuria.org>, 10xHenning Brauer
2003-05-22remove sprintf() and vsprintf(). nothing in the kernel needs it. ifTheo de Raadt
some module does -- tough -- they can rewrite it using the safer versions.
2003-05-21Match vprintf prototype to userland and standards.Artur Grabowski
deraadt@ ok
2003-05-20ansi and de-register; ok millertJason Wright
2003-05-13Kill a bunch more commons (very few left =)Jason Wright
2003-05-10warn for strcpy|strcat|sprintf|vsprintf; ok art dhartmei pval, and either ↵Theo de Raadt
henning or pb, i cannot tell which it was
2003-05-06use snprintfTheo de Raadt
2003-01-13Fix kernel snprintf function(s) to be likeTobias Weingartner
userland in return values. deraadt@ ok.
2002-10-14Stuff needed for gcc 3.X.Artur Grabowski
gcc has the nice feature of optimizing various common constructs into more optimal ones, inlining various calls, etc. The problem with that is that it assumes that we have a proper libc backing us. We really don't want to loose all those features by defining -ffreestanding and right now there is no way to just disable some of them, so we have to make the kernel more libc-like in some aspects to make it work with newer gcc. rename putchar to kputchar because it was nothing like libc putchar (and only internal to this function). Implement dummy putchar and puts (not prototyped outside this file).
2002-05-20Add one more level to the kern.splassert sysctl.Artur Grabowski
0 - do nothing. 1 - small message on error (function name and the levels). 2 - big message on error (function name, levels and traceback (if possible)). 3 - panic. After suggestion from deraadt@.
2002-05-18dump the stack on splassert failure (XXX - need some kind ofArtur Grabowski
rate limiting).
2002-05-18If ddb.panic is disabled, print the stack trace before dumping.Artur Grabowski
2002-05-15Implement splassert() for sparc - a tool for finding problems related toArtur Grabowski
spl handling (already found 3 problems). Man page in a few seconds. deraadt@ ok.
2002-03-15Kill #if __STDC__ used to do K&R vs. ANSI varargs/stdarg; just do thingsTodd C. Miller
the ANSI way.
2002-03-14First round of __P removal in sysTodd C. Miller
2002-01-23Allocate rusage, pgrp, ucred and session with pool.Artur Grabowski