/*
* libev event processing core, watcher management
*
* Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
* CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
* CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH-
* ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU General Public License ("GPL") version 2 or any later version,
* in which case the provisions of the GPL are applicable instead of
* the above. If you wish to allow the use of your version of this file
* only under the terms of the GPL and not to allow others to use your
* version of this file under the BSD license, indicate your decision
* by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL. If you do not delete the
* provisions above, a recipient may use your version of this file under
* either the BSD or the GPL.
*/
#ifdef __cplusplus
extern "C" {
#endif
/* this big block deduces configuration from config.h */
#ifndef EV_STANDALONE
# ifdef EV_CONFIG_H
# include EV_CONFIG_H
# else
# include "config.h"
# endif
# if HAVE_CLOCK_SYSCALL
# ifndef EV_USE_CLOCK_SYSCALL
# define EV_USE_CLOCK_SYSCALL 1
# ifndef EV_USE_REALTIME
# define EV_USE_REALTIME 0
# endif
# ifndef EV_USE_MONOTONIC
# define EV_USE_MONOTONIC 1
# endif
# endif
# elif !defined(EV_USE_CLOCK_SYSCALL)
# define EV_USE_CLOCK_SYSCALL 0
# endif
# if HAVE_CLOCK_GETTIME
# ifndef EV_USE_MONOTONIC
# define EV_USE_MONOTONIC 1
# endif
# ifndef EV_USE_REALTIME
# define EV_USE_REALTIME 0
# endif
# else
# ifndef EV_USE_MONOTONIC
# define EV_USE_MONOTONIC 0
# endif
# ifndef EV_USE_REALTIME
# define EV_USE_REALTIME 0
# endif
# endif
# ifndef EV_USE_NANOSLEEP
# if HAVE_NANOSLEEP
# define EV_USE_NANOSLEEP 1
# else
# define EV_USE_NANOSLEEP 0
# endif
# endif
# ifndef EV_USE_SELECT
# if HAVE_SELECT && HAVE_SYS_SELECT_H
# define EV_USE_SELECT 1
# else
# define EV_USE_SELECT 0
# endif
# endif
# ifndef EV_USE_POLL
# if HAVE_POLL && HAVE_POLL_H
# define EV_USE_POLL 1
# else
# define EV_USE_POLL 0
# endif
# endif
# ifndef EV_USE_EPOLL
# if HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H
# define EV_USE_EPOLL 1
# else
# define EV_USE_EPOLL 0
# endif
# endif
# ifndef EV_USE_KQUEUE
# if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H
# define EV_USE_KQUEUE 1
# else
# define EV_USE_KQUEUE 0
# endif
# endif
# ifndef EV_USE_PORT
# if HAVE_PORT_H && HAVE_PORT_CREATE
# define EV_USE_PORT 1
# else
# define EV_USE_PORT 0
# endif
# endif
# ifndef EV_USE_INOTIFY
# if HAVE_INOTIFY_INIT && HAVE_SYS_INOTIFY_H
# define EV_USE_INOTIFY 1
# else
# define EV_USE_INOTIFY 0
# endif
# endif
# ifndef EV_USE_SIGNALFD
# if HAVE_SIGNALFD && HAVE_SYS_SIGNALFD_H
# define EV_USE_SIGNALFD 1
# else
# define EV_USE_SIGNALFD 0
# endif
# endif
# ifndef EV_USE_EVENTFD
# if HAVE_EVENTFD
# define EV_USE_EVENTFD 1
# else
# define EV_USE_EVENTFD 0
# endif
# endif
#endif
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
#include <time.h>
#include <signal.h>
#ifdef EV_H
# include EV_H
#else
# include "ev.h"
#endif
#ifndef _WIN32
# include <sys/time.h>
# include <sys/wait.h>
# include <unistd.h>
#else
# include <io.h>
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# ifndef EV_SELECT_IS_WINSOCKET
# define EV_SELECT_IS_WINSOCKET 1
# endif
#endif
/* this block tries to deduce configuration from header-defined symbols and defaults */
/* try to deduce the maximum number of signals on this platform */
#if defined (EV_NSIG)
/* use what's provided */
#elif defined (NSIG)
# define EV_NSIG (NSIG)
#elif defined(_NSIG)
# define EV_NSIG (_NSIG)
#elif defined (SIGMAX)
# define EV_NSIG (SIGMAX+1)
#elif defined (SIG_MAX)
# define EV_NSIG (SIG_MAX+1)
#elif defined (_SIG_MAX)
# define EV_NSIG (_SIG_MAX+1)
#elif defined (MAXSIG)
# define EV_NSIG (MAXSIG+1)
#elif defined (MAX_SIG)
# define EV_NSIG (MAX_SIG+1)
#elif defined (SIGARRAYSIZE)
# define EV_NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
#elif defined (_sys_nsig)
# define EV_NSIG (_sys_nsig) /* Solaris 2.5 */
#else
# error "unable to find value for NSIG, please report"
/* to make it compile regardless, just remove the above line */
# define EV_NSIG 65
#endif
#ifndef EV_USE_CLOCK_SYSCALL
# if __linux && __GLIBC__ >= 2
# define EV_USE_CLOCK_SYSCALL 1
# else
# define EV_USE_CLOCK_SYSCALL 0
# endif
#endif
#ifndef EV_USE_MONOTONIC
# if defined (_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
# define EV_USE_MONOTONIC 1
# else
# define EV_USE_MONOTONIC 0
# endif
#endif
#ifndef EV_USE_REALTIME
# define EV_USE_REALTIME !EV_USE_CLOCK_SYSCALL
#endif
#ifndef EV_USE_NANOSLEEP
# if _POSIX_C_SOURCE >= 199309L
# define EV_USE_NANOSLEEP 1
# else
# define EV_USE_NANOSLEEP 0
# endif
#endif
#ifndef EV_USE_SELECT
# define EV_USE_SELECT 1
#endif
#ifndef EV_USE_POLL
# ifdef _WIN32
# define EV_USE_POLL 0
# else
# define EV_USE_POLL 1
# endif
#endif
#ifndef EV_USE_EPOLL
# if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 4))
# define EV_USE_EPOLL 1
# else
# define EV_USE_EPOLL 0
# endif
#endif
#ifndef EV_USE_KQUEUE
# define EV_USE_KQUEUE 0
#endif
#ifndef EV_USE_PORT
# define EV_USE_PORT 0
#endif
#ifndef EV_USE_INOTIFY
# if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 4))
# define EV_USE_INOTIFY 1
# else
# define EV_USE_INOTIFY 0
# endif
#endif
#ifndef EV_PID_HASHSIZE
# if EV_MINIMAL
# define EV_PID_HASHSIZE 1
# else
# define EV_PID_HASHSIZE 16
# endif
#endif
#ifndef EV_INOTIFY_HASHSIZE
# if EV_MINIMAL
# define EV_INOTIFY_HASHSIZE 1
# else
# define EV_INOTIFY_HASHSIZE 16
# endif
#endif
#ifndef EV_USE_EVENTFD
# if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
# define EV_USE_EVENTFD 1
# else
# define EV_USE_EVENTFD 0
# endif
#endif
#ifndef EV_USE_SIGNALFD
# if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
# define EV_USE_SIGNALFD 1
# else
# define EV_USE_SIGNALFD 0
# endif
#endif
#if 0 /* debugging */
# define EV_VERIFY 3
# define EV_USE_4HEAP 1
# define EV_HEAP_CACHE_AT 1
#endif
#ifndef EV_VERIFY
# define EV_VERIFY !EV_MINIMAL
#endif
#ifndef EV_USE_4HEAP
# define EV_USE_4HEAP !EV_MINIMAL
#endif
#ifndef EV_HEAP_CACHE_AT
# define EV_HEAP_CACHE_AT !EV_MINIMAL
#endif
/* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */
/* which makes programs even slower. might work on other unices, too. */
#if EV_USE_CLOCK_SYSCALL
# include <syscall.h>
# ifdef SYS_clock_gettime
# define clock_gettime(id, ts) syscall (SYS_clock_gettime, (id), (ts))
# undef EV_USE_MONOTONIC
# define EV_
没有合适的资源?快使用搜索试试~ 我知道了~
node-v0.1.93.tar.gz
0 下载量 120 浏览量
2024-05-16
22:07:33
上传
评论
收藏 6.23MB GZ 举报
温馨提示
共1714个文件
js:704个
py:279个
h:252个
Node.js,简称Node,是一个开源且跨平台的JavaScript运行时环境,它允许在浏览器外运行JavaScript代码。Node.js于2009年由Ryan Dahl创立,旨在创建高性能的Web服务器和网络应用程序。它基于Google Chrome的V8 JavaScript引擎,可以在Windows、Linux、Unix、Mac OS X等操作系统上运行。 Node.js的特点之一是事件驱动和非阻塞I/O模型,这使得它非常适合处理大量并发连接,从而在构建实时应用程序如在线游戏、聊天应用以及实时通讯服务时表现卓越。此外,Node.js使用了模块化的架构,通过npm(Node package manager,Node包管理器),社区成员可以共享和复用代码,极大地促进了Node.js生态系统的发展和扩张。 Node.js不仅用于服务器端开发。随着技术的发展,它也被用于构建工具链、开发桌面应用程序、物联网设备等。Node.js能够处理文件系统、操作数据库、处理网络请求等,因此,开发者可以用JavaScript编写全栈应用程序,这一点大大提高了开发效率和便捷性。 在实践中,许多大型企业和组织已经采用Node.js作为其Web应用程序的开发平台,如Netflix、PayPal和Walmart等。它们利用Node.js提高了应用性能,简化了开发流程,并且能更快地响应市场需求。
资源推荐
资源详情
资源评论
收起资源包目录
node-v0.1.93.tar.gz (1714个子文件)
node.1 82KB
ev.3 212KB
eio.3 154KB
configure.ac 331B
configure.ac 292B
Makefile.am 402B
Makefile.am 273B
annotate 149B
are 0B
AUTHORS 2KB
AUTHORS 974B
AUTHORS 600B
get_ver.awk 1KB
windows-tick-processor.bat 1KB
ev.c 81KB
dtoa.c 68KB
eio.c 49KB
ares_init.c 43KB
test.c 40KB
http_parser.c 39KB
ares_process.c 39KB
ares_gethostbyname.c 15KB
ares_getnameinfo.c 12KB
inet_net_pton.c 11KB
ares_search.c 9KB
event.c 9KB
ev_select.c 9KB
ares_gethostbyaddr.c 8KB
ev_epoll.c 8KB
ares_parse_aaaa_reply.c 7KB
ares_parse_a_reply.c 7KB
ares__get_hostent.c 7KB
ares_mkquery.c 6KB
ares_parse_ptr_reply.c 6KB
ev_kqueue.c 6KB
inet_ntop.c 6KB
ares_expand_name.c 6KB
ares_parse_txt_reply.c 5KB
ev_win32.c 5KB
ev_port.c 5KB
ares_query.c 5KB
ares_parse_ns_reply.c 5KB
demo.c 5KB
ares_data.c 5KB
ares_parse_srv_reply.c 5KB
ares_getopt.c 4KB
ares_parse_mx_reply.c 4KB
ev_poll.c 4KB
ares_send.c 4KB
dtoa-config.c 4KB
ares_options.c 3KB
ares__timeval.c 3KB
ares_library_init.c 3KB
ares_destroy.c 3KB
ares_llist.c 2KB
ares_timeout.c 2KB
ares_getsock.c 2KB
ares__read_line.c 2KB
ares_cancel.c 2KB
ares__close_sockets.c 2KB
ares_fds.c 2KB
ares_expand_string.c 2KB
ares_strerror.c 2KB
ares_writev.c 2KB
ares_strcasecmp.c 2KB
bitncmp.c 2KB
ares_nowarn.c 1KB
ares_free_hostent.c 1KB
ares_strdup.c 1KB
ares_free_string.c 856B
windows_port.c 414B
ares_version.c 169B
README.cares 535B
gay-shortest.cc 6.03MB
codegen-ia32.cc 446KB
codegen-x64.cc 369KB
runtime.cc 340KB
codegen-arm.cc 329KB
test-api.cc 328KB
objects.cc 280KB
test-debug.cc 202KB
jsregexp.cc 181KB
parser.cc 163KB
unicode.cc 150KB
heap.cc 139KB
api.cc 129KB
spaces.cc 96KB
debug.cc 88KB
stub-cache-ia32.cc 86KB
macro-assembler-x64.cc 85KB
simulator-arm.cc 79KB
mark-compact.cc 78KB
stub-cache-x64.cc 70KB
bootstrapper.cc 67KB
stub-cache-arm.cc 66KB
assembler-arm.cc 64KB
node_crypto.cc 63KB
full-codegen-ia32.cc 63KB
full-codegen-x64.cc 62KB
full-codegen-arm.cc 59KB
共 1714 条
- 1
- 2
- 3
- 4
- 5
- 6
- 18
资源评论
程序员Chino的日记
- 粉丝: 2936
- 资源: 4万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 计算机二级 开发案列优质学习资料资源工具与案列应用场景开发文档教程资料.txt
- Python 编程示例开发案列优质学习资料资源工具与案列应用场景开发文档教程资料.txt
- Java学生管理系统数列开发案列优质学习资料资源工具与案列应用场景开发文档教程资料.txt
- dysbb_121970.apk
- 斐波那契数列开发案列优质学习资料资源工具与案列应用场景开发文档教程资料.txt
- C语言系统化精讲 重塑编程思想 打造坚实的开发基础 – 带源码课件
- 端午节龙舟赛开发案列优质学习资料资源工具与案列应用场景开发文档教程资料.txt
- 毕业设计:Python基于知识图谱的医疗问答系统(源码 + 数据库 + 使用文档).zip
- 202312(第15届)蓝桥杯Scratch图形化编程青少组(选拔赛-初/中级)第2题真题-转动的风车素材和程序
- 投票系统开发案列优质学习资料资源工具与案列应用场景开发文档教程资料.txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功