APUE course source code
guowenxue
10 hours ago 489b6a3c10ccaff0fd0de55b5030e2992d122a7b
project/4.mqttd/booster/proc.h
@@ -11,11 +11,10 @@
 *
 ********************************************************************************/
#ifndef __PROC_H_
#define __PROC_H_
#ifndef __UTIL_PROC_H_
#define __UTIL_PROC_H_
#include <signal.h>
#include <time.h>
#define PID_ASCII_SIZE  11
@@ -62,28 +61,5 @@
/* 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