#include <stdio.h>
#include <stdint.h>
#include "/usr/include/sys/queue.h"
#include "/usr/include/altq/altq_classq.h"
#include "/usr/include/altq/altq_rmclass.h"
#include "/usr/include/bsm/audit.h"
#include "/usr/include/sys/types.h"
#include "/usr/include/bsdxml_external.h"
#include "/usr/include/sys/bitstring.h"
#include "/usr/include/bsdxml.h"
#define offsetof(TYPE,MEMBER) ((int)(&((TYPE *)0)->MEMBER))
audit.h这个文件包含结构,例如au_tid。 那些结构来自freebsd头文件,在freebsd系统上编译和执行
struct au_tid {
dev_t port;
u_int32_t machine;
};
struct au_tid_addr {
dev_t at_port;
u_int32_t at_type;
u_int32_t at_addr[4];
};
struct au_mask {
unsigned int am_success;
unsigned int am_failure;
};
struct auditinfo {
au_id_t ai_auid;
au_mask_t ai_mask;
au_tid_t ai_termid;
au_asid_t ai_asid;
};
struct auditinfo_addr {
au_id_t ai_auid;
au_mask_t ai_mask;
au_tid_addr_t ai_termid;
au_asid_t ai_asid;
au_asflgs_t ai_flags;
};
struct auditpinfo {
pid_t ap_pid;
au_id_t ap_auid;
au_mask_t ap_mask;
au_tid_t ap_termid;
au_asid_t ap_asid;
};
struct auditpinfo_addr {
pid_t ap_pid;
au_id_t ap_auid;
au_mask_t ap_mask;
au_tid_addr_t ap_termid;
au_asid_t ap_asid;
au_asflgs_t ap_flags;
};
struct au_session {
auditinfo_addr_t *as_aia_p;
au_mask_t as_mask;
};
.......
int main()
{
int temp =-1;
temp = offsetof(struct internal_state , dummy);
printf("%d\n", temp);
return 0;
}
编译上面的代码时,会出现错误
错误:重新定义&#39; &gt; struct au_tid_addr&#39;
提示,但我无法解决问题 谁能帮我?关于这个问题的讨论的链接也受到高度赞赏。感谢。