• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H07-Apr-2018-112

docs/H07-Apr-2018-9,5316,440

img/H03-May-2022-

include/H07-Apr-2018-4,6483,366

m4/H07-Apr-2018-346307

samples/H07-Apr-2018-1,9841,425

src/H07-Apr-2018-47,09532,604

test/H07-Apr-2018-33,11421,393

tools/H07-Apr-2018-158136

.gitignoreH A D07-Apr-2018883 8071

.mailmapH A D07-Apr-20182.3 KiB4746

AUTHORSH A D07-Apr-201812.1 KiB333332

CONTRIBUTING.mdH A D07-Apr-20185.6 KiB170114

ChangeLogH A D07-Apr-2018104.5 KiB3,5321,752

LICENSEH A D07-Apr-20183.1 KiB7153

LICENSE-docsH A D07-Apr-201818.2 KiB397305

MAINTAINERS.mdH A D07-Apr-20181.8 KiB4430

Makefile.amH A D07-Apr-201817.7 KiB469416

Makefile.mingwH A D07-Apr-20182.4 KiB8765

README.mdH A D07-Apr-20188.4 KiB333228

SUPPORTED_PLATFORMS.mdH A D07-Apr-20182.8 KiB7453

android-configureH A D07-Apr-2018603 2420

appveyor.ymlH A D07-Apr-2018622 3325

autogen.shH A D07-Apr-20181.7 KiB4724

checksparse.shH A D07-Apr-20186 KiB254230

common.gypiH A D07-Apr-20186.8 KiB209207

configure.acH A D07-Apr-20183.4 KiB7371

gyp_uv.pyH A D07-Apr-20182 KiB7452

libuv.pc.inH A D07-Apr-2018283 1310

libuv.vcxprojH A D07-Apr-201814.3 KiB279279

libuv.vcxproj.filtersH A D07-Apr-201814 KiB386386

uv.gypH A D07-Apr-20189.8 KiB356354

vcbuild.batH A D07-Apr-20186 KiB185158

README.md

1![libuv][libuv_banner]
2
3## Overview
4
5libuv is a multi-platform support library with a focus on asynchronous I/O. It
6was primarily developed for use by [Node.js][], but it's also
7used by [Luvit](http://luvit.io/), [Julia](http://julialang.org/),
8[pyuv](https://github.com/saghul/pyuv), and [others](https://github.com/libuv/libuv/wiki/Projects-that-use-libuv).
9
10## Feature highlights
11
12 * Full-featured event loop backed by epoll, kqueue, IOCP, event ports.
13
14 * Asynchronous TCP and UDP sockets
15
16 * Asynchronous DNS resolution
17
18 * Asynchronous file and file system operations
19
20 * File system events
21
22 * ANSI escape code controlled TTY
23
24 * IPC with socket sharing, using Unix domain sockets or named pipes (Windows)
25
26 * Child processes
27
28 * Thread pool
29
30 * Signal handling
31
32 * High resolution clock
33
34 * Threading and synchronization primitives
35
36## Versioning
37
38Starting with version 1.0.0 libuv follows the [semantic versioning](http://semver.org/)
39scheme. The API change and backwards compatibility rules are those indicated by
40SemVer. libuv will keep a stable ABI across major releases.
41
42The ABI/API changes can be tracked [here](http://abi-laboratory.pro/tracker/timeline/libuv/).
43
44## Licensing
45
46libuv is licensed under the MIT license. Check the [LICENSE file](LICENSE).
47The documentation is licensed under the CC BY 4.0 license. Check the [LICENSE-docs file](LICENSE-docs).
48
49## Community
50
51 * [Support](https://github.com/libuv/help)
52 * [Mailing list](http://groups.google.com/group/libuv)
53 * [IRC chatroom (#libuv@irc.freenode.org)](http://webchat.freenode.net?channels=libuv&uio=d4)
54
55## Documentation
56
57### Official documentation
58
59Located in the docs/ subdirectory. It uses the [Sphinx](http://sphinx-doc.org/)
60framework, which makes it possible to build the documentation in multiple
61formats.
62
63Show different supported building options:
64
65```bash
66$ make help
67```
68
69Build documentation as HTML:
70
71```bash
72$ make html
73```
74
75Build documentation as HTML and live reload it when it changes (this requires
76sphinx-autobuild to be installed and is only supported on Unix):
77
78```bash
79$ make livehtml
80```
81
82Build documentation as man pages:
83
84```bash
85$ make man
86```
87
88Build documentation as ePub:
89
90```bash
91$ make epub
92```
93
94NOTE: Windows users need to use make.bat instead of plain 'make'.
95
96Documentation can be browsed online [here](http://docs.libuv.org).
97
98The [tests and benchmarks](https://github.com/libuv/libuv/tree/master/test)
99also serve as API specification and usage examples.
100
101### Other resources
102
103 * [LXJS 2012 talk](http://www.youtube.com/watch?v=nGn60vDSxQ4)
104   — High-level introductory talk about libuv.
105 * [libuv-dox](https://github.com/thlorenz/libuv-dox)
106   — Documenting types and methods of libuv, mostly by reading uv.h.
107 * [learnuv](https://github.com/thlorenz/learnuv)
108   — Learn uv for fun and profit, a self guided workshop to libuv.
109
110These resources are not handled by libuv maintainers and might be out of
111date. Please verify it before opening new issues.
112
113## Downloading
114
115libuv can be downloaded either from the
116[GitHub repository](https://github.com/libuv/libuv)
117or from the [downloads site](http://dist.libuv.org/dist/).
118
119Starting with libuv 1.7.0, binaries for Windows are also provided. This is to
120be considered EXPERIMENTAL.
121
122Before verifying the git tags or signature files, importing the relevant keys
123is necessary. Key IDs are listed in the
124[MAINTAINERS](https://github.com/libuv/libuv/blob/master/MAINTAINERS.md)
125file, but are also available as git blob objects for easier use.
126
127Importing a key the usual way:
128
129```bash
130$ gpg --keyserver pool.sks-keyservers.net --recv-keys AE9BC059
131```
132
133Importing a key from a git blob object:
134
135```bash
136$ git show pubkey-saghul | gpg --import
137```
138
139### Verifying releases
140
141Git tags are signed with the developer's key, they can be verified as follows:
142
143```bash
144$ git verify-tag v1.6.1
145```
146
147Starting with libuv 1.7.0, the tarballs stored in the
148[downloads site](http://dist.libuv.org/dist/) are signed and an accompanying
149signature file sit alongside each. Once both the release tarball and the
150signature file are downloaded, the file can be verified as follows:
151
152```bash
153$ gpg --verify libuv-1.7.0.tar.gz.sign
154```
155
156## Build Instructions
157
158For GCC there are two build methods: via autotools or via [GYP][].
159GYP is a meta-build system which can generate MSVS, Makefile, and XCode
160backends. It is best used for integration into other projects.
161
162To build with autotools:
163
164```bash
165$ sh autogen.sh
166$ ./configure
167$ make
168$ make check
169$ make install
170```
171
172### Windows
173
174Prerequisites:
175
176* [Python 2.6 or 2.7][] as it is required
177  by [GYP][].
178  If python is not in your path, set the environment variable `PYTHON` to its
179  location. For example: `set PYTHON=C:\Python27\python.exe`
180* One of:
181  * [Visual C++ Build Tools][]
182  * [Visual Studio 2015 Update 3][], all editions
183    including the Community edition (remember to select
184    "Common Tools for Visual C++ 2015" feature during installation).
185  * [Visual Studio 2017][], any edition (including the Build Tools SKU).
186    **Required Components:** "MSbuild", "VC++ 2017 v141 toolset" and one of the
187    Windows SDKs (10 or 8.1).
188* Basic Unix tools required for some tests,
189  [Git for Windows][] includes Git Bash
190  and tools which can be included in the global `PATH`.
191
192To build, launch a git shell (e.g. Cmd or PowerShell), run `vcbuild.bat`
193(to build with VS2017 you need to explicitly add a `vs2017` argument),
194which will checkout the GYP code into `build/gyp`, generate `uv.sln`
195as well as the necesery related project files, and start building.
196
197```console
198> vcbuild
199```
200
201Or:
202
203```console
204> vcbuild vs2017
205```
206
207To run the tests:
208
209```console
210> vcbuild test
211```
212
213To see all the options that could passed to `vcbuild`:
214
215```console
216> vcbuild help
217vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen] [nobuild] [vs2017] [x86/x64] [static/shared]
218Examples:
219  vcbuild.bat              : builds debug build
220  vcbuild.bat test         : builds debug build and runs tests
221  vcbuild.bat release bench: builds release build and runs benchmarks
222```
223
224
225### Unix
226
227For Debug builds (recommended) run:
228
229```bash
230$ ./gyp_uv.py -f make
231$ make -C out
232```
233
234For Release builds run:
235
236```bash
237$ ./gyp_uv.py -f make
238$ BUILDTYPE=Release make -C out
239```
240
241Run `./gyp_uv.py -f make -Dtarget_arch=x32` to build [x32][] binaries.
242
243### OS X
244
245Run:
246
247```bash
248$ ./gyp_uv.py -f xcode
249$ xcodebuild -ARCHS="x86_64" -project uv.xcodeproj \
250     -configuration Release -target All
251```
252
253Using Homebrew:
254
255```bash
256$ brew install --HEAD libuv
257```
258
259Note to OS X users:
260
261Make sure that you specify the architecture you wish to build for in the
262"ARCHS" flag. You can specify more than one by delimiting with a space
263(e.g. "x86_64 i386").
264
265### Android
266
267Run:
268
269```bash
270$ source ./android-configure NDK_PATH gyp [API_LEVEL]
271$ make -C out
272```
273
274The default API level is 24, but a different one can be selected as follows:
275
276```bash
277$ source ./android-configure ~/android-ndk-r15b gyp 21
278$ make -C out
279```
280
281Note for UNIX users: compile your project with `-D_LARGEFILE_SOURCE` and
282`-D_FILE_OFFSET_BITS=64`. GYP builds take care of that automatically.
283
284### Using Ninja
285
286To use ninja for build on ninja supported platforms, run:
287
288```bash
289$ ./gyp_uv.py -f ninja
290$ ninja -C out/Debug     #for debug build OR
291$ ninja -C out/Release
292```
293
294
295### Running tests
296
297Run:
298
299```bash
300$ ./gyp_uv.py -f make
301$ make -C out
302$ ./out/Debug/run-tests
303```
304
305## Supported Platforms
306
307Check the [SUPPORTED_PLATFORMS file](SUPPORTED_PLATFORMS.md).
308
309### AIX Notes
310
311AIX support for filesystem events requires the non-default IBM `bos.ahafs`
312package to be installed.  This package provides the AIX Event Infrastructure
313that is detected by `autoconf`.
314[IBM documentation](http://www.ibm.com/developerworks/aix/library/au-aix_event_infrastructure/)
315describes the package in more detail.
316
317AIX support for filesystem events is not compiled when building with `gyp`.
318
319## Patches
320
321See the [guidelines for contributing][].
322
323[node.js]: http://nodejs.org/
324[GYP]: http://code.google.com/p/gyp/
325[guidelines for contributing]: https://github.com/libuv/libuv/blob/master/CONTRIBUTING.md
326[libuv_banner]: https://raw.githubusercontent.com/libuv/libuv/master/img/banner.png
327[x32]: https://en.wikipedia.org/wiki/X32_ABI
328[Python 2.6 or 2.7]: https://www.python.org/downloads/
329[Visual C++ Build Tools]: http://landinghub.visualstudio.com/visual-cpp-build-tools
330[Visual Studio 2015 Update 3]: https://www.visualstudio.com/vs/older-downloads/
331[Visual Studio 2017]: https://www.visualstudio.com/downloads/
332[Git for Windows]: http://git-scm.com/download/win
333