Commit graph

373 commits

Author SHA1 Message Date
Kim Alvefur
8126707125 util.poll: Tweak metatable name field 2018-10-06 18:32:57 +02:00
Kim Alvefur
d3c236c693 util.poll: Fix monitoring of socket exceptions in select mode
Since state->err is a set of all watched FDs, this mistake caused all
sockets to appear to have errors.
2018-10-06 17:19:50 +02:00
Kim Alvefur
110ce660d5 util.poll: Lua 5.1 compat 2018-09-15 01:17:53 +02:00
Kim Alvefur
1ad376770f util.poll: Remove 'inline' from function declaration
Why does this fix building?
2018-09-15 01:05:59 +02:00
Kim Alvefur
fa4507823f util.poll: Import poll library with epoll and select support 2018-05-16 23:56:34 +02:00
Kim Alvefur
2f939029ef util.pposix: Allow _DARWIN_C_SOURCE to be overriden
Like the others there
2018-09-08 11:52:44 +02:00
Kim Alvefur
53b9150562 Merge 0.10->trunk 2018-09-08 11:51:52 +02:00
Kim Alvefur
530a9f9c8e util.pposix: Fix or silence a warning on OS X (#1202) 2018-09-08 11:46:02 +02:00
Kim Alvefur
e837abbf5d Merge 0.10->trunk 2018-09-08 11:42:22 +02:00
Kim Alvefur
6391242937 util.pposix: Restrict use of malloc_info to glibc
Fixes build on musl based distros like Alpine linux
2018-09-07 15:50:12 +02:00
Kim Alvefur
53c20a796e util.pposix: Do not attempt to assign to stdio variables [pedantic]
Fixes build on gcc 6.4.0

See also https://stackoverflow.com/a/586416
2018-09-07 15:25:33 +02:00
Kim Alvefur
b78f1d3da1 util.pposix: Fix building on OS X (#1202) 2018-08-18 12:07:40 +02:00
Kim Alvefur
49232398ed util-src/makefile: Add util.time to BSD makefile 2018-08-11 17:33:11 +02:00
Kim Alvefur
592ccd8233 util.time: Allow for already set constant 2018-08-11 16:55:07 +02:00
Kim Alvefur
5485202439 util.signal: Fix loop (fixes #1047)
A pre-commit version probably started with i = nsig and counted down,
then an incomplete change to counting up was done
2017-11-30 19:35:35 +01:00
Kim Alvefur
27d99dd43b util.signal: Use a static array to keep track of pending signals (fixes #1029) 2017-11-14 15:20:14 +01:00
Kim Alvefur
8956f32a9c util.encodings: Use the 'idx' argument correctly [-Wunused-parameter] 2017-10-05 12:48:36 +02:00
Kim Alvefur
237f991e4f util.crand: Build with musl/non-glibc (can't have undefined argument-taking macros?) 2017-04-25 01:35:13 +02:00
Kim Alvefur
7f1be1b938 util.time: Add monotonic time 2017-03-09 04:37:12 +01:00
Kim Alvefur
b0e0a1d487 util.time: Convert to C 2017-03-09 04:34:28 +01:00
Emmanuel Gil Peyrot
2363ba3749 encodings: Explicitly say that base64 decoding falls through in a switch, fixes a warning in gcc 7+. 2018-08-08 09:29:32 +02:00
Emmanuel Gil Peyrot
c1be2da977 pposix: Generate an error when a passed string isn’t "unlimited". 2018-08-08 09:28:42 +02:00
Emmanuel Gil Peyrot
1a23a874bc pposix, signal: Ignore unused arguments. 2018-08-08 09:28:04 +02:00
Emmanuel Gil Peyrot
9d9392a941 net, pposix, signal: Check for redefined defines, fix warnings. 2018-08-08 09:27:34 +02:00
Kim Alvefur
39c7ba2a8f util.pposix: Use freopen(3) when replacing standard IO streams (thanks ratchetfreak)
Man page says this is what freopen(3) is for.
2018-07-12 20:42:22 +02:00
Kim Alvefur
1eb7584483 util.ringbuffer: Fix typo in comment [codespell] 2018-04-06 22:26:53 +02:00
Kim Alvefur
cdd71f28ac Add makefiles compatible with BSD make 2018-03-11 06:01:19 +01:00
Kim Alvefur
e156c05ad4 Rename Makefile -> GNUmakefile to reflect dependency on GNU Make 2017-10-31 17:28:23 +01:00
Kim Alvefur
28ba10b6b4 util.ringbuffer: Add method for discarding buffered data without returning it to lua 2018-02-24 14:45:06 +01:00
Kim Alvefur
a92cdf75b1 util.ringbuffer: Add various comments 2018-02-24 14:44:46 +01:00
Kim Alvefur
36ff81d81a util.crand: Return early if a zero bytes are requested 2017-12-03 15:42:55 +01:00
Kim Alvefur
96d9651ece util.crand: Throw an error for sizes smaller than 1 byte 2017-12-03 15:36:20 +01:00
Kim Alvefur
abb425e70f util.crand: Make it possible to use arc4random on Linux (needs libbsd) 2017-12-03 15:21:12 +01:00
Kim Alvefur
da570eb0a4 util.crand: Use a small buffer on the stack for small pieces of random, should be faster 2017-12-03 15:03:25 +01:00
Kim Alvefur
af554a9feb util.crand: Remove unneeded cast 2017-12-03 14:14:35 +01:00
Kim Alvefur
bc2a2bbd4d util.crand: Silence signedness warning 2017-12-03 14:13:56 +01:00
Kim Alvefur
ebeea12c82 util.crand: Only keep return value of getrandom() as the others don't return partial results 2017-12-02 11:11:32 +01:00
Kim Alvefur
991280175b util.crand: Try getrandom() again until buffer is filled 2017-12-02 10:58:37 +01:00
Kim Alvefur
f31e73eb48 Merge 0.10->trunk 2017-12-01 04:54:23 +01:00
Kim Alvefur
4816e879f8 util.net: Add bindings to inet_ntop and inet_pton 2017-11-26 02:26:13 +01:00
Kim Alvefur
b60447fad6 util.crand: Add comments about defines 2017-12-01 00:56:11 +01:00
Kim Alvefur
a29f404ece util.crand: Apply formatter 2017-12-01 00:29:25 +01:00
Kim Alvefur
bfaca2ef00 util.crand: Reorder includes so system ones are first 2017-12-01 00:28:52 +01:00
Kim Alvefur
a128e97e03 util.crand: Always include stdlib to be sure __GLIBC_PREREQ is defined 2017-12-01 00:27:37 +01:00
Kim Alvefur
d6184b31a3 util.pposix: Remove fallocate 2017-02-28 13:26:05 +01:00
Kim Alvefur
e8b57d789b util.pposix: Add function for atomically appending data to a file 2017-03-01 01:33:00 +01:00
Kim Alvefur
711e2c8713 util.encodings: Make limit lookup table a const (from Lua f2a813ae) 2017-03-22 23:40:53 +01:00
Kim Alvefur
df46957185 util.signal: Enable all GNU features, _DEFAULT_SOURCE doesn't have the desired effect before glibc 2.19 2017-03-12 12:49:34 +01:00
Kim Alvefur
bde567fd42 util.signal: Restore non-standard GNU "default" behaviour of signal(2) 2017-03-11 16:41:23 +01:00
Kim Alvefur
384687ffa4 util-src: Specify size of various tables to be allocated 2017-03-09 01:20:59 +01:00