The trait of this implementation is that it doesn't use priority queue and
time scheduling, and instead does its all operations using polling, starting
with such basic one as sleep. On the other hand, this tries to implement
all (well, much) of upstream asyncio API and warts.
asyncio_slow: Rename from asyncio_micro.
It may turn out that this won't be "micro" at all. The main trait of this
implementation is that it stay 100% API compatible with upstream (in
those APIs which are implemented of course). It will also keep inefficient
implementation of event loop scheduling, to discourage its use. Here we go.
By removing any IO watches for associated file handle. The way it's
implemented tries to preserve OS-like separation between event loop and
tasks. So, stream to finish watching fd for IO also issues syscall,
instead of calling methods on loop instance directly. Calling method on
loop would be more efficient, but will require storing reference to loop
in each stream. And those separation matters...
ffi now works properly with double return type, so this function can
return the correct type. Can confirm that sqlite3_column_double now
works correctly on 32-bit and 64-bit x86.
CPython lib reference specifies that listdir() should accept both bytes and
str argument, and return value type should match the argument. But no such
stipulation is made for walk(), so we just return strings.
ino_t and off_t types (d_ino and d_off fields) appear to be defined as unsigned
long on Linux.
TODO: Move readdir wrapper function to C, because DIRENT layout is inherently
OS-specific.
It's needed because different LIBC implementation use different shared
library names, so this module abstracts operation of finding the correct
one.
Default search order:
1. libc.so. This is usually doesn't exist, but user can create such symlink,
and it will be used fast.
2. libc.so.0, as used by current uClibc versions.
3. libc.so.6, as used by current Glibc versions.
uClibc is tried first because system where it is used are usually
underpowered to do array of attempts.
User can also override default search names by calling _libc.set_names(),
(which should be called before importing any other modules).