aboutsummaryrefslogtreecommitdiff
path: root/src/timeout.c
diff options
context:
space:
mode:
authorCaleb Maclennan <caleb@alerque.com>2023-11-10 09:12:04 +0300
committerCaleb Maclennan <caleb@alerque.com>2023-11-10 09:12:04 +0300
commit5c4fc93d5f4137bf4c22ddf1a048c907a4a26727 (patch)
treea9a68e1f6a9c3bfe2b64fa1c3a4098865b7d3b5d /src/timeout.c
parentccef3bc4e2aa6ee5b997a80aabb58f4ff0b0e98f (diff)
parent43a97b7f0053313b43906371dbdc226271e6c8ab (diff)
downloadluasocket-hjelmeland-patch-1.tar.gz
luasocket-hjelmeland-patch-1.tar.bz2
luasocket-hjelmeland-patch-1.zip
Merge branch 'master' into hjelmeland-patch-1hjelmeland-patch-1
Diffstat (limited to '')
-rw-r--r--src/timeout.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/timeout.c b/src/timeout.c
index 087d033..2bdc069 100644
--- a/src/timeout.c
+++ b/src/timeout.c
@@ -2,17 +2,15 @@
2* Timeout management functions 2* Timeout management functions
3* LuaSocket toolkit 3* LuaSocket toolkit
4\*=========================================================================*/ 4\*=========================================================================*/
5#include <stdio.h> 5#include "luasocket.h"
6#include <limits.h>
7#include <float.h>
8
9#include "lua.h"
10#include "lauxlib.h"
11#include "compat.h"
12 6
13#include "auxiliar.h" 7#include "auxiliar.h"
14#include "timeout.h" 8#include "timeout.h"
15 9
10#include <stdio.h>
11#include <limits.h>
12#include <float.h>
13
16#ifdef _WIN32 14#ifdef _WIN32
17#include <windows.h> 15#include <windows.h>
18#else 16#else
@@ -173,6 +171,16 @@ int timeout_meth_settimeout(lua_State *L, p_timeout tm) {
173 return 1; 171 return 1;
174} 172}
175 173
174/*-------------------------------------------------------------------------*\
175* Gets timeout values for IO operations
176* Lua Output: block, total
177\*-------------------------------------------------------------------------*/
178int timeout_meth_gettimeout(lua_State *L, p_timeout tm) {
179 lua_pushnumber(L, tm->block);
180 lua_pushnumber(L, tm->total);
181 return 2;
182}
183
176/*=========================================================================*\ 184/*=========================================================================*\
177* Test support functions 185* Test support functions
178\*=========================================================================*/ 186\*=========================================================================*/