diff options
author | 2015-10-23 16:28:52 +0000 | |
---|---|---|
committer | 2015-10-23 16:28:52 +0000 | |
commit | 959a7adfa6345f0d4407e4a4919afdaabb76d05f (patch) | |
tree | bb78ef8ef8515e3f80378c4c75492f28648ac645 /usr.sbin/syslogd/syslogd.h | |
parent | tmux can call pledge() in main with large set and then reduce it (diff) | |
download | wireguard-openbsd-959a7adfa6345f0d4407e4a4919afdaabb76d05f.tar.xz wireguard-openbsd-959a7adfa6345f0d4407e4a4919afdaabb76d05f.zip |
If writing to a tty blocks, syslogd forked and tried to write again
in a background process. A potential fork(2) at every message is
bad, so replace this with an event. As a bonus the syslogd child
process does not need to pledge "proc" anymore. Also limit the
number of delayed write events.
OK deraadt@
Diffstat (limited to 'usr.sbin/syslogd/syslogd.h')
-rw-r--r-- | usr.sbin/syslogd/syslogd.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/syslogd/syslogd.h b/usr.sbin/syslogd/syslogd.h index bf908827ae7..25c8f026b29 100644 --- a/usr.sbin/syslogd/syslogd.h +++ b/usr.sbin/syslogd/syslogd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.h,v 1.22 2015/10/21 14:03:07 bluhm Exp $ */ +/* $OpenBSD: syslogd.h,v 1.23 2015/10/23 16:28:52 bluhm Exp $ */ /* * Copyright (c) 2003 Anil Madhavapeddy <anil@recoil.org> @@ -33,6 +33,7 @@ int priv_getnameinfo(struct sockaddr *, socklen_t, char *, size_t); /* Terminal message */ #define TTYMSGTIME 1 /* timeout used by ttymsg */ +#define TTYMAXDELAY 256 /* max events in ttymsg */ char *ttymsg(struct iovec *, int, char *); /* File descriptor send/recv */ @@ -47,6 +48,7 @@ extern char *path_ctlsock; extern int fd_ctlsock, fd_ctlconn, fd_klog, fd_sendsys; extern int fd_udp, fd_udp6, fd_bind, fd_listen, fd_tls, fd_unix[MAXUNIX]; +#define MAXLINE 8192 /* maximum line length */ #define ERRBUFSIZE 256 void logdebug(const char *, ...) __attribute__((__format__ (printf, 1, 2))); extern int Debug; |