Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/un.h
Show All 38 Lines | |||||
#include <sys/_types.h> | #include <sys/_types.h> | ||||
#ifndef _SA_FAMILY_T_DECLARED | #ifndef _SA_FAMILY_T_DECLARED | ||||
typedef __sa_family_t sa_family_t; | typedef __sa_family_t sa_family_t; | ||||
#define _SA_FAMILY_T_DECLARED | #define _SA_FAMILY_T_DECLARED | ||||
#endif | #endif | ||||
/* | /* | ||||
* Historically, (struct sockaddr) needed to fit inside an MBUF. | |||||
* For this reason, UNIX domain sockets were therefore limited to | |||||
* 104 bytes. While this limit is no longer necessary, it is kept for | |||||
* binary compatibility reasons. | |||||
*/ | |||||
#define SUNPATHLEN 104 | |||||
/* | |||||
* Definitions for UNIX IPC domain. | * Definitions for UNIX IPC domain. | ||||
*/ | */ | ||||
struct sockaddr_un { | struct sockaddr_un { | ||||
unsigned char sun_len; /* sockaddr len including null */ | unsigned char sun_len; /* sockaddr len including null */ | ||||
sa_family_t sun_family; /* AF_UNIX */ | sa_family_t sun_family; /* AF_UNIX */ | ||||
char sun_path[104]; /* path name (gag) */ | char sun_path[SUNPATHLEN]; /* path name (gag) */ | ||||
bz: I'd almost say this could be an independent change. I am slightly confused as to why this is… | |||||
Not Done Inline ActionsBecause back in the mists of ancient time, sockaddrs had to fit in an mbuf and mbufs were only 128 bytes. There's no reason it has to be that way now except binary compatibility wollman: Because back in the mists of ancient time, sockaddrs had to fit in an mbuf and mbufs were only… | |||||
Not Done Inline ActionsCan we document this with a comment? That would be awesome as otherwise the knowledge one day will be lost. bz: Can we document this with a comment? That would be awesome as otherwise the knowledge one day… | |||||
}; | }; | ||||
#if __BSD_VISIBLE | #if __BSD_VISIBLE | ||||
/* Socket options. */ | /* Socket options. */ | ||||
#define LOCAL_PEERCRED 1 /* retrieve peer credentials */ | #define LOCAL_PEERCRED 1 /* retrieve peer credentials */ | ||||
#define LOCAL_CREDS 2 /* pass credentials to receiver */ | #define LOCAL_CREDS 2 /* pass credentials to receiver */ | ||||
#define LOCAL_CONNWAIT 4 /* connects block until accepted */ | #define LOCAL_CONNWAIT 4 /* connects block until accepted */ | ||||
Show All 15 Lines |
I'd almost say this could be an independent change. I am slightly confused as to why this is 104 (and has been for 25-ish years) and I assume more people will wonder over time.