void #if __STDC__ syslog(int pri, const char *fmt, ...) #else syslog(pri, fmt, va_alist) int pri; char *fmt; va_dcl #endif { va_list ap;  #if __STDC__ va_start(ap, fmt); #else va_start(ap); #endif vsyslog(pri, fmt, ap); va_end(ap);
while (1) { if (LogFile == -1) { SyslogAddr.sa_family = AF_UNIX; (void)strncpy(SyslogAddr.sa_data, _PATH_LOG, sizeof(SyslogAddr.sa_data)); if (LogStat & LOG_NDELAY) { if ((LogFile = __socket(AF_UNIX, LogType, 0)) == -1) return; (void)__fcntl(LogFile, F_SETFD, 1); } } if (LogFile != -1 && !connected) { int old_errno = errno; if (__connect(LogFile, &SyslogAddr, sizeof(SyslogAddr)) == -1) { int saved_errno = errno; (void)__close(LogFile); LogFile = -1; if (LogType == SOCK_DGRAM && saved_errno == EPROTOTYPE) {  LogType = SOCK_STREAM; __set_errno (old_errno); continue; } } else connected = 1; } break; }
static void openlog_internal(const char *, int, int) internal_function;static void closelog_internal(void);static void sigpipe_handler (int);#ifdef _LIBC_REENTRANTstatic void cancel_handler (void *);#endif/* * syslog, vsyslog -- *	print message on log file; output is intended for syslogd(8). */void#if __STDC__syslog(int pri, const char *fmt, ...)#elsesyslog(pri, fmt, va_alist)	int pri;	char *fmt;	va_dcl#endif{	va_list ap;#if __STDC__	va_start(ap, fmt);#else	va_start(ap);#endif	vsyslog(pri, fmt, ap);	va_end(ap);}