*/
#ifndef lint
-static char rcsid[] = "$Id: sys-sunos4.c,v 1.4 1996/04/04 04:06:59 paulus Exp $";
+static char rcsid[] = "$Id: sys-sunos4.c,v 1.6 1996/09/26 06:23:34 paulus Exp $";
#endif
#include <stdio.h>
#if defined(sun) && defined(sparc)
#include <alloca.h>
+#ifndef __GNUC__
+extern void *alloca();
+#endif
#endif /*sparc*/
static int pppfd;
{
int x;
- openlog("pppd", LOG_PID | LOG_NDELAY, LOG_PPP);
- setlogmask(LOG_UPTO(LOG_INFO));
- if (debug)
- setlogmask(LOG_UPTO(LOG_DEBUG));
-
/* Get an internet socket for doing socket ioctl's on. */
if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
syslog(LOG_ERR, "Couldn't create IP socket: %m");
close(iffd);
close(pppfd);
close(sockfd);
- closelog();
}
/*
return 0;
}
-/*
- * note_debug_level - note a change in the debug level.
- */
-void
-note_debug_level()
-{
- if (debug) {
- setlogmask(LOG_UPTO(LOG_DEBUG));
- } else {
- setlogmask(LOG_UPTO(LOG_WARNING));
- }
-}
-
/*
* ppp_available - check whether the system has any ppp interfaces
*/
npi[0] = proto;
npi[1] = (int) mode;
- if (strioctl(pppfd, PPPIO_NPMODE, &npi, 2 * sizeof(int), 0) < 0) {
+ if (strioctl(pppfd, PPPIO_NPMODE, npi, 2 * sizeof(int), 0) < 0) {
syslog(LOG_ERR, "ioctl(set NP %d mode to %d): %m", proto, mode);
return 0;
}
{
return (unsigned long) strtol(str, ptr, base);
}
+
+/*
+ * Or strerror :-(
+ */
+extern char *sys_errlist[];
+extern int sys_nerr;
+
+char *
+strerror(n)
+ int n;
+{
+ static char unknown[32];
+
+ if (n > 0 && n < sys_nerr)
+ return sys_errlist[n];
+ sprintf(unknown, "Error %d", n);
+ return unknown;
+}