我是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;
}
感谢。