v->iov_base = "\n";
v->iov_base = (char *) "\n";
vsyslog(pri, fmt, ap)	int pri;	register const char *fmt;	va_list ap;{	register int cnt;	register char ch, *p, *t;	time_t now;	int fd, saved_errno;	char *stdp, tbuf[2048], fmt_cpy[1024];#define	INTERNALLOG	LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID	/* Check for invalid bits. */	if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {		syslog(INTERNALLOG,		    "syslog: unknown facility/priority: %x", pri);		pri &= LOG_PRIMASK|LOG_FACMASK;	}	/* Check priority against setlogmask values. */	if (!LOG_MASK(LOG_PRI(pri)) & LogMask)		return;	saved_errno = errno;	/* Set default facility if none specified. */	if ((pri & LOG_FACMASK) == 0)		pri |= LogFacility;	/* Build the message. */	(void)time(&now);	p = tbuf + sprintf(tbuf, "<%d>", pri);	p += strftime(p, sizeof (tbuf) - (p - tbuf), "%h %e %T ",	    localtime(&now));	if (LogStat & LOG_PERROR)		stdp = p;	if (LogTag == NULL)		LogTag = __progname;	if (LogTag != NULL)		p += sprintf(p, "%s", LogTag);	if (LogStat & LOG_PID)		p += sprintf(p, "[%d]", getpid());	if (LogTag != NULL) {		*p++ = ':';		*p++ = ' ';	}	/* Substitute error message for %m. */	for (t = fmt_cpy; ch = *fmt; ++fmt)		if (ch == '%' && fmt[1] == 'm') {			++fmt;			t += sprintf(t, "%s", strerror(saved_errno));		} else			*t++ = ch;	*t = '\0';	p += vsprintf(p, fmt_cpy, ap);	cnt = p - tbuf;	/* Output to stderr if requested. */	if (LogStat & LOG_PERROR) {		struct iovec iov[2];		register struct iovec *v = iov;		v->iov_base = stdp;		v->iov_len = cnt - (stdp - tbuf);		++v;		v->iov_base = "\n";		v->iov_len = 1;		(void)writev(STDERR_FILENO, iov, 2);	}	/* Get connected, output the message to the local logger. */	if (!connected)		openlog(LogTag, LogStat | LOG_NDELAY, 0);	if (send(LogFile, tbuf, cnt, 0) >= 0)		return;	/*	 * Output the message to the console; don't worry about blocking,	 * if console blocks everything will.  Make sure the error reported	 * is the one from the syslogd failure.	 */	if (LogStat & LOG_CONS &&	    (fd = open(_PATH_CONSOLE, O_WRONLY, 0)) >= 0) {		(void)strcat(tbuf, "\r\n");		cnt += 2;		p = index(tbuf, '>') + 1;		(void)write(fd, p, cnt - (p - tbuf));		(void)close(fd);	}}