version 1.98.4.1, 2011/02/08 16:20:05 |
version 1.103, 2012/01/20 01:17:01 |
Line 97 typedef _BSD_SSIZE_T_ ssize_t; |
|
Line 97 typedef _BSD_SSIZE_T_ ssize_t; |
|
#endif |
#endif |
|
|
#include <sys/uio.h> |
#include <sys/uio.h> |
|
#include <sys/sigtypes.h> |
|
|
/* |
/* |
* Socket types. |
* Socket types. |
Line 107 typedef _BSD_SSIZE_T_ ssize_t; |
|
Line 108 typedef _BSD_SSIZE_T_ ssize_t; |
|
#define SOCK_RDM 4 /* reliably-delivered message */ |
#define SOCK_RDM 4 /* reliably-delivered message */ |
#define SOCK_SEQPACKET 5 /* sequenced packet stream */ |
#define SOCK_SEQPACKET 5 /* sequenced packet stream */ |
|
|
|
#define SOCK_CLOEXEC 0x10000000 /* set close on exec on socket */ |
|
#define SOCK_NONBLOCK 0x20000000 /* set non blocking i/o socket */ |
|
#define SOCK_FLAGS_MASK 0xf0000000 /* flags mask */ |
|
|
/* |
/* |
* Option flags per-socket. |
* Option flags per-socket. |
*/ |
*/ |
|
|
#define MSG_BCAST 0x0100 /* this message was rcvd using link-level brdcst */ |
#define MSG_BCAST 0x0100 /* this message was rcvd using link-level brdcst */ |
#define MSG_MCAST 0x0200 /* this message was rcvd using link-level mcast */ |
#define MSG_MCAST 0x0200 /* this message was rcvd using link-level mcast */ |
#define MSG_NOSIGNAL 0x0400 /* do not generate SIGPIPE on EOF */ |
#define MSG_NOSIGNAL 0x0400 /* do not generate SIGPIPE on EOF */ |
|
#if defined(_NETBSD_SOURCE) |
|
#define MSG_CMSG_CLOEXEC 0x0800 /* close on exec receiving fd */ |
|
#define MSG_NBIO 0x1000 /* use non-blocking I/O */ |
|
#endif |
|
|
/* Extra flags used internally only */ |
/* Extra flags used internally only */ |
#define MSG_USERFLAGS 0x0ffffff |
#define MSG_USERFLAGS 0x0ffffff |
Line 522 struct cmsghdr { |
|
Line 531 struct cmsghdr { |
|
* without (2), we can't guarantee binary compatibility in case of future |
* without (2), we can't guarantee binary compatibility in case of future |
* changes in ALIGNBYTES. |
* changes in ALIGNBYTES. |
*/ |
*/ |
#define __CMSG_ALIGN(n) (((n) + __cmsg_alignbytes()) & ~__cmsg_alignbytes()) |
|
#ifdef _KERNEL |
#ifdef _KERNEL |
|
#define __CMSG_ALIGN(n) (((n) + ALIGNBYTES) & ~ALIGNBYTES) |
#define CMSG_ALIGN(n) __CMSG_ALIGN(n) |
#define CMSG_ALIGN(n) __CMSG_ALIGN(n) |
|
#else |
|
#define __CMSG_ALIGN(n) (((n) + __cmsg_alignbytes()) & ~__cmsg_alignbytes()) |
#endif |
#endif |
|
|
/* given pointer to struct cmsghdr, return pointer to next cmsghdr */ |
/* given pointer to struct cmsghdr, return pointer to next cmsghdr */ |
Line 565 struct cmsghdr { |
|
Line 576 struct cmsghdr { |
|
|
|
#include <sys/cdefs.h> |
#include <sys/cdefs.h> |
|
|
|
#ifndef _KERNEL |
__BEGIN_DECLS |
__BEGIN_DECLS |
int __cmsg_alignbytes(void); |
int __cmsg_alignbytes(void) __constfunc; |
__END_DECLS |
__END_DECLS |
|
#endif |
|
|
#ifdef _KERNEL |
#ifdef _KERNEL |
static inline socklen_t |
static inline socklen_t |
Line 603 int getpeername(int, struct sockaddr * _ |
|
Line 616 int getpeername(int, struct sockaddr * _ |
|
int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict); |
int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict); |
int getsockopt(int, int, int, void *__restrict, socklen_t * __restrict); |
int getsockopt(int, int, int, void *__restrict, socklen_t * __restrict); |
int listen(int, int); |
int listen(int, int); |
|
int paccept(int, struct sockaddr * __restrict, socklen_t * __restrict, |
|
const sigset_t * __restrict, int); |
ssize_t recv(int, void *, size_t, int); |
ssize_t recv(int, void *, size_t, int); |
ssize_t recvfrom(int, void *__restrict, size_t, int, |
ssize_t recvfrom(int, void *__restrict, size_t, int, |
struct sockaddr * __restrict, socklen_t * __restrict); |
struct sockaddr * __restrict, socklen_t * __restrict); |