Comparison

util-src/pposix.c @ 7440:5424e24cdcb1

util.pposix: Ask for shared file descriptor table using rfork() on *BSD (fixes #412)
author Kim Alvefur <zash@zash.se>
date Wed, 25 May 2016 21:34:34 +0200
parent 6942:f12deb882148
child 7789:93dd90309779
comparison
equal deleted inserted replaced
7439:4cccaa33b0a1 7440:5424e24cdcb1
45 #endif 45 #endif
46 46
47 #if (defined(_SVID_SOURCE) && !defined(WITHOUT_MALLINFO)) 47 #if (defined(_SVID_SOURCE) && !defined(WITHOUT_MALLINFO))
48 #include <malloc.h> 48 #include <malloc.h>
49 #define WITH_MALLINFO 49 #define WITH_MALLINFO
50 #endif
51
52 #if defined(RFPROC) && defined(EV_SET)
53 /*
54 * On *BSD, calling fork() is equivalent to rfork(RFPROC | RFFDG).
55 *
56 * RFFDG being set means that the file descriptor table is copied,
57 * otherwise it's shared. We want the later, otherwise libevent gets
58 * messed up.
59 *
60 * See issue #412
61 */
62 #define fork() rfork(RFPROC)
50 #endif 63 #endif
51 64
52 /* Daemonization support */ 65 /* Daemonization support */
53 66
54 static int lc_daemonize(lua_State* L) { 67 static int lc_daemonize(lua_State* L) {