为什么timer_create属于linux

时间:2014-07-20 06:34:04

标签: c linux

我是Linux新手, 我尝试调用timer_create函数,但它失败了,我收到以下消息:

  

"*** glibc detected *** ...: malloc(): memory corruption: 0x085d0b0".

#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <time.h>

int StartClock(Struct* pThis)
{
struct sigevent se;
int ret;

se.sigev_notify      = SIGEV_THREAD;
se.sigev_signo       = SIGRTMIN;
se.sigev_value.sival_ptr = pThis->timerid;
se.sigev_notify_function = ClockHandler;

timer_create(CLOCK_MONOTONIC, &se, pThis->timerid);
return ret;
}

感谢。

0 个答案:

没有答案