<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/unix/modtime.c, branch esp-extra-scripts</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=esp-extra-scripts</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=esp-extra-scripts'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-06-28T10:28:50+00:00</updated>
<entry>
<title>unix/modtime: Release the GIL when sleeping.</title>
<updated>2016-06-28T10:28:50+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-26T11:54:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=94d2919b7798e121e9266a6b2970e16b36339b2c'/>
<id>urn:sha1:94d2919b7798e121e9266a6b2970e16b36339b2c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>unix: Move "utime" module config to C level instead of make level.</title>
<updated>2016-06-17T20:35:00+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-06-17T20:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6f8880d0ab92e002e7596578ceb0959f9327bc01'/>
<id>urn:sha1:6f8880d0ab92e002e7596578ceb0959f9327bc01</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Change type signature of builtin funs that take variable or kw args.</title>
<updated>2016-01-11T00:49:27+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-03T14:21:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4b72b3a133ea87a1ef8b964508dc25c551ccf093'/>
<id>urn:sha1:4b72b3a133ea87a1ef8b964508dc25c551ccf093</id>
<content type='text'>
With this patch the n_args parameter is changed type from mp_uint_t to
size_t.
</content>
</entry>
<entry>
<title>unix/modtime: strftime(): Support 2nd argument, but as time_t value.</title>
<updated>2016-01-10T10:08:27+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-01-10T10:06:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8175877ad64a631e9ce0f9a5b66782d58ea5f48d'/>
<id>urn:sha1:8175877ad64a631e9ce0f9a5b66782d58ea5f48d</id>
<content type='text'>
Instead of struct tm like structure, as required by CPython.
</content>
</entry>
<entry>
<title>unix/modtime: Add strftime() function (only single argument is supported).</title>
<updated>2015-12-13T22:10:57+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-12-13T22:10:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8fb255dc342a88b039f132f4fe28b91ce917650d'/>
<id>urn:sha1:8fb255dc342a88b039f132f4fe28b91ce917650d</id>
<content type='text'>
Following "don't rely on FFI for basic functionality" approach.
</content>
</entry>
<entry>
<title>unix/modtime: sleep(): Return early if KeyboardInterrupt is pending</title>
<updated>2015-12-01T22:37:25+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-12-01T22:37:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=3376875bc8bc7d6854823dcb2c4b763d7c582a99'/>
<id>urn:sha1:3376875bc8bc7d6854823dcb2c4b763d7c582a99</id>
<content type='text'>
As set by signal handler. This assumes that exception will be raised
somewhere else, which so far doesn't happen for single function call.
Still, it makes sense to handle that in some common place.
</content>
</entry>
<entry>
<title>py: Add MP_ROM_* macros and mp_rom_* types and use them.</title>
<updated>2015-11-29T14:25:04+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-11-27T13:38:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=cbf7674025814797f5c537d6d1c195efe58ccaaf'/>
<id>urn:sha1:cbf7674025814797f5c537d6d1c195efe58ccaaf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>unix/modtime: Unbreak Windows build after changes to check select() result.</title>
<updated>2015-11-29T12:31:58+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-11-29T12:31:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=fad7d9317b47330533ee6c84ffdaa3e53ad76e46'/>
<id>urn:sha1:fad7d9317b47330533ee6c84ffdaa3e53ad76e46</id>
<content type='text'>
</content>
</entry>
<entry>
<title>unix/modtime: sleep(): Automatically restart after receiving EINTR.</title>
<updated>2015-11-29T12:21:06+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-11-29T11:37:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0bb57bf5bf1c9822abca524aabd00fe9b861d10d'/>
<id>urn:sha1:0bb57bf5bf1c9822abca524aabd00fe9b861d10d</id>
<content type='text'>
THis is required to deal well with signals, signals being the closest
analogue of hardware interrupts for POSIX. This is also CPython 3.5
compliant behavior (PEP 475).

The main problem implementing this is to figure out how much time was
spent in waiting so far/how much is remaining. It's well-known fact that
Linux updates select()'s timeout value when returning with EINTR to the
remaining wait time. Here's what POSIX-based standards say about this:
(http://pubs.opengroup.org/onlinepubs/9699919799/functions/pselect.html):

"Upon successful completion, the select() function may modify the object
pointed to by the timeout argument."

I.e. it allows to modify timeout value, but doesn't say how exactly it is
modified. And actually, it allows such modification only "upon successful
completion", which returning with EINTR error hardly is.

POSIX also allows to request automatic EINTR restart for system calls using
sigaction call with SA_RESTART flag, but here's what the same document says
about it:

"If SA_RESTART has been set for the interrupting signal, it is
implementation-defined whether the function restarts or returns with
[EINTR]."

In other words, POSIX doesn't leave room for both portable and efficient
handling of this matter, so the code just allows to manually select
Linux-compatible behavior with MICROPY_SELECT_REMAINING_TIME option,
or otherwise will just raise OSError. When systems with non-Linux behavior
are found, they can be handled separately.
</content>
</entry>
<entry>
<title>unix/modtime: Implement ticks_ms(), ticks_us() and ticks_diff().</title>
<updated>2015-10-19T14:48:27+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-10-17T12:53:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8ee153f23429b63878d740168695cde3fb2a1497'/>
<id>urn:sha1:8ee153f23429b63878d740168695cde3fb2a1497</id>
<content type='text'>
All of these functions return positive small int, thus range is 2 bits less
than word size (30 bit on 32-bit systems, 62 bit on 64-bit systems).
</content>
</entry>
</feed>
