From a4216e907b3e139589b5fcee35874b670f985b89 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Wed, 21 Aug 2024 10:57:47 +0800
Subject: [PATCH] Add .ini parser example code

---
 booster/util_proc.h |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/booster/util_proc.h b/booster/util_proc.h
index 009cf70..89856c6 100644
--- a/booster/util_proc.h
+++ b/booster/util_proc.h
@@ -8,13 +8,14 @@
  *        Version:  1.0.0(7/06/2012~)
  *         Author:  Guo Wenxue <guowenxue@gmail.com>
  *      ChangeLog:  1, Release initial version on "7/06/2012 09:21:33 PM"
- *                 
+ *
  ********************************************************************************/
 
 #ifndef __UTIL_PROC_H_
 #define __UTIL_PROC_H_
 
 #include <signal.h>
+#include <time.h>
 
 #define PID_ASCII_SIZE  11
 
@@ -59,9 +60,30 @@
  * |   Low level API     |
  * +---------------------+*/
 
-
-
 /* get daemon process ID from $pid_file   */
 extern pid_t get_daemon_pid(const char *pid_file);
 
+/* +------------------------+
+ * |  inline functions API  |
+ * +------------------------+*/
+static inline void msleep(unsigned long ms)
+{
+    struct timespec cSleep;
+    unsigned long ulTmp;
+
+    cSleep.tv_sec = ms / 1000;
+    if (cSleep.tv_sec == 0)
+    {
+        ulTmp = ms * 10000;
+        cSleep.tv_nsec = ulTmp * 100;
+    }
+    else
+    {
+        cSleep.tv_nsec = 0;
+    }
+
+    nanosleep(&cSleep, 0);
+    return ;
+}
+
 #endif

--
Gitblit v1.9.1