#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <sys/prctl.h>
#include <string.h>
#include <pthread.h>
#include <liblx_api/lx_api.h>
static void *client_check(void *arg)
{
printf("###### %s %d ######\n", __FUNCTION__, __LINE__);
#define SZ_BUF 32768 /* 32*1024 */
char post_data[SZ_BUF] = {0};
char enc_msg[SZ_BUF + 16] = {0};
unsigned char cipher_data[SZ_BUF] = {0};
unsigned char cipher_str[SZ_BUF] = {0};
unsigned char test[SZ_BUF] = {0};
strcpy((char *)cipher_data, "AAAAAAAAAAAAAAAAA");
strcpy((char *)cipher_str, "CCCCCCCCCCCCCCC");
strcpy((char *)enc_msg, "DDDDDDDDDDDDDDDD");
strcpy((char *)post_data, "EEEEEEEEEEEEEEE");
strcpy((char *)test, "FFFFFFFFFFFFFFFFF");
printf("###### %s %d ######\n", __FUNCTION__, __LINE__);
return 0;
}
int main(void)
{
pthread_t tidp;
printf("\n######## start #####\n");
test_service(); //工作正常
if (pthread_create(&tidp, NULL, client_check, NULL) != 0) //异常退出
{
LX_NGX_ERR("pthread_create error!\n");
}
printf("AAAAAAA hello world!!!\n");
return 0;
}
上面的程序如果正常在 main 里面跑就是好的,但一放到 pthread_create 里面用线程跑就不行,放在 x86 上就可以,但放在我的板子里板就不行,这是什么鬼???? |
|