Hi,all,In my source code, I use snmp_alarm_register() to register my callback 
function, interval is 5 seconds. Callbak checks my decive status,if the status 
is abnormal,trap will be sent. But I find snmp_alarm_register() will effect my 
device's performance. So I want to use thread to implement the status-checking.
my code is as follows: ...#include <pthread.h>
...void init_scomcenter(void) {
 pthread_t check_fg;
 
  REGISTER_MIB("scomcenter", scomcenter_variables, variable7,
               scomcenter_variables_oid);/*  snmp_alarm_register(30,     // 
seconds
                        SA_REPEAT,      // repeat (every 30 seconds).
                        check_encoder_statu,      // our callback
                        NULL    // no callback data needed 
        );*/
        
 pthread_create(&check_fg, NULL, (void *)check_encoder, NULL);
        
}
..... In my uClinux-dist/user/ucdsnmp/agent/Makefile, I change lines as follows:
 ....
snmpd: ${AGENTOBJS} $(USELIBS) $(LIBTARG) Makefile
 $(CC) ${LDFLAGS} -elf2flt -L/usr/local/arm_tools/arm-elf/lib -lpthread -o $@ 
${AGENTOBJS} $(LOCAL_LIBS) ${AGENT_LIBS}$(LDLIBS)
...but while executing "make user_only", errors happen:...
snmpd.elf2flt: In function 'init_scomcenter':
mibgroup/scomcenter.c:273: undefined reference to 'pthread_create'
collect2: ld returned 1 exit status
make[3]:*** [snmpd] Error 1
........  How can I configure Makefile to make my source code correctly which 
uses thread functions. regards,yecl   
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to