* stime.c (tzset): If tzset isn't provided, make it a NOP.
(scm_localtime): Change SCM_EOF to SCM_EOL.
(scm_mktime): Likewise.
* socket.c: Don't include sys/un.h unless autoconf tells
us Unix domain sockets are available.
(scm_fill_sockaddr): Ignore Unix domain code.
(scm_addr_vector): Likewise.
(scm_init_addr_buffer): Likewise.
(scm_socketpair): Don't include unless socketpair was
found during autoconf.
* simpos.c (SYSTNAME): Treat cygwin like Unix.
* scmsigs.c (scm_pause): Don't include unless pause was found
during autoconf.
* posix.c (scm_getgroups): Don't include unless support function
was found during autoconf (in this case, getgroups).
(scm_setpwent): For setpwent.
(scm_setegid): For setegid.
* net_db.c (scm_inet_netof): Don't include unless support
function was found during autoconf (in this case, inet_netof).
(scm_lnaof): For inet_lnaof.
(scm_inet_makeaddr): For inet_makeaddr.
(scm_getnet): For getnetent, getnetbyname, getnetbyaddr.
(scm_getproto): For getprotoent.
(scm_getserv): For getservent.
(scm_sethost): For sethostent, endhostent.
(scm_setnet): For setnetent, endnetent.
(scm_setproto): For setprotoent, endprotoent.
(scm_setserv): For setservent, endservent.
return answer;
}
+#ifdef HAVE_INET_NETOF
SCM_PROC (s_inet_netof, "inet-netof", 1, 0, 0, scm_inet_netof);
SCM
addr.s_addr = htonl (scm_num2ulong (address, (char *) SCM_ARG1, s_inet_netof));
return scm_ulong2num ((unsigned long) inet_netof (addr));
}
+#endif
+#ifdef HAVE_INET_LNAOF
SCM_PROC (s_lnaof, "inet-lnaof", 1, 0, 0, scm_lnaof);
SCM
addr.s_addr = htonl (scm_num2ulong (address, (char *) SCM_ARG1, s_lnaof));
return scm_ulong2num ((unsigned long) inet_lnaof (addr));
}
+#endif
-
+#ifdef HAVE_INET_MAKEADDR
SCM_PROC (s_inet_makeaddr, "inet-makeaddr", 2, 0, 0, scm_inet_makeaddr);
SCM
addr = inet_makeaddr (netnum, lnanum);
return scm_ulong2num (ntohl (addr.s_addr));
}
+#endif
/* !!! Doesn't take address format.
doesn't seem quite right (what if errno gets set as part of healthy
operation?), but it seems to work okay. We'll see. */
+#if defined(HAVE_GETNETENT) && defined(HAVE_GETNETBYNAME) && defined(HAVE_GETNETBYADDR)
SCM_PROC (s_getnet, "getnet", 0, 1, 0, scm_getnet);
SCM
ve[3] = scm_ulong2num (entry->n_net + 0L);
return ans;
}
+#endif
+#ifdef HAVE_GETPROTOENT
SCM_PROC (s_getproto, "getproto", 0, 1, 0, scm_getproto);
SCM
ve[2] = SCM_MAKINUM (entry->p_proto + 0L);
return ans;
}
-
+#endif
static SCM scm_return_entry SCM_P ((struct servent *entry));
return ans;
}
+#ifdef HAVE_GETSERVENT
SCM_PROC (s_getserv, "getserv", 0, 2, 0, scm_getserv);
SCM
SCM_ALLOW_INTS;
return scm_return_entry (entry);
}
+#endif
+#if defined(HAVE_SETHOSTENT) && defined(HAVE_ENDHOSTENT)
SCM_PROC (s_sethost, "sethost", 0, 1, 0, scm_sethost);
SCM
sethostent (SCM_NFALSEP (arg));
return SCM_UNSPECIFIED;
}
+#endif
+#if defined(HAVE_SETNETENT) && defined(HAVE_ENDNETENT)
SCM_PROC (s_setnet, "setnet", 0, 1, 0, scm_setnet);
SCM
setnetent (SCM_NFALSEP (arg));
return SCM_UNSPECIFIED;
}
+#endif
+#if defined(HAVE_SETPROTOENT) && defined(HAVE_ENDPROTOENT)
SCM_PROC (s_setproto, "setproto", 0, 1, 0, scm_setproto);
SCM
setprotoent (SCM_NFALSEP (arg));
return SCM_UNSPECIFIED;
}
+#endif
+#if defined(HAVE_SETSERVENT) && defined(HAVE_ENDSERVENT)
SCM_PROC (s_setserv, "setserv", 0, 1, 0, scm_setserv);
SCM
setservent (SCM_NFALSEP (arg));
return SCM_UNSPECIFIED;
}
+#endif
void
}
-
+#ifdef HAVE_GETGROUPS
SCM_PROC (s_getgroups, "getgroups", 0, 0, 0, scm_getgroups);
SCM
return ans;
}
}
-
+#endif
SCM_PROC (s_getpwuid, "getpw", 0, 1, 0, scm_getpwuid);
}
-
+#ifdef HAVE_SETPWENT
SCM_PROC (s_setpwent, "setpw", 0, 1, 0, scm_setpwent);
SCM
setpwent ();
return SCM_UNSPECIFIED;
}
+#endif
return SCM_UNSPECIFIED;
}
+#ifdef HAVE_SETEGID
SCM_PROC (s_setegid, "setegid", 1, 0, 0, scm_setegid);
SCM
return SCM_UNSPECIFIED;
}
+#endif
SCM_PROC (s_getpgrp, "getpgrp", 0, 0, 0, scm_getpgrp);
SCM
/* Define if the operating system can restart system calls. */
#undef HAVE_RESTARTS
+/* Define if the system supports Unix-domain (file-domain) sockets. */
+#undef HAVE_UNIX_DOMAIN_SOCKETS
+
/* Define if you have the ctermid function. */
#undef HAVE_CTERMID
/* Define if you have the geteuid function. */
#undef HAVE_GETEUID
+/* Define if you have the getgroups function. */
+#undef HAVE_GETGROUPS
+
/* Define if you have the gethostent function. */
#undef HAVE_GETHOSTENT
/* Define if you have the nice function. */
#undef HAVE_NICE
+/* Define if you have the pause function. */
+#undef HAVE_PAUSE
+
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
/* Define if you have the setpgid function. */
#undef HAVE_SETPGID
+/* Define if you have the setpwent function. */
+#undef HAVE_SETPWENT
+
/* Define if you have the setsid function. */
#undef HAVE_SETSID
/* Define if you have the sigaction function. */
#undef HAVE_SIGACTION
+/* Define if you have the socketpair function. */
+#undef HAVE_SOCKETPAIR
+
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define if you have the times function. */
#undef HAVE_TIMES
+/* Define if you have the tzset function. */
+#undef HAVE_TZSET
+
/* Define if you have the uname function. */
#undef HAVE_UNAME
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
+/* Define if you have the <regex.h> header file. */
+#undef HAVE_REGEX_H
+
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
return SCM_MAKINUM (j);
}
+#ifdef HAVE_PAUSE
SCM_PROC(s_pause, "pause", 0, 0, 0, scm_pause);
SCM
pause ();
return SCM_UNSPECIFIED;
}
+#endif
SCM_PROC(s_sleep, "sleep", 1, 0, 0, scm_sleep);
#ifdef vms
# define SYSTNAME "VMS"
#endif
-#if defined (unix) || defined (__unix)
+#if defined (unix) || defined (__unix) || defined(__CYGWIN32__)
# define SYSTNAME "UNIX"
#endif
#ifdef MWC
#endif
#include <sys/types.h>
#include <sys/socket.h>
+#ifdef UNIX_DOMAIN_SOCKETS
#include <sys/un.h>
+#endif
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
+#ifdef HAVE_SOCKETPAIR
SCM_PROC (s_socketpair, "socketpair", 3, 0, 0, scm_socketpair);
SCM
SCM_ALLOW_INTS;
return scm_cons (a, b);
}
-
+#endif
SCM_PROC (s_getsockopt, "getsockopt", 3, 0, 0, scm_getsockopt);
*size = sizeof (struct sockaddr_in);
return (struct sockaddr *) soka;
}
+#ifdef UNIX_DOMAIN_SOCKETS
case AF_UNIX:
{
struct sockaddr_un *soka;
*size = sizeof (struct sockaddr_un);
return (struct sockaddr *) soka;
}
+#endif
default:
scm_out_of_range (proc, SCM_MAKINUM (fam));
}
short int fam = address->sa_family;
SCM result;
SCM *ve;
+#ifdef UNIX_DOMAIN_SOCKETS
if (fam == AF_UNIX)
{
struct sockaddr_un *nad = (struct sockaddr_un *) address;
ve[1] = scm_makfromstr (nad->sun_path,
(scm_sizet) strlen (nad->sun_path), 0);
}
- else if (fam == AF_INET)
+ else
+#endif
+ if (fam == AF_INET)
{
struct sockaddr_in *nad = (struct sockaddr_in *) address;
result = scm_make_vector (SCM_MAKINUM (3), SCM_UNSPECIFIED, SCM_BOOL_F);
static void
scm_init_addr_buffer ()
{
- scm_addr_buffer_size = (int) sizeof (struct sockaddr_un);
+ scm_addr_buffer_size =
+#ifdef UNIX_DOMAIN_SOCKETS
+ (int) sizeof (struct sockaddr_un)
+#else
+ 0
+#endif
+ ;
if (sizeof (struct sockaddr_in) > scm_addr_buffer_size)
scm_addr_buffer_size = (int) sizeof (struct sockaddr_in);
scm_addr_buffer = scm_must_malloc (scm_addr_buffer_size, "address buffer");
}
#endif
+#ifndef HAVE_TZSET
+/* GNU-WIN32's cygwin.dll doesn't have this. */
+#define tzset()
+#endif
static long scm_my_base = 0;
strcpy (zname, ptr);
# else
scm_misc_error (s_localtime, "Not fully implemented on this platform",
- SCM_EOF);
+ SCM_EOL);
# endif
#endif
}
strcpy (zname, ptr);
# else
scm_misc_error (s_localtime, "Not fully implemented on this platform",
- SCM_EOF);
+ SCM_EOL);
# endif
#endif
}