Add uv_device_t as stream on windows and linux, handle device I/O asyncly.

I'm a multi-language programmer, but not family with english, so maybe trouble with options. libuv is a good i/o framework, and easy to extent, I hope persist on it to do my work.

When I want to do r/w device on windows, I try filesystem api, it works for device handle, but not fit my needs. I need a real stream, I try wrap handle as pipe, and fail to work. When I study TTY and TCP, I realize that it not hard to implication a device type stream, because just file operation with overlapped,  even simpler than other stream types.
When I finish my job on windows, i realize libUV is born for linux, simple to add a device type, so i did it.

There are only two type related api.

```
UV_EXTERN int uv_device_open(uv_loop_t* handle, uv_device_t* device, const char*path, int flags);
UV_EXTERN int uv_device_ioctl(uv_device_t* device, int cmd, void* arg);
```
uv_device_open create a uv_deive_t, path should be '/dev/??' on linux or "\\.\Global\???" on windows.
flags should be  O_RDONLY,O_WRONLY  or O_RDWR.

uv_device_ioctl will set or get device paramater,  arg is relative with OS platform. on windows please use are uv_ioargs_t, detail please see header file.

because not test widely, so maybe have bugs, please attention.

Happy for do something for libUV.
That macro is defined by us somewhere, just use the uppercase variant :-)
On Nov 15, 2014 10:11 AM, "George Zhao" <notifications@github.com> wrote:

> In test/test-device-tun-echo.c:
>
> > +#include <unistd.h>
> > +#include <sys/socket.h>
> > +#include <linux/if.h>
> > +#include <linux/if_tun.h>
> > +#include <sys/types.h>
> > +#include <sys/ioctl.h>
> > +#include <sys/stat.h>
> > +#include <fcntl.h>
> > +#include <arpa/inet.h>
> > +#include <sys/select.h>
> > +#include <sys/time.h>
> > +#include <errno.h>
> > +#include <stdarg.h>
> > +#include <assert.h>
> > +
> > +#define ASSERT assert
>
> use macro to support linux and windows.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/joyent/libuv/pull/1580/files#r20402268>.
>