Matthew Wild
a3b71e8fc9
util.pposix: Add fdopen() to return a Lua file object from an fd
...
Now we can, for example, read/write pipes using Lua's standard I/O routines.
2024-11-20 12:08:59 +00:00
Matthew Wild
6480651a93
util.pposix: Add pipe() (with support for pipe2() flags on Linux)
2024-11-16 12:26:55 +00:00
Kim Alvefur
048b064fcd
util.pposix: Add remove_blocks() for deleting parts of files
...
Allows implementing e.g. a FIFO
Will probably only work on some Linux file systems like ext4.
2023-06-07 05:07:03 +02:00
Kim Alvefur
b7b65435f7
util.pposix: Use Lua enum API for resource limit name argument
...
Because diffstat.
2023-06-14 13:39:39 +02:00
Kim Alvefur
8136aa749a
util: Add compat for prosody module name change to C sources
2023-03-17 18:03:07 +01:00
Kim Alvefur
dff4beae02
util-src: Remove Lua 5.1 compat macros
...
Part of #1600
2022-07-01 21:21:21 +02:00
Kim Alvefur
d3bd9f9be5
util.pposix: Use mallinfo2() on glibc 2.33, fix #1649
2022-01-06 18:56:06 +01:00
Kim Alvefur
b93398ce79
util.pposix: Bind isatty(3)
...
Useful for disabling certain behavior, ANSI colors etc when not
connected to a terminal.
2021-07-04 15:11:07 +02:00
Kim Alvefur
625ec0a93f
util-src: Use the luaL_pushfail API added in Lua 5.4 to highlight all failure conditions
...
Actually just an alias of pushnil, but it does make it more obvious
where the failure conditions are, which is good for readability.
2020-06-07 02:25:56 +02:00
Kim Alvefur
8055c8f7d7
util.pposix,signal: Pass around various OS numbers as integers [Lua 5.3]
...
Passing around PIDs, UIDs etc as integers makes it more sane in Lua 5.3.
Getting 1234.0 as PID is silly. Shouldn't change any behavior as these
are all integers on the C side and the integral floats are accepted as
integers when passed back from Lua into C.
2020-05-04 21:51:30 +02:00
Emmanuel Gil Peyrot
a149dda0e3
util.*.c: Add static qualifiers everywhere
2019-12-01 20:25:20 +01:00
Kim Alvefur
908f5b61c5
Merge 0.11->trunk
2019-11-16 16:52:31 +01:00
Kim Alvefur
c4c38d2f01
util.pposix: Avoid overflow of malloc info at 2GB ( fixes #1445 until 4GB)
2019-11-16 16:45:33 +01: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
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
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
384687ffa4
util-src: Specify size of various tables to be allocated
2017-03-09 01:20:59 +01:00
Kim Alvefur
255423ab56
util.pposix: Use correct type for limits [-Wconstant-conversion]
2017-03-07 22:36:43 +01:00
Kim Alvefur
3c789f1ac7
util.pposix: Limit meminfo to Linux until we can figure out how to get this info on other platforms
2017-03-07 22:33:57 +01:00
Kim Alvefur
d205c78327
util.pposix, configure: Move _GNU_SOURCE macro into source files
2017-03-01 22:27:11 +01:00
Kim Alvefur
82755e48e8
util.pposix: Expose ENOENT constant (usually 2, but you never know)
2017-03-01 17:03:48 +01:00
Kim Alvefur
2b4028fd7e
util.pposix: Fix typo in comment
2017-02-26 20:31:08 +01:00
Kim Alvefur
40d8e257d8
util-src/*.c: Attach pointer * to name instead of type
2017-02-12 16:42:29 +01:00
Kim Alvefur
0d28378a7a
util-src/*.c: Squeeze repeated blank lines
2017-01-23 18:33:35 +01:00
Kim Alvefur
5b10d245e3
util-src: Make C modules assert that the Lua runtime matches what it was compiled for
2017-01-08 14:21:08 +01:00
Kim Alvefur
4bacd7b4fc
util.pposix: rfork() seems to be FreeBSD only ( fixes #412 )
2016-12-19 08:51:50 +01:00
Kim Alvefur
01a15bfbe2
util.pposix: Ask for shared file descriptor table using rfork() on *BSD ( fixes #412 )
2016-05-25 21:34:34 +02:00
Kim Alvefur
c8454e9180
util.pposix: Expose the uname GNU extension field 'domainname'
2015-11-25 20:43:29 +01:00
Kim Alvefur
ddeed6873e
util-src/*.c: Invert Lua 5.2 compat to be 5.2+ by default and a macro to support 5.1
2015-04-26 12:38:37 +02:00
Kim Alvefur
d1a264a39a
util.pposix: Return error from ftruncate if that fails too (but what would we do here?)
2015-05-02 14:41:56 +02:00
Florian Zeitz
4d46c2e866
util-src/*.c: Per convention call luaL_error() as argument to return
2015-04-03 20:30:14 +02:00
Kim Alvefur
e866ef555a
util-src/*.c: astyle --indent=tab --brackets=attach --indent-switches --break-blocks --pad-oper --unpad-paren --add-brackets --align-pointer=type --lineend=linux
2015-04-03 19:52:48 +02:00
Kim Alvefur
8affcc3ff7
util-src/*.c: Add macro for compiling with Lua 5.2
2014-09-17 14:30:29 +02:00
Kim Alvefur
c57e98cd7d
util-src/*.c: Don't create globals when loaded
2014-09-16 21:56:18 +02:00
Kim Alvefur
dbf3c7d1a0
Merge 0.9->0.10
2014-04-27 01:02:20 +02:00
Kim Alvefur
92ed3576fc
util.pposix: Fix error reporting from really old Linux fallocate() that did not use errno for some reason (thanks pro)
2014-04-25 02:41:55 +02:00
Kim Alvefur
15b883a2f5
util.pposix: Fix error reporting from posix_fallocate, it doesn't use errno (thanks pro)
2014-04-25 00:36:01 +02:00
Kim Alvefur
b8ab703419
Merge 0.9->0.10
2013-11-28 16:17:21 +01:00
Kim Alvefur
6d5db18948
util.pposix: Verify that file handle is open
2013-11-28 16:12:40 +01:00
Matthew Wild
8eb7b73968
Merge 0.9->trunk
2013-09-03 00:20:28 +01:00