MFC sys/sys/socket.h, please?

Gerald Pfeifer pfeifer at
Tue Jul 29 09:17:36 PDT 2003

Hi Mike/-standards,

may I ask you to MFC (part of) the following patch to sys/sys/socket.h?

  revision 1.67
  date: 2002/10/12 11:39:19;  author: mike;  state: Exp;  lines: +100 -17
  o Add typedefs for size_t and ssize_t.
  o Add typedefs for gid_t, off_t, pid_t, and uid_t in the non-standards
  o Add struct iovec (also defined in <sys/uio.h>).
  o Add visibility conditionals to avoid defining non-standard
    extentions in the standards case.
  o Change spelling of some types so they work without including
    <sys/types.h> (u_char -> unsigned char, u_short -> unsigned short,
    int64 -> __int64, caddr_t -> char *)
  o Add comments about missing restrict type-qualifiers and missing

Without this, the following small program fails to compile on -STABLE:

  #define _POSIX_SOURCE
  #include <sys/types.h>
  #include <sys/socket.h>

with the following warnings/errors:

  /usr/include/sys/socket.h:52: syntax error before `sa_family_t'
  /usr/include/sys/socket.h:52: warning: data definition has no type or storage class
  /usr/include/sys/socket.h:163: syntax error before `u_char'
  /usr/include/sys/socket.h:174: syntax error before `u_short'
  /usr/include/sys/socket.h:188: syntax error before `u_char'

Gerald (gerald at
Gerald "Jerry"   pfeifer at

More information about the freebsd-standards mailing list