… | |
… | |
106 | |
106 | |
107 | /*****************************************************************************/ |
107 | /*****************************************************************************/ |
108 | |
108 | |
109 | #include "libeio/config.h" |
109 | #include "libeio/config.h" |
110 | |
110 | |
|
|
111 | #if HAVE_EVENTFD |
|
|
112 | # include <sys/eventfd.h> |
|
|
113 | #endif |
|
|
114 | |
111 | #if HAVE_RLIMITS |
115 | #if HAVE_RLIMITS |
112 | #include <sys/time.h> |
116 | #include <sys/time.h> |
113 | #include <sys/resource.h> |
117 | #include <sys/resource.h> |
114 | #endif |
118 | #endif |
115 | |
119 | |
… | |
… | |
1161 | const_iv (SPLICE_F_MOVE) |
1165 | const_iv (SPLICE_F_MOVE) |
1162 | const_iv (SPLICE_F_NONBLOCK) |
1166 | const_iv (SPLICE_F_NONBLOCK) |
1163 | const_iv (SPLICE_F_MORE) |
1167 | const_iv (SPLICE_F_MORE) |
1164 | const_iv (SPLICE_F_GIFT) |
1168 | const_iv (SPLICE_F_GIFT) |
1165 | |
1169 | |
|
|
1170 | const_iv (EFD_CLOEXEC) |
|
|
1171 | const_iv (EFD_NONBLOCK) |
|
|
1172 | const_iv (EFD_SEMAPHORE) |
|
|
1173 | |
1166 | /* these are libeio constants, and are independent of gendef0 */ |
1174 | /* these are libeio constants, and are independent of gendef0 */ |
1167 | const_eio (SEEK_SET) |
1175 | const_eio (SEEK_SET) |
1168 | const_eio (SEEK_CUR) |
1176 | const_eio (SEEK_CUR) |
1169 | const_eio (SEEK_END) |
1177 | const_eio (SEEK_END) |
1170 | |
1178 | |
… | |
… | |
2156 | PUSHs (newmortalFH (fd[0], O_RDONLY)); |
2164 | PUSHs (newmortalFH (fd[0], O_RDONLY)); |
2157 | PUSHs (newmortalFH (fd[1], O_WRONLY)); |
2165 | PUSHs (newmortalFH (fd[1], O_WRONLY)); |
2158 | } |
2166 | } |
2159 | } |
2167 | } |
2160 | |
2168 | |
|
|
2169 | void |
|
|
2170 | eventfd (unsigned int initval = 0, int flags = 0) |
|
|
2171 | PPCODE: |
|
|
2172 | { |
|
|
2173 | int fd; |
|
|
2174 | #if HAVE_EVENTFD |
|
|
2175 | fd = eventfd (initval, flags); |
|
|
2176 | #else |
|
|
2177 | fd = (errno = ENOSYS, -1); |
|
|
2178 | #endif |
|
|
2179 | |
|
|
2180 | XPUSHs (newmortalFH (fd, O_RDWR)); |
|
|
2181 | } |
|
|
2182 | |
2161 | UV |
2183 | UV |
2162 | get_fdlimit () |
2184 | get_fdlimit () |
2163 | CODE: |
2185 | CODE: |
2164 | #if HAVE_RLIMITS |
2186 | #if HAVE_RLIMITS |
2165 | struct rlimit rl; |
2187 | struct rlimit rl; |