webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Macros | Enumerations | Functions | Variables
user_socketvar.h File Reference
#include <sys/uio.h>

Go to the source code of this file.

Classes

struct  proc
 
struct  uio
 
struct  socket
 
struct  socket::sockbuf
 
struct  socket::so_accf
 
struct  xsocket
 
struct  xsocket::xsockbuf
 

Macros

#define SOCK_MAXADDRLEN   255
 
#define MSG_NOTIFICATION   0x2000 /* SCTP notification */
 
#define SCTP_SO_LINGER   0x0001
 
#define SCTP_SO_ACCEPTCONN   0x0002
 
#define SS_CANTRCVMORE   0x020
 
#define SS_CANTSENDMORE   0x010
 
#define sb_startzero   sb_mb
 
#define SB_MAX   (256*1024) /* default for max chars in sockbuf */
 
#define SB_RAW   (64*1024*2) /*Aligning so->so_rcv.sb_hiwat with the receive buffer size of raw socket*/
 
#define SB_WAIT   0x04 /* someone is waiting for data/space */
 
#define SB_SEL   0x08 /* someone is selecting */
 
#define SB_ASYNC   0x10 /* ASYNC I/O, need signals */
 
#define SB_UPCALL   0x20 /* someone wants an upcall */
 
#define SB_NOINTR   0x40 /* operations not interruptible */
 
#define SB_AIO   0x80 /* AIO operations queued */
 
#define SB_KNOTE   0x100 /* kernel note attached */
 
#define SB_AUTOSIZE   0x800 /* automatically size socket buffer */
 
#define SB_EMPTY_FIXUP(sb)
 
#define ACCEPT_LOCK()   (void)pthread_mutex_lock(&accept_mtx)
 
#define ACCEPT_UNLOCK()   (void)pthread_mutex_unlock(&accept_mtx)
 
#define ACCEPT_LOCK_ASSERT()   KASSERT(pthread_mutex_trylock(&accept_mtx) == EBUSY, ("%s: accept_mtx not locked", __func__))
 
#define ACCEPT_UNLOCK_ASSERT()
 
#define SOCKBUF_MTX(_sb)   (&(_sb)->sb_mtx)
 
#define SOCKBUF_LOCK_INIT(_sb, _name)   pthread_mutex_init(SOCKBUF_MTX(_sb), NULL)
 
#define SOCKBUF_LOCK_DESTROY(_sb)   pthread_mutex_destroy(SOCKBUF_MTX(_sb))
 
#define SOCKBUF_COND_INIT(_sb)   pthread_cond_init((&(_sb)->sb_cond), NULL)
 
#define SOCKBUF_COND_DESTROY(_sb)   pthread_cond_destroy((&(_sb)->sb_cond))
 
#define SOCK_COND_INIT(_so)   pthread_cond_init((&(_so)->timeo_cond), NULL)
 
#define SOCK_COND_DESTROY(_so)   pthread_cond_destroy((&(_so)->timeo_cond))
 
#define SOCK_COND(_so)   (&(_so)->timeo_cond)
 
#define SOCK_MTX(_so)   SOCKBUF_MTX(&(_so)->so_rcv)
 
#define SOCK_LOCK_ASSERT(_so)   SOCKBUF_LOCK_ASSERT(&(_so)->so_rcv)
 
#define SS_NOFDREF   0x0001 /* no file table ref any more */
 
#define SS_ISCONNECTED   0x0002 /* socket connected to a peer */
 
#define SS_ISCONNECTING   0x0004 /* in process of connecting to peer */
 
#define SS_ISDISCONNECTING   0x0008 /* in process of disconnecting */
 
#define SS_NBIO   0x0100 /* non-blocking ops */
 
#define SS_ASYNC   0x0200 /* async i/o notify */
 
#define SS_ISCONFIRMING   0x0400 /* deciding to accept connection req */
 
#define SS_ISDISCONNECTED   0x2000 /* socket disconnected from peer */
 
#define SS_PROTOREF   0x4000 /* strong protocol reference */
 
#define SBS_CANTSENDMORE   0x0010 /* can't send more data to peer */
 
#define SBS_CANTRCVMORE   0x0020 /* can't receive more data from peer */
 
#define SBS_RCVATMARK   0x0040 /* at mark on input */
 
#define SQ_INCOMP   0x0800 /* unaccepted, incomplete connection */
 
#define SQ_COMP   0x1000 /* unaccepted, complete connection */
 

Enumerations

enum  uio_rw { UIO_READ, UIO_WRITE }
 
enum  uio_seg { UIO_USERSPACE, UIO_SYSSPACE }
 

Functions

 MALLOC_DECLARE (M_ACCF)
 
 MALLOC_DECLARE (M_PCB)
 
 MALLOC_DECLARE (M_SONAME)
 

Variables

userland_mutex_t accept_mtx
 
userland_cond_t accept_cond
 

Macro Definition Documentation

◆ ACCEPT_LOCK

#define ACCEPT_LOCK ( )    (void)pthread_mutex_lock(&accept_mtx)

◆ ACCEPT_LOCK_ASSERT

#define ACCEPT_LOCK_ASSERT ( )    KASSERT(pthread_mutex_trylock(&accept_mtx) == EBUSY, ("%s: accept_mtx not locked", __func__))

◆ ACCEPT_UNLOCK

#define ACCEPT_UNLOCK ( )    (void)pthread_mutex_unlock(&accept_mtx)

◆ ACCEPT_UNLOCK_ASSERT

#define ACCEPT_UNLOCK_ASSERT ( )
Value:
do { \
KASSERT(pthread_mutex_trylock(&accept_mtx) == 0, ("%s: accept_mtx locked", __func__)); \
(void)pthread_mutex_unlock(&accept_mtx); \
} while (0)
userland_mutex_t accept_mtx
Definition: user_socket.c:59
void
Definition: AVFoundationCFSoftLinking.h:81

◆ MSG_NOTIFICATION

#define MSG_NOTIFICATION   0x2000 /* SCTP notification */

◆ SB_AIO

#define SB_AIO   0x80 /* AIO operations queued */

◆ SB_ASYNC

#define SB_ASYNC   0x10 /* ASYNC I/O, need signals */

◆ SB_AUTOSIZE

#define SB_AUTOSIZE   0x800 /* automatically size socket buffer */

◆ SB_EMPTY_FIXUP

#define SB_EMPTY_FIXUP (   sb)
Value:
do { \
if ((sb)->sb_mb == NULL) { \
(sb)->sb_mbtail = NULL; \
(sb)->sb_lastrecord = NULL; \
} \
} while (/*CONSTCOND*/0)
short sb[N]
Definition: gcc-loops.cpp:21
#define NULL
Definition: common_types.h:41

◆ SB_KNOTE

#define SB_KNOTE   0x100 /* kernel note attached */

◆ SB_MAX

#define SB_MAX   (256*1024) /* default for max chars in sockbuf */

◆ SB_NOINTR

#define SB_NOINTR   0x40 /* operations not interruptible */

◆ SB_RAW

#define SB_RAW   (64*1024*2) /*Aligning so->so_rcv.sb_hiwat with the receive buffer size of raw socket*/

◆ SB_SEL

#define SB_SEL   0x08 /* someone is selecting */

◆ sb_startzero

#define sb_startzero   sb_mb

◆ SB_UPCALL

#define SB_UPCALL   0x20 /* someone wants an upcall */

◆ SB_WAIT

#define SB_WAIT   0x04 /* someone is waiting for data/space */

◆ SBS_CANTRCVMORE

#define SBS_CANTRCVMORE   0x0020 /* can't receive more data from peer */

◆ SBS_CANTSENDMORE

#define SBS_CANTSENDMORE   0x0010 /* can't send more data to peer */

◆ SBS_RCVATMARK

#define SBS_RCVATMARK   0x0040 /* at mark on input */

◆ SCTP_SO_ACCEPTCONN

#define SCTP_SO_ACCEPTCONN   0x0002

◆ SCTP_SO_LINGER

#define SCTP_SO_LINGER   0x0001

◆ SOCK_COND

#define SOCK_COND (   _so)    (&(_so)->timeo_cond)

◆ SOCK_COND_DESTROY

#define SOCK_COND_DESTROY (   _so)    pthread_cond_destroy((&(_so)->timeo_cond))

◆ SOCK_COND_INIT

#define SOCK_COND_INIT (   _so)    pthread_cond_init((&(_so)->timeo_cond), NULL)

◆ SOCK_LOCK_ASSERT

#define SOCK_LOCK_ASSERT (   _so)    SOCKBUF_LOCK_ASSERT(&(_so)->so_rcv)

◆ SOCK_MAXADDRLEN

#define SOCK_MAXADDRLEN   255

◆ SOCK_MTX

#define SOCK_MTX (   _so)    SOCKBUF_MTX(&(_so)->so_rcv)

◆ SOCKBUF_COND_DESTROY

#define SOCKBUF_COND_DESTROY (   _sb)    pthread_cond_destroy((&(_sb)->sb_cond))

◆ SOCKBUF_COND_INIT

#define SOCKBUF_COND_INIT (   _sb)    pthread_cond_init((&(_sb)->sb_cond), NULL)

◆ SOCKBUF_LOCK_DESTROY

#define SOCKBUF_LOCK_DESTROY (   _sb)    pthread_mutex_destroy(SOCKBUF_MTX(_sb))

◆ SOCKBUF_LOCK_INIT

#define SOCKBUF_LOCK_INIT (   _sb,
  _name 
)    pthread_mutex_init(SOCKBUF_MTX(_sb), NULL)

◆ SOCKBUF_MTX

#define SOCKBUF_MTX (   _sb)    (&(_sb)->sb_mtx)

◆ SQ_COMP

#define SQ_COMP   0x1000 /* unaccepted, complete connection */

◆ SQ_INCOMP

#define SQ_INCOMP   0x0800 /* unaccepted, incomplete connection */

◆ SS_ASYNC

#define SS_ASYNC   0x0200 /* async i/o notify */

◆ SS_CANTRCVMORE

#define SS_CANTRCVMORE   0x020

◆ SS_CANTSENDMORE

#define SS_CANTSENDMORE   0x010

◆ SS_ISCONFIRMING

#define SS_ISCONFIRMING   0x0400 /* deciding to accept connection req */

◆ SS_ISCONNECTED

#define SS_ISCONNECTED   0x0002 /* socket connected to a peer */

◆ SS_ISCONNECTING

#define SS_ISCONNECTING   0x0004 /* in process of connecting to peer */

◆ SS_ISDISCONNECTED

#define SS_ISDISCONNECTED   0x2000 /* socket disconnected from peer */

◆ SS_ISDISCONNECTING

#define SS_ISDISCONNECTING   0x0008 /* in process of disconnecting */

◆ SS_NBIO

#define SS_NBIO   0x0100 /* non-blocking ops */

◆ SS_NOFDREF

#define SS_NOFDREF   0x0001 /* no file table ref any more */

◆ SS_PROTOREF

#define SS_PROTOREF   0x4000 /* strong protocol reference */

Enumeration Type Documentation

◆ uio_rw

Enumerator
UIO_READ 
UIO_WRITE 

◆ uio_seg

Enumerator
UIO_USERSPACE 
UIO_SYSSPACE 

Function Documentation

◆ MALLOC_DECLARE() [1/3]

MALLOC_DECLARE ( M_ACCF  )

◆ MALLOC_DECLARE() [2/3]

MALLOC_DECLARE ( M_PCB  )

◆ MALLOC_DECLARE() [3/3]

MALLOC_DECLARE ( M_SONAME  )

Variable Documentation

◆ accept_cond

userland_cond_t accept_cond

◆ accept_mtx

userland_mutex_t accept_mtx