mirror of https://github.com/lukechilds/node.git
Ben Noordhuis
12 years ago
132 changed files with 3206 additions and 2991 deletions
@ -1,53 +0,0 @@ |
|||
# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|||
#
|
|||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|||
# of this software and associated documentation files (the "Software"), to
|
|||
# deal in the Software without restriction, including without limitation the
|
|||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|||
# sell copies of the Software, and to permit persons to whom the Software is
|
|||
# furnished to do so, subject to the following conditions:
|
|||
#
|
|||
# The above copyright notice and this permission notice shall be included in
|
|||
# all copies or substantial portions of the Software.
|
|||
#
|
|||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|||
# IN THE SOFTWARE.
|
|||
|
|||
SRCDIR ?= $(CURDIR) |
|||
|
|||
ifeq (,$(builddir_name)) |
|||
|
|||
VPATH := $(SRCDIR) |
|||
include $(SRCDIR)/build.mk |
|||
|
|||
else # Out of tree build.
|
|||
|
|||
# Drop all built-in rules.
|
|||
.SUFFIXES: |
|||
|
|||
.PHONY: $(builddir_name) |
|||
$(builddir_name): $(builddir_name)/.buildstamp |
|||
$(MAKE) -C $@ -f $(CURDIR)/Makefile $(MAKECMDGOALS) \
|
|||
SRCDIR=$(CURDIR) builddir_name= |
|||
|
|||
$(builddir_name)/.buildstamp: |
|||
mkdir -p $(dir $@) |
|||
touch $@ |
|||
|
|||
# Add no-op rules for Makefiles to stop make from trying to rebuild them.
|
|||
Makefile:: ; |
|||
%.mk:: ; |
|||
|
|||
# Turn everything else into a no-op rule that depends on the build directory.
|
|||
%:: $(builddir_name) ; |
|||
|
|||
.PHONY: clean distclean |
|||
clean distclean: |
|||
$(RM) -fr $(builddir_name) |
|||
|
|||
endif |
@ -0,0 +1,223 @@ |
|||
# Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl>
|
|||
#
|
|||
# Permission to use, copy, modify, and/or distribute this software for any
|
|||
# purpose with or without fee is hereby granted, provided that the above
|
|||
# copyright notice and this permission notice appear in all copies.
|
|||
#
|
|||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
|||
ACLOCAL_AMFLAGS = -I m4 |
|||
|
|||
AM_CPPFLAGS = -I$(top_srcdir)/include \
|
|||
-I$(top_srcdir)/src/unix \
|
|||
-I$(top_srcdir)/src |
|||
|
|||
include_HEADERS=include/uv.h include/uv-errno.h include/uv-unix.h |
|||
|
|||
CLEANFILES = |
|||
|
|||
lib_LTLIBRARIES = libuv.la |
|||
libuv_la_CFLAGS = @CFLAGS@ |
|||
libuv_la_LDFLAGS = -no-undefined -version-info 11:0:0 |
|||
libuv_la_SOURCES = src/fs-poll.c \
|
|||
src/inet.c \
|
|||
src/uv-common.c \
|
|||
src/uv-common.h \
|
|||
src/version.c \
|
|||
src/unix/async.c \
|
|||
src/unix/core.c \
|
|||
src/unix/dl.c \
|
|||
src/unix/fs.c \
|
|||
src/unix/getaddrinfo.c \
|
|||
src/unix/internal.h \
|
|||
src/unix/loop-watcher.c \
|
|||
src/unix/loop.c \
|
|||
src/unix/pipe.c \
|
|||
src/unix/poll.c \
|
|||
src/unix/process.c \
|
|||
src/unix/signal.c \
|
|||
src/unix/stream.c \
|
|||
src/unix/tcp.c \
|
|||
src/unix/thread.c \
|
|||
src/unix/threadpool.c \
|
|||
src/unix/timer.c \
|
|||
src/unix/tty.c \
|
|||
src/unix/udp.c |
|||
|
|||
TESTS = test/run-tests |
|||
check_PROGRAMS = test/run-tests |
|||
test_run_tests_SOURCES = test/blackhole-server.c \
|
|||
test/dns-server.c \
|
|||
test/echo-server.c \
|
|||
test/run-tests.c \
|
|||
test/runner-unix.c \
|
|||
test/runner-unix.h \
|
|||
test/runner.c \
|
|||
test/runner.h \
|
|||
test/task.h \
|
|||
test/test-active.c \
|
|||
test/test-async.c \
|
|||
test/test-barrier.c \
|
|||
test/test-callback-order.c \
|
|||
test/test-callback-stack.c \
|
|||
test/test-condvar.c \
|
|||
test/test-connection-fail.c \
|
|||
test/test-cwd-and-chdir.c \
|
|||
test/test-delayed-accept.c \
|
|||
test/test-dlerror.c \
|
|||
test/test-embed.c \
|
|||
test/test-error.c \
|
|||
test/test-fail-always.c \
|
|||
test/test-fs-event.c \
|
|||
test/test-fs-poll.c \
|
|||
test/test-fs.c \
|
|||
test/test-get-currentexe.c \
|
|||
test/test-get-loadavg.c \
|
|||
test/test-get-memory.c \
|
|||
test/test-getaddrinfo.c \
|
|||
test/test-getsockname.c \
|
|||
test/test-hrtime.c \
|
|||
test/test-idle.c \
|
|||
test/test-ip6-addr.c \
|
|||
test/test-ipc-send-recv.c \
|
|||
test/test-ipc.c \
|
|||
test/test-list.h \
|
|||
test/test-loop-handles.c \
|
|||
test/test-loop-stop.c \
|
|||
test/test-multiple-listen.c \
|
|||
test/test-mutexes.c \
|
|||
test/test-osx-select.c \
|
|||
test/test-pass-always.c \
|
|||
test/test-ping-pong.c \
|
|||
test/test-pipe-bind-error.c \
|
|||
test/test-pipe-connect-error.c \
|
|||
test/test-platform-output.c \
|
|||
test/test-poll-close.c \
|
|||
test/test-poll.c \
|
|||
test/test-process-title.c \
|
|||
test/test-ref.c \
|
|||
test/test-run-nowait.c \
|
|||
test/test-run-once.c \
|
|||
test/test-semaphore.c \
|
|||
test/test-shutdown-close.c \
|
|||
test/test-shutdown-eof.c \
|
|||
test/test-signal-multiple-loops.c \
|
|||
test/test-signal.c \
|
|||
test/test-spawn.c \
|
|||
test/test-stdio-over-pipes.c \
|
|||
test/test-tcp-bind-error.c \
|
|||
test/test-tcp-bind6-error.c \
|
|||
test/test-tcp-close-while-connecting.c \
|
|||
test/test-tcp-close.c \
|
|||
test/test-tcp-connect-error-after-write.c \
|
|||
test/test-tcp-connect-error.c \
|
|||
test/test-tcp-connect-timeout.c \
|
|||
test/test-tcp-connect6-error.c \
|
|||
test/test-tcp-flags.c \
|
|||
test/test-tcp-open.c \
|
|||
test/test-tcp-read-stop.c \
|
|||
test/test-tcp-shutdown-after-write.c \
|
|||
test/test-tcp-unexpected-read.c \
|
|||
test/test-tcp-write-to-half-open-connection.c \
|
|||
test/test-tcp-writealot.c \
|
|||
test/test-thread.c \
|
|||
test/test-threadpool-cancel.c \
|
|||
test/test-threadpool.c \
|
|||
test/test-timer-again.c \
|
|||
test/test-timer-from-check.c \
|
|||
test/test-timer.c \
|
|||
test/test-tty.c \
|
|||
test/test-udp-dgram-too-big.c \
|
|||
test/test-udp-ipv6.c \
|
|||
test/test-udp-multicast-join.c \
|
|||
test/test-udp-multicast-ttl.c \
|
|||
test/test-udp-open.c \
|
|||
test/test-udp-options.c \
|
|||
test/test-udp-send-and-recv.c \
|
|||
test/test-util.c \
|
|||
test/test-walk-handles.c |
|||
test_run_tests_LDADD = libuv.la |
|||
|
|||
if AIX |
|||
libuv_la_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500 |
|||
libuv_la_SOURCES += src/unix/aix.c |
|||
endif |
|||
|
|||
if DARWIN |
|||
include_HEADERS += include/uv-darwin.h |
|||
libuv_la_CFLAGS += -D_DARWIN_USE_64_BIT_INODE=1 |
|||
libuv_la_SOURCES += src/unix/darwin.c \
|
|||
src/unix/darwin-proctitle.c \
|
|||
src/unix/fsevents.c \
|
|||
src/unix/kqueue.c \
|
|||
src/unix/proctitle.c |
|||
libuv_la_LDFLAGS += -framework ApplicationServices \
|
|||
-framework CoreServices \
|
|||
-framework Foundation |
|||
endif |
|||
|
|||
if FREEBSD |
|||
include_HEADERS += include/uv-bsd.h |
|||
libuv_la_SOURCES += src/unix/freebsd.c src/unix/kqueue.c |
|||
endif |
|||
|
|||
if LINUX |
|||
include_HEADERS += include/uv-linux.h |
|||
libuv_la_SOURCES += src/unix/linux-core.c \
|
|||
src/unix/linux-inotify.c \
|
|||
src/unix/linux-syscalls.c \
|
|||
src/unix/linux-syscalls.h \
|
|||
src/unix/proctitle.c |
|||
endif |
|||
|
|||
if NETBSD |
|||
include_HEADERS += include/uv-bsd.h |
|||
libuv_la_SOURCES += src/unix/kqueue.c src/unix/netbsd.c |
|||
endif |
|||
|
|||
if OPENBSD |
|||
include_HEADERS += include/uv-bsd.h |
|||
libuv_la_SOURCES += src/unix/kqueue.c src/unix/openbsd.c |
|||
endif |
|||
|
|||
if SUNOS |
|||
include_HEADERS += include/uv-sunos.h |
|||
libuv_la_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500 |
|||
libuv_la_SOURCES += src/unix/sunos.c |
|||
endif |
|||
|
|||
if HAVE_DTRACE |
|||
BUILT_SOURCES = include/uv-dtrace.h |
|||
CLEANFILES += include/uv-dtrace.h |
|||
endif |
|||
|
|||
if DTRACE_NEEDS_OBJECTS |
|||
libuv_la_SOURCES += src/unix/uv-dtrace.d |
|||
libuv_la_DEPENDENCIES = src/unix/uv-dtrace.o |
|||
libuv_la_LIBADD = src/unix/uv-dtrace.lo |
|||
CLEANFILES += src/unix/uv-dtrace.o src/unix/uv-dtrace.lo |
|||
endif |
|||
|
|||
SUFFIXES = .d |
|||
|
|||
include/uv-dtrace.h: src/unix/uv-dtrace.d |
|||
$(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -h -xnolibs -s $< -o $@ |
|||
|
|||
src/unix/uv-dtrace.o: src/unix/uv-dtrace.d ${libuv_la_OBJECTS} |
|||
|
|||
.d.o: |
|||
$(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -G -o $@ -s $< \
|
|||
`grep '^pic_object' ${top_builddir}/*.lo | cut -f 2 -d\'` |
|||
$(AM_V_GEN)printf %s\\n \
|
|||
'# $(patsubst %.o, %.lo, $@) - a libtool object file' \
|
|||
'# Generated by libtool (GNU libtool) 2.4' \
|
|||
'# libtool wants a .lo not a .o' \
|
|||
"pic_object='uv-dtrace.o'" \
|
|||
"non_pic_object='uv-dtrace.o'" \
|
|||
> $(patsubst %.o, %.lo, $@) |
@ -0,0 +1,25 @@ |
|||
#!/bin/sh |
|||
|
|||
# Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl> |
|||
# |
|||
# Permission to use, copy, modify, and/or distribute this software for any |
|||
# purpose with or without fee is hereby granted, provided that the above |
|||
# copyright notice and this permission notice appear in all copies. |
|||
# |
|||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|||
|
|||
if [ "$LIBTOOLIZE" == "" ] && [ "`uname`" == "Darwin" ]; then |
|||
LIBTOOLIZE=glibtoolize |
|||
fi |
|||
|
|||
set -ex |
|||
${LIBTOOLIZE:-libtoolize} |
|||
${ACLOCAL:-aclocal -I m4} |
|||
${AUTOCONF:-autoconf} |
|||
${AUTOMAKE:-automake} --add-missing |
@ -1,169 +0,0 @@ |
|||
# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|||
#
|
|||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|||
# of this software and associated documentation files (the "Software"), to
|
|||
# deal in the Software without restriction, including without limitation the
|
|||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|||
# sell copies of the Software, and to permit persons to whom the Software is
|
|||
# furnished to do so, subject to the following conditions:
|
|||
#
|
|||
# The above copyright notice and this permission notice shall be included in
|
|||
# all copies or substantial portions of the Software.
|
|||
#
|
|||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|||
# IN THE SOFTWARE.
|
|||
|
|||
ifdef PLATFORM |
|||
override PLATFORM := $(shell echo $(PLATFORM) | tr "[A-Z]" "[a-z]") |
|||
else |
|||
PLATFORM = $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"') |
|||
endif |
|||
|
|||
CPPFLAGS += -I$(SRCDIR)/include -I$(SRCDIR)/include/uv-private |
|||
|
|||
ifeq (darwin,$(PLATFORM)) |
|||
SOEXT = dylib |
|||
else |
|||
SOEXT = so |
|||
endif |
|||
|
|||
ifneq (,$(findstring mingw,$(PLATFORM))) |
|||
include $(SRCDIR)/config-mingw.mk |
|||
else |
|||
include $(SRCDIR)/config-unix.mk |
|||
endif |
|||
|
|||
BENCHMARKS= \
|
|||
test/benchmark-async-pummel.o \
|
|||
test/benchmark-async.o \
|
|||
test/benchmark-fs-stat.o \
|
|||
test/benchmark-getaddrinfo.o \
|
|||
test/benchmark-loop-count.o \
|
|||
test/benchmark-million-async.o \
|
|||
test/benchmark-million-timers.o \
|
|||
test/benchmark-multi-accept.o \
|
|||
test/benchmark-ping-pongs.o \
|
|||
test/benchmark-pound.o \
|
|||
test/benchmark-pump.o \
|
|||
test/benchmark-sizes.o \
|
|||
test/benchmark-spawn.o \
|
|||
test/benchmark-tcp-write-batch.o \
|
|||
test/benchmark-thread.o \
|
|||
test/benchmark-udp-pummel.o \
|
|||
test/blackhole-server.o \
|
|||
test/dns-server.o \
|
|||
test/echo-server.o \
|
|||
|
|||
TESTS= \
|
|||
test/blackhole-server.o \
|
|||
test/dns-server.o \
|
|||
test/echo-server.o \
|
|||
test/test-active.o \
|
|||
test/test-async.o \
|
|||
test/test-barrier.o \
|
|||
test/test-callback-order.o \
|
|||
test/test-callback-stack.o \
|
|||
test/test-condvar.o \
|
|||
test/test-connection-fail.o \
|
|||
test/test-cwd-and-chdir.o \
|
|||
test/test-delayed-accept.o \
|
|||
test/test-dlerror.o \
|
|||
test/test-embed.o \
|
|||
test/test-error.o \
|
|||
test/test-fail-always.o \
|
|||
test/test-fs.o \
|
|||
test/test-fs-event.o \
|
|||
test/test-fs-poll.o \
|
|||
test/test-getaddrinfo.o \
|
|||
test/test-get-currentexe.o \
|
|||
test/test-get-loadavg.o \
|
|||
test/test-get-memory.o \
|
|||
test/test-getsockname.o \
|
|||
test/test-hrtime.o \
|
|||
test/test-idle.o \
|
|||
test/test-ipc.o \
|
|||
test/test-ipc-send-recv.o \
|
|||
test/test-loop-handles.o \
|
|||
test/test-loop-stop.o \
|
|||
test/test-multiple-listen.o \
|
|||
test/test-mutexes.o \
|
|||
test/test-osx-select.o \
|
|||
test/test-pass-always.o \
|
|||
test/test-ping-pong.o \
|
|||
test/test-pipe-bind-error.o \
|
|||
test/test-pipe-connect-error.o \
|
|||
test/test-platform-output.o \
|
|||
test/test-poll.o \
|
|||
test/test-poll-close.o \
|
|||
test/test-process-title.o \
|
|||
test/test-ref.o \
|
|||
test/test-run-nowait.o \
|
|||
test/test-run-once.o \
|
|||
test/test-semaphore.o \
|
|||
test/test-shutdown-close.o \
|
|||
test/test-shutdown-eof.o \
|
|||
test/test-signal.o \
|
|||
test/test-signal-multiple-loops.o \
|
|||
test/test-spawn.o \
|
|||
test/test-stdio-over-pipes.o \
|
|||
test/test-tcp-bind6-error.o \
|
|||
test/test-tcp-bind-error.o \
|
|||
test/test-tcp-close.o \
|
|||
test/test-tcp-close-while-connecting.o \
|
|||
test/test-tcp-connect6-error.o \
|
|||
test/test-tcp-connect-error-after-write.o \
|
|||
test/test-tcp-connect-error.o \
|
|||
test/test-tcp-connect-timeout.o \
|
|||
test/test-tcp-flags.o \
|
|||
test/test-tcp-open.o \
|
|||
test/test-tcp-read-stop.o \
|
|||
test/test-tcp-shutdown-after-write.o \
|
|||
test/test-tcp-unexpected-read.o \
|
|||
test/test-tcp-writealot.o \
|
|||
test/test-tcp-write-to-half-open-connection.o \
|
|||
test/test-thread.o \
|
|||
test/test-threadpool.o \
|
|||
test/test-threadpool-cancel.o \
|
|||
test/test-timer-again.o \
|
|||
test/test-timer.o \
|
|||
test/test-tty.o \
|
|||
test/test-udp-dgram-too-big.o \
|
|||
test/test-udp-ipv6.o \
|
|||
test/test-udp-multicast-join.o \
|
|||
test/test-udp-multicast-ttl.o \
|
|||
test/test-udp-open.o \
|
|||
test/test-udp-options.o \
|
|||
test/test-udp-send-and-recv.o \
|
|||
test/test-util.o \
|
|||
test/test-walk-handles.o \
|
|||
|
|||
all: libuv.a |
|||
|
|||
run-tests$(E): test/run-tests.o test/runner.o $(RUNNER_SRC) $(TESTS) libuv.a |
|||
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LDFLAGS) |
|||
|
|||
run-benchmarks$(E): test/run-benchmarks.o test/runner.o $(RUNNER_SRC) $(BENCHMARKS) libuv.a |
|||
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LDFLAGS) |
|||
|
|||
test/echo.o: test/echo.c test/echo.h |
|||
|
|||
|
|||
.PHONY: clean clean-platform distclean test bench |
|||
|
|||
|
|||
test: run-tests$(E) |
|||
$(CURDIR)/$< |
|||
|
|||
bench: run-benchmarks$(E) |
|||
$(CURDIR)/$< |
|||
|
|||
clean distclean: clean-platform |
|||
$(RM) libuv.a libuv.$(SOEXT) \
|
|||
test/run-tests.o test/run-benchmarks.o \
|
|||
test/runner.o run-tests$(E) test/run-benchmarks$(E) \
|
|||
$(BENCHMARKS) $(TESTS) $(RUNNER_LIBS) |
@ -1,48 +0,0 @@ |
|||
# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|||
#
|
|||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|||
# of this software and associated documentation files (the "Software"), to
|
|||
# deal in the Software without restriction, including without limitation the
|
|||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|||
# sell copies of the Software, and to permit persons to whom the Software is
|
|||
# furnished to do so, subject to the following conditions:
|
|||
#
|
|||
# The above copyright notice and this permission notice shall be included in
|
|||
# all copies or substantial portions of the Software.
|
|||
#
|
|||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|||
# IN THE SOFTWARE.
|
|||
|
|||
# Use make -f Makefile.gcc PREFIX=i686-w64-mingw32-
|
|||
# for cross compilation
|
|||
CC = $(PREFIX)gcc |
|||
AR = $(PREFIX)ar |
|||
E=.exe |
|||
|
|||
CFLAGS=$(CPPFLAGS) -g --std=gnu89 -D_WIN32_WINNT=0x0600 |
|||
LDFLAGS=-lm |
|||
|
|||
WIN_SRCS=$(wildcard $(SRCDIR)/src/win/*.c) |
|||
WIN_OBJS=$(WIN_SRCS:.c=.o) |
|||
|
|||
RUNNER_CFLAGS=$(CFLAGS) -D_GNU_SOURCE # Need _GNU_SOURCE for strdup? |
|||
RUNNER_LDFLAGS=$(LDFLAGS) |
|||
RUNNER_LIBS=-lws2_32 -lpsapi -liphlpapi |
|||
RUNNER_SRC=test/runner-win.c |
|||
|
|||
libuv.a: $(WIN_OBJS) src/fs-poll.o src/inet.o src/uv-common.o src/version.o |
|||
$(AR) rcs $@ $^ |
|||
|
|||
src/%.o: src/%.c include/uv.h include/uv-private/uv-win.h |
|||
$(CC) $(CFLAGS) -c $< -o $@ |
|||
|
|||
src/win/%.o: src/win/%.c include/uv.h include/uv-private/uv-win.h src/win/internal.h |
|||
$(CC) $(CFLAGS) -o $@ -c $< |
|||
|
|||
clean-platform: |
|||
-rm -f src/win/*.o |
@ -1,207 +0,0 @@ |
|||
# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|||
#
|
|||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|||
# of this software and associated documentation files (the "Software"), to
|
|||
# deal in the Software without restriction, including without limitation the
|
|||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|||
# sell copies of the Software, and to permit persons to whom the Software is
|
|||
# furnished to do so, subject to the following conditions:
|
|||
#
|
|||
# The above copyright notice and this permission notice shall be included in
|
|||
# all copies or substantial portions of the Software.
|
|||
#
|
|||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|||
# IN THE SOFTWARE.
|
|||
|
|||
E= |
|||
CFLAGS += -g -Wall -Wextra -Wno-unused-parameter |
|||
CPPFLAGS += -I$(SRCDIR)/src |
|||
LDFLAGS=-lm |
|||
|
|||
CPPFLAGS += -D_LARGEFILE_SOURCE |
|||
CPPFLAGS += -D_FILE_OFFSET_BITS=64 |
|||
|
|||
RUNNER_SRC=test/runner-unix.c |
|||
RUNNER_CFLAGS=$(CFLAGS) -I$(SRCDIR)/test |
|||
RUNNER_LDFLAGS=-L"$(CURDIR)" -luv |
|||
|
|||
DTRACE_OBJS= |
|||
DTRACE_HEADER= |
|||
|
|||
OBJS += src/unix/async.o |
|||
OBJS += src/unix/core.o |
|||
OBJS += src/unix/dl.o |
|||
OBJS += src/unix/error.o |
|||
OBJS += src/unix/fs.o |
|||
OBJS += src/unix/getaddrinfo.o |
|||
OBJS += src/unix/loop.o |
|||
OBJS += src/unix/loop-watcher.o |
|||
OBJS += src/unix/pipe.o |
|||
OBJS += src/unix/poll.o |
|||
OBJS += src/unix/process.o |
|||
OBJS += src/unix/signal.o |
|||
OBJS += src/unix/stream.o |
|||
OBJS += src/unix/tcp.o |
|||
OBJS += src/unix/thread.o |
|||
OBJS += src/unix/threadpool.o |
|||
OBJS += src/unix/timer.o |
|||
OBJS += src/unix/tty.o |
|||
OBJS += src/unix/udp.o |
|||
OBJS += src/fs-poll.o |
|||
OBJS += src/uv-common.o |
|||
OBJS += src/inet.o |
|||
OBJS += src/version.o |
|||
|
|||
ifeq (sunos,$(PLATFORM)) |
|||
HAVE_DTRACE ?= 1 |
|||
CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500 |
|||
LDFLAGS+=-lkstat -lnsl -lsendfile -lsocket |
|||
# Library dependencies are not transitive.
|
|||
OBJS += src/unix/sunos.o |
|||
ifeq (1, $(HAVE_DTRACE)) |
|||
OBJS += src/unix/dtrace.o |
|||
DTRACE_OBJS += src/unix/core.o |
|||
endif |
|||
endif |
|||
|
|||
ifeq (aix,$(PLATFORM)) |
|||
CPPFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500 |
|||
LDFLAGS+= -lperfstat |
|||
OBJS += src/unix/aix.o |
|||
endif |
|||
|
|||
ifeq (darwin,$(PLATFORM)) |
|||
HAVE_DTRACE ?= 1 |
|||
# dtrace(1) probes contain dollar signs on OS X. Mute the warnings they
|
|||
# generate but only when CC=clang, -Wno-dollar-in-identifier-extension
|
|||
# is a clang extension.
|
|||
ifeq (__clang__,$(shell sh -c "$(CC) -dM -E - </dev/null | grep -ow __clang__")) |
|||
CFLAGS += -Wno-dollar-in-identifier-extension |
|||
endif |
|||
CPPFLAGS += -D_DARWIN_USE_64_BIT_INODE=1 |
|||
LDFLAGS += -framework Foundation \
|
|||
-framework CoreServices \
|
|||
-framework ApplicationServices |
|||
SOEXT = dylib |
|||
OBJS += src/unix/darwin.o |
|||
OBJS += src/unix/kqueue.o |
|||
OBJS += src/unix/fsevents.o |
|||
OBJS += src/unix/proctitle.o |
|||
OBJS += src/unix/darwin-proctitle.o |
|||
endif |
|||
|
|||
ifeq (linux,$(PLATFORM)) |
|||
CFLAGS += -D_GNU_SOURCE |
|||
LDFLAGS+=-ldl -lrt |
|||
RUNNER_CFLAGS += -D_GNU_SOURCE |
|||
OBJS += src/unix/linux-core.o \
|
|||
src/unix/linux-inotify.o \
|
|||
src/unix/linux-syscalls.o \
|
|||
src/unix/proctitle.o |
|||
endif |
|||
|
|||
ifeq (android,$(PLATFORM)) |
|||
CFLAGS += -D_GNU_SOURCE |
|||
LDFLAGS+=-ldl -lrt |
|||
RUNNER_CFLAGS += -D_GNU_SOURCE |
|||
OBJS += src/unix/linux-core.o \
|
|||
src/unix/linux-inotify.o \
|
|||
src/unix/linux-syscalls.o \
|
|||
src/unix/proctitle.o |
|||
else |
|||
CFLAGS += -std=c89 |
|||
endif |
|||
|
|||
ifeq (freebsd,$(PLATFORM)) |
|||
ifeq ($(shell dtrace -l 1>&2 2>/dev/null; echo $$?),0) |
|||
HAVE_DTRACE ?= 1 |
|||
endif |
|||
LDFLAGS+=-lkvm |
|||
OBJS += src/unix/freebsd.o |
|||
OBJS += src/unix/kqueue.o |
|||
endif |
|||
|
|||
ifeq (dragonfly,$(PLATFORM)) |
|||
LDFLAGS+=-lkvm |
|||
OBJS += src/unix/freebsd.o |
|||
OBJS += src/unix/kqueue.o |
|||
endif |
|||
|
|||
ifeq (netbsd,$(PLATFORM)) |
|||
LDFLAGS+=-lkvm |
|||
OBJS += src/unix/netbsd.o |
|||
OBJS += src/unix/kqueue.o |
|||
endif |
|||
|
|||
ifeq (openbsd,$(PLATFORM)) |
|||
LDFLAGS+=-lkvm |
|||
OBJS += src/unix/openbsd.o |
|||
OBJS += src/unix/kqueue.o |
|||
endif |
|||
|
|||
ifeq (sunos,$(PLATFORM)) |
|||
RUNNER_LDFLAGS += -pthreads |
|||
else |
|||
ifneq (android, $(PLATFORM)) |
|||
RUNNER_LDFLAGS += -pthread |
|||
endif |
|||
endif |
|||
|
|||
ifeq ($(HAVE_DTRACE), 1) |
|||
DTRACE_HEADER = src/unix/uv-dtrace.h |
|||
CPPFLAGS += -Isrc/unix |
|||
CFLAGS += -DHAVE_DTRACE |
|||
endif |
|||
|
|||
ifneq (darwin,$(PLATFORM)) |
|||
# Must correspond with UV_VERSION_MAJOR and UV_VERSION_MINOR in src/version.c
|
|||
SO_LDFLAGS = -Wl,-soname,libuv.so.0.11 |
|||
endif |
|||
|
|||
RUNNER_LDFLAGS += $(LDFLAGS) |
|||
|
|||
libuv.a: $(OBJS) |
|||
$(AR) rcs $@ $^ |
|||
|
|||
libuv.$(SOEXT): override CFLAGS += -fPIC |
|||
libuv.$(SOEXT): $(OBJS:%.o=%.pic.o) |
|||
$(CC) -shared -o $@ $^ $(LDFLAGS) $(SO_LDFLAGS) |
|||
|
|||
include/uv-private/uv-unix.h: \ |
|||
include/uv-private/uv-bsd.h \
|
|||
include/uv-private/uv-darwin.h \
|
|||
include/uv-private/uv-linux.h \
|
|||
include/uv-private/uv-sunos.h |
|||
|
|||
src/unix/internal.h: src/unix/linux-syscalls.h src/uv-common.h |
|||
src/uv-common.h: src/queue.h |
|||
|
|||
src/.buildstamp src/unix/.buildstamp test/.buildstamp: |
|||
mkdir -p $(@D) |
|||
touch $@ |
|||
|
|||
src/unix/%.o src/unix/%.pic.o: src/unix/%.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h src/unix/.buildstamp $(DTRACE_HEADER) |
|||
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ |
|||
|
|||
src/%.o src/%.pic.o: src/%.c include/uv.h include/uv-private/uv-unix.h src/.buildstamp |
|||
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ |
|||
|
|||
test/%.o: test/%.c include/uv.h test/.buildstamp |
|||
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ |
|||
|
|||
clean-platform: |
|||
$(RM) test/run-{tests,benchmarks}.dSYM $(OBJS) $(OBJS:%.o=%.pic.o) src/unix/uv-dtrace.h |
|||
|
|||
src/unix/uv-dtrace.h: src/unix/uv-dtrace.d |
|||
dtrace -h -xnolibs -s $< -o $@ |
|||
|
|||
src/unix/dtrace.o: src/unix/uv-dtrace.d $(DTRACE_OBJS) |
|||
dtrace -G -s $^ -o $@ |
|||
|
|||
src/unix/dtrace.pic.o: src/unix/uv-dtrace.d $(DTRACE_OBJS:%.o=%.pic.o) |
|||
dtrace -G -s $^ -o $@ |
@ -0,0 +1,47 @@ |
|||
# Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl> |
|||
# |
|||
# Permission to use, copy, modify, and/or distribute this software for any |
|||
# purpose with or without fee is hereby granted, provided that the above |
|||
# copyright notice and this permission notice appear in all copies. |
|||
# |
|||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|||
|
|||
AC_PREREQ(2.57) |
|||
AC_INIT([libuv], [0.11.5], [https://github.com/joyent/libuv/issues]) |
|||
AM_INIT_AUTOMAKE([foreign -Wall -Werror]) |
|||
AC_CONFIG_MACRO_DIR([m4]) |
|||
AC_CANONICAL_HOST |
|||
AC_ENABLE_SHARED |
|||
AC_ENABLE_STATIC |
|||
AC_PROG_CC |
|||
# AM_PROG_AR is not available in automake v0.11 but it's essential in v0.12. |
|||
m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) |
|||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
|||
LT_INIT |
|||
# TODO(bnoordhuis) Check for -pthread vs. -pthreads |
|||
AC_CHECK_LIB([dl], [dlopen]) |
|||
AC_CHECK_LIB([kstat], [kstat_lookup]) |
|||
AC_CHECK_LIB([kvm], [kvm_open]) |
|||
AC_CHECK_LIB([nsl], [gethostbyname]) |
|||
AC_CHECK_LIB([perfstat], [perfstat_cpu]) |
|||
AC_CHECK_LIB([pthread], [pthread_mutex_init]) |
|||
AC_CHECK_LIB([rt], [clock_gettime]) |
|||
AC_CHECK_LIB([sendfile], [sendfile]) |
|||
AC_CHECK_LIB([socket], [socket]) |
|||
AC_SYS_LARGEFILE |
|||
AM_CONDITIONAL([AIX], [AS_CASE([$host_os], [aix*], [true], [false])]) |
|||
AM_CONDITIONAL([DARWIN], [AS_CASE([$host_os], [darwin*], [true], [false])]) |
|||
AM_CONDITIONAL([FREEBSD], [AS_CASE([$host_os], [freebsd*], [true], [false])]) |
|||
AM_CONDITIONAL([LINUX], [AS_CASE([$host_os], [linux*], [true], [false])]) |
|||
AM_CONDITIONAL([NETBSD], [AS_CASE([$host_os], [netbsd*], [true], [false])]) |
|||
AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os], [openbsd*], [true], [false])]) |
|||
AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os], [solaris*], [true], [false])]) |
|||
PANDORA_ENABLE_DTRACE |
|||
AC_CONFIG_FILES([Makefile]) |
|||
AC_OUTPUT |
@ -0,0 +1,365 @@ |
|||
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|||
* |
|||
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|||
* of this software and associated documentation files (the "Software"), to |
|||
* deal in the Software without restriction, including without limitation the |
|||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
|||
* sell copies of the Software, and to permit persons to whom the Software is |
|||
* furnished to do so, subject to the following conditions: |
|||
* |
|||
* The above copyright notice and this permission notice shall be included in |
|||
* all copies or substantial portions of the Software. |
|||
* |
|||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
|||
* IN THE SOFTWARE. |
|||
*/ |
|||
|
|||
#ifndef UV_ERRNO_H_ |
|||
#define UV_ERRNO_H_ |
|||
|
|||
#include <errno.h> |
|||
|
|||
#define UV__EOF (-4095) |
|||
#define UV__UNKNOWN (-4094) |
|||
|
|||
#define UV__EAI_ADDRFAMILY (-3000) |
|||
#define UV__EAI_AGAIN (-3001) |
|||
#define UV__EAI_BADFLAGS (-3002) |
|||
#define UV__EAI_CANCELED (-3003) |
|||
#define UV__EAI_FAIL (-3004) |
|||
#define UV__EAI_FAMILY (-3005) |
|||
#define UV__EAI_MEMORY (-3006) |
|||
#define UV__EAI_NODATA (-3007) |
|||
#define UV__EAI_NONAME (-3008) |
|||
#define UV__EAI_OVERFLOW (-3009) |
|||
#define UV__EAI_SERVICE (-3010) |
|||
#define UV__EAI_SOCKTYPE (-3011) |
|||
#define UV__EAI_SYSTEM (-3012) /* TODO(bnoordhuis) Return system error. */ |
|||
|
|||
/* Only map to the system errno on non-Windows platforms. It's apparently
|
|||
* a fairly common practice for Windows programmers to redefine errno codes. |
|||
*/ |
|||
#if defined(EACCES) && !defined(_WIN32) |
|||
# define UV__EACCES (-EACCES) |
|||
#else |
|||
# define UV__EACCES (-4093) |
|||
#endif |
|||
|
|||
#if defined(EADDRINFO) && !defined(_WIN32) |
|||
# define UV__EADDRINFO EADDRINFO |
|||
#else |
|||
# define UV__EADDRINFO (-4092) |
|||
#endif |
|||
|
|||
#if defined(EADDRINUSE) && !defined(_WIN32) |
|||
# define UV__EADDRINUSE (-EADDRINUSE) |
|||
#else |
|||
# define UV__EADDRINUSE (-4092) |
|||
#endif |
|||
|
|||
#if defined(EADDRNOTAVAIL) && !defined(_WIN32) |
|||
# define UV__EADDRNOTAVAIL (-EADDRNOTAVAIL) |
|||
#else |
|||
# define UV__EADDRNOTAVAIL (-4091) |
|||
#endif |
|||
|
|||
#if defined(EAFNOSUPPORT) && !defined(_WIN32) |
|||
# define UV__EAFNOSUPPORT (-EAFNOSUPPORT) |
|||
#else |
|||
# define UV__EAFNOSUPPORT (-4090) |
|||
#endif |
|||
|
|||
#if defined(EAGAIN) && !defined(_WIN32) |
|||
# define UV__EAGAIN (-EAGAIN) |
|||
#else |
|||
# define UV__EAGAIN (-4089) |
|||
#endif |
|||
|
|||
#if defined(EALREADY) && !defined(_WIN32) |
|||
# define UV__EALREADY (-EALREADY) |
|||
#else |
|||
# define UV__EALREADY (-4085) |
|||
#endif |
|||
|
|||
#if defined(EBADF) && !defined(_WIN32) |
|||
# define UV__EBADF (-EBADF) |
|||
#else |
|||
# define UV__EBADF (-4084) |
|||
#endif |
|||
|
|||
#if defined(EBUSY) && !defined(_WIN32) |
|||
# define UV__EBUSY (-EBUSY) |
|||
#else |
|||
# define UV__EBUSY (-4083) |
|||
#endif |
|||
|
|||
#if defined(ECANCELED) && !defined(_WIN32) |
|||
# define UV__ECANCELED (-ECANCELED) |
|||
#else |
|||
# define UV__ECANCELED (-4082) |
|||
#endif |
|||
|
|||
#if defined(ECHARSET) && !defined(_WIN32) |
|||
# define UV__ECHARSET (-ECHARSET) |
|||
#else |
|||
# define UV__ECHARSET (-4081) |
|||
#endif |
|||
|
|||
#if defined(ECONNABORTED) && !defined(_WIN32) |
|||
# define UV__ECONNABORTED (-ECONNABORTED) |
|||
#else |
|||
# define UV__ECONNABORTED (-4080) |
|||
#endif |
|||
|
|||
#if defined(ECONNREFUSED) && !defined(_WIN32) |
|||
# define UV__ECONNREFUSED (-ECONNREFUSED) |
|||
#else |
|||
# define UV__ECONNREFUSED (-4079) |
|||
#endif |
|||
|
|||
#if defined(ECONNRESET) && !defined(_WIN32) |
|||
# define UV__ECONNRESET (-ECONNRESET) |
|||
#else |
|||
# define UV__ECONNRESET (-4078) |
|||
#endif |
|||
|
|||
#if defined(EDESTADDRREQ) && !defined(_WIN32) |
|||
# define UV__EDESTADDRREQ (-EDESTADDRREQ) |
|||
#else |
|||
# define UV__EDESTADDRREQ (-4077) |
|||
#endif |
|||
|
|||
#if defined(EEXIST) && !defined(_WIN32) |
|||
# define UV__EEXIST (-EEXIST) |
|||
#else |
|||
# define UV__EEXIST (-4076) |
|||
#endif |
|||
|
|||
#if defined(EFAULT) && !defined(_WIN32) |
|||
# define UV__EFAULT (-EFAULT) |
|||
#else |
|||
# define UV__EFAULT (-4075) |
|||
#endif |
|||
|
|||
#if defined(EHOSTUNREACH) && !defined(_WIN32) |
|||
# define UV__EHOSTUNREACH (-EHOSTUNREACH) |
|||
#else |
|||
# define UV__EHOSTUNREACH (-4074) |
|||
#endif |
|||
|
|||
#if defined(EINTR) && !defined(_WIN32) |
|||
# define UV__EINTR (-EINTR) |
|||
#else |
|||
# define UV__EINTR (-4073) |
|||
#endif |
|||
|
|||
#if defined(EINVAL) && !defined(_WIN32) |
|||
# define UV__EINVAL (-EINVAL) |
|||
#else |
|||
# define UV__EINVAL (-4072) |
|||
#endif |
|||
|
|||
#if defined(EIO) && !defined(_WIN32) |
|||
# define UV__EIO (-EIO) |
|||
#else |
|||
# define UV__EIO (-4071) |
|||
#endif |
|||
|
|||
#if defined(EISCONN) && !defined(_WIN32) |
|||
# define UV__EISCONN (-EISCONN) |
|||
#else |
|||
# define UV__EISCONN (-4070) |
|||
#endif |
|||
|
|||
#if defined(EISDIR) && !defined(_WIN32) |
|||
# define UV__EISDIR (-EISDIR) |
|||
#else |
|||
# define UV__EISDIR (-4069) |
|||
#endif |
|||
|
|||
#if defined(ELOOP) && !defined(_WIN32) |
|||
# define UV__ELOOP (-ELOOP) |
|||
#else |
|||
# define UV__ELOOP (-4068) |
|||
#endif |
|||
|
|||
#if defined(EMFILE) && !defined(_WIN32) |
|||
# define UV__EMFILE (-EMFILE) |
|||
#else |
|||
# define UV__EMFILE (-4067) |
|||
#endif |
|||
|
|||
#if defined(EMSGSIZE) && !defined(_WIN32) |
|||
# define UV__EMSGSIZE (-EMSGSIZE) |
|||
#else |
|||
# define UV__EMSGSIZE (-4066) |
|||
#endif |
|||
|
|||
#if defined(ENAMETOOLONG) && !defined(_WIN32) |
|||
# define UV__ENAMETOOLONG (-ENAMETOOLONG) |
|||
#else |
|||
# define UV__ENAMETOOLONG (-4065) |
|||
#endif |
|||
|
|||
#if defined(ENETDOWN) && !defined(_WIN32) |
|||
# define UV__ENETDOWN (-ENETDOWN) |
|||
#else |
|||
# define UV__ENETDOWN (-4064) |
|||
#endif |
|||
|
|||
#if defined(ENETUNREACH) && !defined(_WIN32) |
|||
# define UV__ENETUNREACH (-ENETUNREACH) |
|||
#else |
|||
# define UV__ENETUNREACH (-4063) |
|||
#endif |
|||
|
|||
#if defined(ENFILE) && !defined(_WIN32) |
|||
# define UV__ENFILE (-ENFILE) |
|||
#else |
|||
# define UV__ENFILE (-4062) |
|||
#endif |
|||
|
|||
#if defined(ENOBUFS) && !defined(_WIN32) |
|||
# define UV__ENOBUFS (-ENOBUFS) |
|||
#else |
|||
# define UV__ENOBUFS (-4061) |
|||
#endif |
|||
|
|||
#if defined(ENODEV) && !defined(_WIN32) |
|||
# define UV__ENODEV (-ENODEV) |
|||
#else |
|||
# define UV__ENODEV (-4060) |
|||
#endif |
|||
|
|||
#if defined(ENOENT) && !defined(_WIN32) |
|||
# define UV__ENOENT (-ENOENT) |
|||
#else |
|||
# define UV__ENOENT (-4059) |
|||
#endif |
|||
|
|||
#if defined(ENOMEM) && !defined(_WIN32) |
|||
# define UV__ENOMEM (-ENOMEM) |
|||
#else |
|||
# define UV__ENOMEM (-4058) |
|||
#endif |
|||
|
|||
#if defined(ENONET) && !defined(_WIN32) |
|||
# define UV__ENONET (-ENONET) |
|||
#else |
|||
# define UV__ENONET (-4057) |
|||
#endif |
|||
|
|||
#if defined(ENOSPC) && !defined(_WIN32) |
|||
# define UV__ENOSPC (-ENOSPC) |
|||
#else |
|||
# define UV__ENOSPC (-4056) |
|||
#endif |
|||
|
|||
#if defined(ENOSYS) && !defined(_WIN32) |
|||
# define UV__ENOSYS (-ENOSYS) |
|||
#else |
|||
# define UV__ENOSYS (-4055) |
|||
#endif |
|||
|
|||
#if defined(ENOTCONN) && !defined(_WIN32) |
|||
# define UV__ENOTCONN (-ENOTCONN) |
|||
#else |
|||
# define UV__ENOTCONN (-4054) |
|||
#endif |
|||
|
|||
#if defined(ENOTDIR) && !defined(_WIN32) |
|||
# define UV__ENOTDIR (-ENOTDIR) |
|||
#else |
|||
# define UV__ENOTDIR (-4053) |
|||
#endif |
|||
|
|||
#if defined(ENOTEMPTY) && !defined(_WIN32) |
|||
# define UV__ENOTEMPTY (-ENOTEMPTY) |
|||
#else |
|||
# define UV__ENOTEMPTY (-4052) |
|||
#endif |
|||
|
|||
#if defined(ENOTSOCK) && !defined(_WIN32) |
|||
# define UV__ENOTSOCK (-ENOTSOCK) |
|||
#else |
|||
# define UV__ENOTSOCK (-4051) |
|||
#endif |
|||
|
|||
#if defined(ENOTSUP) && !defined(_WIN32) |
|||
# define UV__ENOTSUP (-ENOTSUP) |
|||
#else |
|||
# define UV__ENOTSUP (-4050) |
|||
#endif |
|||
|
|||
#if defined(EPERM) && !defined(_WIN32) |
|||
# define UV__EPERM (-EPERM) |
|||
#else |
|||
# define UV__EPERM (-4049) |
|||
#endif |
|||
|
|||
#if defined(EPIPE) && !defined(_WIN32) |
|||
# define UV__EPIPE (-EPIPE) |
|||
#else |
|||
# define UV__EPIPE (-4048) |
|||
#endif |
|||
|
|||
#if defined(EPROTO) && !defined(_WIN32) |
|||
# define UV__EPROTO (-EPROTO) |
|||
#else |
|||
# define UV__EPROTO (-4047) |
|||
#endif |
|||
|
|||
#if defined(EPROTONOSUPPORT) && !defined(_WIN32) |
|||
# define UV__EPROTONOSUPPORT (-EPROTONOSUPPORT) |
|||
#else |
|||
# define UV__EPROTONOSUPPORT (-4046) |
|||
#endif |
|||
|
|||
#if defined(EPROTOTYPE) && !defined(_WIN32) |
|||
# define UV__EPROTOTYPE (-EPROTOTYPE) |
|||
#else |
|||
# define UV__EPROTOTYPE (-4045) |
|||
#endif |
|||
|
|||
#if defined(EROFS) && !defined(_WIN32) |
|||
# define UV__EROFS (-EROFS) |
|||
#else |
|||
# define UV__EROFS (-4044) |
|||
#endif |
|||
|
|||
#if defined(ESHUTDOWN) && !defined(_WIN32) |
|||
# define UV__ESHUTDOWN (-ESHUTDOWN) |
|||
#else |
|||
# define UV__ESHUTDOWN (-4043) |
|||
#endif |
|||
|
|||
#if defined(ESPIPE) && !defined(_WIN32) |
|||
# define UV__ESPIPE (-ESPIPE) |
|||
#else |
|||
# define UV__ESPIPE (-4042) |
|||
#endif |
|||
|
|||
#if defined(ESRCH) && !defined(_WIN32) |
|||
# define UV__ESRCH (-ESRCH) |
|||
#else |
|||
# define UV__ESRCH (-4041) |
|||
#endif |
|||
|
|||
#if defined(ETIMEDOUT) && !defined(_WIN32) |
|||
# define UV__ETIMEDOUT (-ETIMEDOUT) |
|||
#else |
|||
# define UV__ETIMEDOUT (-4040) |
|||
#endif |
|||
|
|||
#if defined(EXDEV) && !defined(_WIN32) |
|||
# define UV__EXDEV (-EXDEV) |
|||
#else |
|||
# define UV__EXDEV (-4038) |
|||
#endif |
|||
|
|||
#endif /* UV_ERRNO_H_ */ |
@ -1,88 +0,0 @@ |
|||
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|||
* |
|||
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|||
* of this software and associated documentation files (the "Software"), to |
|||
* deal in the Software without restriction, including without limitation the |
|||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
|||
* sell copies of the Software, and to permit persons to whom the Software is |
|||
* furnished to do so, subject to the following conditions: |
|||
* |
|||
* The above copyright notice and this permission notice shall be included in |
|||
* all copies or substantial portions of the Software. |
|||
* |
|||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
|||
* IN THE SOFTWARE. |
|||
*/ |
|||
|
|||
/*
|
|||
* TODO Share this code with Windows. |
|||
* See https://github.com/joyent/libuv/issues/76
|
|||
*/ |
|||
|
|||
#include "uv.h" |
|||
#include "internal.h" |
|||
|
|||
#include <errno.h> |
|||
#include <stdio.h> |
|||
#include <stdlib.h> |
|||
#include <string.h> |
|||
#include <assert.h> |
|||
|
|||
|
|||
uv_err_code uv_translate_sys_error(int sys_errno) { |
|||
switch (sys_errno) { |
|||
case 0: return UV_OK; |
|||
case EIO: return UV_EIO; |
|||
case EPERM: return UV_EPERM; |
|||
case ENOSYS: return UV_ENOSYS; |
|||
case ENOTSOCK: return UV_ENOTSOCK; |
|||
case ENOENT: return UV_ENOENT; |
|||
case EACCES: return UV_EACCES; |
|||
case EAFNOSUPPORT: return UV_EAFNOSUPPORT; |
|||
case EBADF: return UV_EBADF; |
|||
case EPIPE: return UV_EPIPE; |
|||
case ESPIPE: return UV_ESPIPE; |
|||
case EAGAIN: return UV_EAGAIN; |
|||
#if EWOULDBLOCK != EAGAIN |
|||
case EWOULDBLOCK: return UV_EAGAIN; |
|||
#endif |
|||
case ECONNRESET: return UV_ECONNRESET; |
|||
case EFAULT: return UV_EFAULT; |
|||
case EMFILE: return UV_EMFILE; |
|||
case EMSGSIZE: return UV_EMSGSIZE; |
|||
case ENAMETOOLONG: return UV_ENAMETOOLONG; |
|||
case EINVAL: return UV_EINVAL; |
|||
case ENETDOWN: return UV_ENETDOWN; |
|||
case ENETUNREACH: return UV_ENETUNREACH; |
|||
case ECONNABORTED: return UV_ECONNABORTED; |
|||
case ELOOP: return UV_ELOOP; |
|||
case ECONNREFUSED: return UV_ECONNREFUSED; |
|||
case EADDRINUSE: return UV_EADDRINUSE; |
|||
case EADDRNOTAVAIL: return UV_EADDRNOTAVAIL; |
|||
case ENOTDIR: return UV_ENOTDIR; |
|||
case EISDIR: return UV_EISDIR; |
|||
case ENODEV: return UV_ENODEV; |
|||
case ENOTCONN: return UV_ENOTCONN; |
|||
case EEXIST: return UV_EEXIST; |
|||
case EHOSTUNREACH: return UV_EHOSTUNREACH; |
|||
case EAI_NONAME: return UV_ENOENT; |
|||
case ESRCH: return UV_ESRCH; |
|||
case ETIMEDOUT: return UV_ETIMEDOUT; |
|||
case EXDEV: return UV_EXDEV; |
|||
case EBUSY: return UV_EBUSY; |
|||
#if ENOTEMPTY != EEXIST |
|||
case ENOTEMPTY: return UV_ENOTEMPTY; |
|||
#endif |
|||
case ENOSPC: return UV_ENOSPC; |
|||
case EROFS: return UV_EROFS; |
|||
case ENOMEM: return UV_ENOMEM; |
|||
case EDQUOT: return UV_ENOSPC; |
|||
default: return UV_UNKNOWN; |
|||
} |
|||
UNREACHABLE(); |
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue