Allow the user to suppress the rate-limited pty(4) warning.
The pty(4) driver raises up to warnings when an old BSD-style PTY is created. The reason why I added this warning, was to make it easier to spot applications that allocate BSD-style PTY's, while they should just use openpty() or posix_openpt(). Add a sysctl, which allows you to override the number of remaining messages, making it possible to suppress the warnings. Requested by: kib Reviewed by: kib
This commit is contained in:
parent
d444cd5f28
commit
1a643b0f02
@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/tty.h>
|
||||
|
||||
@ -46,7 +47,10 @@ __FBSDID("$FreeBSD$");
|
||||
* si_drv1 inside the cdev to mark whether the PTY is in use.
|
||||
*/
|
||||
|
||||
static int pty_warningcnt = 10;
|
||||
static unsigned int pty_warningcnt = 10;
|
||||
SYSCTL_UINT(_kern, OID_AUTO, tty_pty_warningcnt, CTLFLAG_RW,
|
||||
&pty_warningcnt, 0,
|
||||
"Warnings that will be triggered upon PTY allocation");
|
||||
|
||||
static int
|
||||
ptydev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp)
|
||||
|
Loading…
Reference in New Issue
Block a user