Bug 24744

Summary: sys/socket.h uses u_char without including sys/types.h
Product: Base System Reporter: peter <peter>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-STABLE   
Hardware: Any   
OS: Any   

Description peter 2001-01-30 23:30:01 UTC
sys/socket.h contains, amongst others, the line:

typedef u_char          sa_family_t;

u_char is defined in sys/types.h, but sys/socket.h doesn't include it

Fix: 

Include sys/types.h from sys/socket.h
How-To-Repeat: 
#include <sys/socket.h>
#include <sys/types.h>

void main(void)
{
}


Swapping the two include lines around makes it compile fine.
Comment 1 Mike Heffner freebsd_committer freebsd_triage 2001-06-30 00:10:14 UTC
State Changed
From-To: open->closed

This is documented in the manpages. Take for example socket(2), it 
lists <sys/types.h> before <sys/socket.h>. The order of includes 
should follow the manpage.