帮忙看看是什么错误,谢谢
//db2abnd.c
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <stdlib.h>
#include <locale.h>
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <pwd.h>
#include "usersys.h"
void db2abnd(msg_dat)
struct msgdata *msg_dat;
{
int space;
memset((char *)&space,' ',sizeof(int));
if( msg_dat->d.errmno == space )
{
msg_dat->d.errmno = 0;
}
msg_dat->d.class1 = 9500;
memset(&msg_dat->d.command[7],NULL,1);
sprintf(msg_dat->d.msgdat, "%8s:ERR:DATABASE '%8s' ERROR",
msg_dat->d.pgname, msg_dat->d.command);
MSnd_Rcv(msg_dat, msg_dat);
}
//usersys.h
#define UMSGNOLEN 8 /* length of no */
#define UMSGIDLEN 16 /* length of id */
#define UMSGLEN 80 /* length of message */
#define UMSGDTLEN 500 /* length of data */
struct MSGDAT
{
int class1; /* message class1 */
int class2; /* message class2 */
int errmno; /* error message
int inpcnt; /* input count */
int outcnt; /* output count */
int inscnt; /* insert count */
int updcnt; /* update count */
int delcnt; /* delete count */
int fetcnt; /* fetch count */
int flsize; /* file size */
int sqlcod; /* sqlcode */
char command[UMSGNOLEN]; /* command name */
char msgno[UMSGNOLEN]; /* message number */
char pgname[UMSGIDLEN]; /* program name */
char htname[UMSGIDLEN]; /* host name */
char tablid[UMSGIDLEN]; /* table name */
char userid[UMSGIDLEN]; /* user id */
char dispid[UMSGIDLEN]; /* display id */
char msgdat[UMSGLEN]; /* message data */
char fldata[UMSGDTLEN]; /* data */
};
struct msgdata
{
long pid; /* process id */
struct MSGDAT d; /* message data */
};
程序编译执行时在if( msg_dat->d.errmno == space )处
发生错误,提示:Segmentation Fault - core dumped
谁能帮我解释一下是什么错误,谢谢。