#define PATH_MAX 4096
#endif
-/* HACK to use pread/pwrite from eio if our platform doesn't have it /*
+/* HACK to use pread/pwrite from eio because MINGW32 doesn't have it /*
/* TODO fixme */
-#if !HAVE_PREADWRITE
+#if __MINGW32__
# define pread eio__pread
# define pwrite eio__pwrite
#endif
static inline Handle<Value> ParseAddressArgs(Handle<Value> first,
Handle<Value> second,
bool is_bind) {
-#ifdef __POSIX__ // No unix sockets on windows
- static struct sockaddr_un un;
-#endif
static struct sockaddr_in in;
static struct sockaddr_in6 in6;
FD_ARG(args[0])
int backlog = args[1]->IsInt32() ? args[1]->Int32Value() : 128;
+#ifdef __POSIX__
+ if (0 > listen(fd, backlog)) {
+#else // __MINGW32__
if (0 > listen(_get_osfhandle(fd), backlog)) {
+#endif
return ThrowException(ErrnoException(errno, "listen"));
}
-
return Undefined();
}