FreeBSD kernel kern code
sys_generic.c File Reference
#include <sys/cdefs.h>
#include "opt_capsicum.h"
#include "opt_ktrace.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
#include <sys/capsicum.h>
#include <sys/filedesc.h>
#include <sys/filio.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/lock.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/socketvar.h>
#include <sys/uio.h>
#include <sys/eventfd.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/limits.h>
#include <sys/malloc.h>
#include <sys/poll.h>
#include <sys/resourcevar.h>
#include <sys/selinfo.h>
#include <sys/sleepqueue.h>
#include <sys/specialfd.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
#include <sys/sysent.h>
#include <sys/vnode.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/condvar.h>
#include <security/audit/audit.h>
Include dependency graph for sys_generic.c:

Go to the source code of this file.

Data Structures

struct  seltd
 
struct  selfd
 
struct  read_args
 
struct  pread_args
 
struct  readv_args
 
struct  preadv_args
 
struct  write_args
 
struct  pwrite_args
 
struct  writev_args
 
struct  pwritev_args
 
struct  ftruncate_args
 
struct  ioctl_args
 
struct  select_args
 

Macros

#define SYS_IOCTL_SMALL_SIZE   128 /* bytes */
 
#define SYS_IOCTL_SMALL_ALIGN   8 /* bytes */
 
#define SELTD_PENDING   0x0001 /* We have pending events. */
 
#define SELTD_RESCAN   0x0002 /* Doing a rescan. */
 
#define getbits(name, x)
 
#define swizzle_fdset(bits)
 
#define putbits(name, x)
 

Functions

 __FBSDID ("$FreeBSD$")
 
 CTASSERT (sizeof(register_t) >=sizeof(size_t))
 
static MALLOC_DEFINE (M_IOCTLOPS, "ioctlops", "ioctl data buffer")
 
static MALLOC_DEFINE (M_SELECT, "select", "select() buffer")
 
 MALLOC_DEFINE (M_IOV, "iov", "large iov's")
 
static int pollout (struct thread *, struct pollfd *, struct pollfd *, u_int)
 
static int pollscan (struct thread *, struct pollfd *, u_int)
 
static int pollrescan (struct thread *)
 
static int selscan (struct thread *, fd_mask **, fd_mask **, int)
 
static int selrescan (struct thread *, fd_mask **, fd_mask **)
 
static void selfdalloc (struct thread *, void *)
 
static void selfdfree (struct seltd *, struct selfd *)
 
static int dofileread (struct thread *, int, struct file *, struct uio *, off_t, int)
 
static int dofilewrite (struct thread *, int, struct file *, struct uio *, off_t, int)
 
static void doselwakeup (struct selinfo *, int)
 
static void seltdinit (struct thread *)
 
static int seltdwait (struct thread *, sbintime_t, sbintime_t)
 
static void seltdclear (struct thread *)
 
 MALLOC_DEFINE (M_SELFD, "selfd", "selfd")
 
int sys_read (struct thread *td, struct read_args *uap)
 
int sys_pread (struct thread *td, struct pread_args *uap)
 
int kern_pread (struct thread *td, int fd, void *buf, size_t nbyte, off_t offset)
 
int sys_readv (struct thread *td, struct readv_args *uap)
 
int kern_readv (struct thread *td, int fd, struct uio *auio)
 
int sys_preadv (struct thread *td, struct preadv_args *uap)
 
int kern_preadv (struct thread *td, int fd, struct uio *auio, off_t offset)
 
int sys_write (struct thread *td, struct write_args *uap)
 
int sys_pwrite (struct thread *td, struct pwrite_args *uap)
 
int kern_pwrite (struct thread *td, int fd, const void *buf, size_t nbyte, off_t offset)
 
int sys_writev (struct thread *td, struct writev_args *uap)
 
int kern_writev (struct thread *td, int fd, struct uio *auio)
 
int sys_pwritev (struct thread *td, struct pwritev_args *uap)
 
int kern_pwritev (struct thread *td, int fd, struct uio *auio, off_t offset)
 
int kern_ftruncate (struct thread *td, int fd, off_t length)
 
int sys_ftruncate (struct thread *td, struct ftruncate_args *uap)
 
int sys_ioctl (struct thread *td, struct ioctl_args *uap)
 
int kern_ioctl (struct thread *td, int fd, u_long com, caddr_t data)
 
int sys_posix_fallocate (struct thread *td, struct posix_fallocate_args *uap)
 
int kern_posix_fallocate (struct thread *td, int fd, off_t offset, off_t len)
 
int sys_fspacectl (struct thread *td, struct fspacectl_args *uap)
 
int kern_fspacectl (struct thread *td, int fd, int cmd, const struct spacectl_range *rqsr, int flags, struct spacectl_range *rmsrp)
 
int kern_specialfd (struct thread *td, int type, void *arg)
 
int sys___specialfd (struct thread *td, struct __specialfd_args *args)
 
int poll_no_poll (int events)
 
int sys_pselect (struct thread *td, struct pselect_args *uap)
 
int kern_pselect (struct thread *td, int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tvp, sigset_t *uset, int abi_nfdbits)
 
int sys_select (struct thread *td, struct select_args *uap)
 
static int select_check_badfd (fd_set *fd_in, int nd, int ndu, int abi_nfdbits)
 
int kern_select (struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, fd_set *fd_ex, struct timeval *tvp, int abi_nfdbits)
 
static __inline int selflags (fd_mask **ibits, int idx, fd_mask bit)
 
static __inline int selsetbits (fd_mask **ibits, fd_mask **obits, int idx, fd_mask bit, int events)
 
int sys_poll (struct thread *td, struct poll_args *uap)
 
int kern_poll_kfds (struct thread *td, struct pollfd *kfds, u_int nfds, struct timespec *tsp, sigset_t *uset)
 
int sys_ppoll (struct thread *td, struct ppoll_args *uap)
 
int kern_poll (struct thread *td, struct pollfd *ufds, u_int nfds, struct timespec *tsp, sigset_t *set)
 
bool kern_poll_maxfds (u_int nfds)
 
int selsocket (struct socket *so, int events, struct timeval *tvp, struct thread *td)
 
void seldrain (struct selinfo *sip)
 
void selrecord (struct thread *selector, struct selinfo *sip)
 
void selwakeup (struct selinfo *sip)
 
void selwakeuppri (struct selinfo *sip, int pri)
 
void seltdfini (struct thread *td)
 
static void selectinit (void *)
 
 SYSINIT (select, SI_SUB_SYSCALLS, SI_ORDER_ANY, selectinit, NULL)
 
static void selectinit (void *dummy __unused)
 
int kern_posix_error (struct thread *td, int error)
 

Variables

static struct mtx_poolmtxpool_select
 
static const int select_flags [3]
 

Macro Definition Documentation

◆ getbits

#define getbits (   name,
 
)
Value:
do { \
if (name == NULL) { \
ibits[x] = NULL; \
obits[x] = NULL; \
} else { \
ibits[x] = sbp + nbufbytes / 2 / sizeof *sbp; \
obits[x] = sbp; \
sbp += ncpbytes / sizeof *sbp; \
error = copyin(name, ibits[x], ncpubytes); \
if (error != 0) \
goto done; \
if (ncpbytes != ncpubytes) \
bzero((char *)ibits[x] + ncpubytes, \
ncpbytes - ncpubytes); \
} \
} while (0)
const char * name
Definition: kern_fail.c:145

◆ putbits

#define putbits (   name,
 
)
Value:
if (name && (error2 = copyout(obits[x], name, ncpubytes))) \
error = error2;

◆ SELTD_PENDING

#define SELTD_PENDING   0x0001 /* We have pending events. */

Definition at line 147 of file sys_generic.c.

◆ SELTD_RESCAN

#define SELTD_RESCAN   0x0002 /* Doing a rescan. */

Definition at line 148 of file sys_generic.c.

◆ swizzle_fdset

#define swizzle_fdset (   bits)

◆ SYS_IOCTL_SMALL_ALIGN

#define SYS_IOCTL_SMALL_ALIGN   8 /* bytes */

Definition at line 93 of file sys_generic.c.

◆ SYS_IOCTL_SMALL_SIZE

#define SYS_IOCTL_SMALL_SIZE   128 /* bytes */

Definition at line 92 of file sys_generic.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ CTASSERT()

CTASSERT ( sizeof(register_t) >=sizeof(size_t)  )

◆ dofileread()

static int dofileread ( struct thread *  td,
int  fd,
struct file *  fp,
struct uio *  auio,
off_t  offset,
int  flags 
)
static

Definition at line 345 of file sys_generic.c.

References cloneuio(), fd, and flags.

Referenced by kern_preadv(), and kern_readv().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dofilewrite()

static int dofilewrite ( struct thread *  td,
int  fd,
struct file *  fp,
struct uio *  auio,
off_t  offset,
int  flags 
)
static

Definition at line 547 of file sys_generic.c.

References cloneuio(), fd, flags, and tdsignal().

Referenced by kern_pwritev(), and kern_writev().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doselwakeup()

static void doselwakeup ( struct selinfo *  sip,
int  pri 
)
static

Definition at line 1933 of file sys_generic.c.

References cv_broadcastpri(), and SELTD_PENDING.

Referenced by seldrain(), selwakeup(), and selwakeuppri().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_fspacectl()

int kern_fspacectl ( struct thread *  td,
int  fd,
int  cmd,
const struct spacectl_range *  rqsr,
int  flags,
struct spacectl_range *  rmsrp 
)

Definition at line 885 of file sys_generic.c.

References cap_pwrite_rights, fd, fget_write(), and flags.

Referenced by sys_fspacectl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_ftruncate()

int kern_ftruncate ( struct thread *  td,
int  fd,
off_t  length 
)

Definition at line 594 of file sys_generic.c.

References cap_ftruncate_rights, fd, and fget().

Referenced by sys_ftruncate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_ioctl()

int kern_ioctl ( struct thread *  td,
int  fd,
u_long  com,
caddr_t  data 
)

Definition at line 723 of file sys_generic.c.

References cap_ioctl_rights, data, fd, and fget().

Referenced by parse_dir_md(), and sys_ioctl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_poll()

int kern_poll ( struct thread *  td,
struct pollfd *  ufds,
u_int  nfds,
struct timespec *  tsp,
sigset_t *  set 
)

Definition at line 1594 of file sys_generic.c.

References free(), kern_poll_kfds(), kern_poll_maxfds(), mallocarray(), pollout(), and set.

Referenced by sys_poll(), and sys_ppoll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_poll_kfds()

int kern_poll_kfds ( struct thread *  td,
struct pollfd *  kfds,
u_int  nfds,
struct timespec *  tsp,
sigset_t *  uset 
)

Definition at line 1494 of file sys_generic.c.

References kern_sigprocmask(), pollrescan(), pollscan(), seltdclear(), seltdinit(), seltdwait(), tc_precexp, tc_tick_sbt, and ts.

Referenced by kern_poll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_poll_maxfds()

bool kern_poll_maxfds ( u_int  nfds)

Definition at line 1622 of file sys_generic.c.

References maxfilesperproc.

Referenced by kern_poll().

Here is the caller graph for this function:

◆ kern_posix_error()

int kern_posix_error ( struct thread *  td,
int  error 
)

Definition at line 2070 of file sys_generic.c.

Referenced by sys_clock_nanosleep(), sys_posix_fadvise(), and sys_posix_fallocate().

Here is the caller graph for this function:

◆ kern_posix_fallocate()

int kern_posix_fallocate ( struct thread *  td,
int  fd,
off_t  offset,
off_t  len 
)

Definition at line 833 of file sys_generic.c.

References cap_pwrite_rights, fd, and fget().

Referenced by sys_posix_fallocate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_pread()

int kern_pread ( struct thread *  td,
int  fd,
void *  buf,
size_t  nbyte,
off_t  offset 
)

Definition at line 230 of file sys_generic.c.

References buf, fd, and kern_preadv().

Referenced by sys_pread().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_preadv()

int kern_preadv ( struct thread *  td,
int  fd,
struct uio *  auio,
off_t  offset 
)

Definition at line 321 of file sys_generic.c.

References cap_pread_rights, dofileread(), fd, and fget_read().

Referenced by kern_pread(), and sys_preadv().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_pselect()

int kern_pselect ( struct thread *  td,
int  nd,
fd_set *  in,
fd_set *  ou,
fd_set *  ex,
struct timeval *  tvp,
sigset_t *  uset,
int  abi_nfdbits 
)

Definition at line 1039 of file sys_generic.c.

References kern_select(), and kern_sigprocmask().

Referenced by sys_pselect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_pwrite()

int kern_pwrite ( struct thread *  td,
int  fd,
const void *  buf,
size_t  nbyte,
off_t  offset 
)

Definition at line 431 of file sys_generic.c.

References buf, fd, and kern_pwritev().

Referenced by sys_pwrite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_pwritev()

int kern_pwritev ( struct thread *  td,
int  fd,
struct uio *  auio,
off_t  offset 
)

Definition at line 523 of file sys_generic.c.

References cap_pwrite_rights, dofilewrite(), fd, and fget_write().

Referenced by kern_pwrite(), and sys_pwritev().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_readv()

int kern_readv ( struct thread *  td,
int  fd,
struct uio *  auio 
)

Definition at line 282 of file sys_generic.c.

References cap_read_rights, dofileread(), fd, and fget_read().

Referenced by sys_read(), and sys_readv().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_select()

int kern_select ( struct thread *  td,
int  nd,
fd_set *  fd_in,
fd_set *  fd_ou,
fd_set *  fd_ex,
struct timeval *  tvp,
int  abi_nfdbits 
)

Definition at line 1137 of file sys_generic.c.

References free(), getbits, malloc(), putbits, select_check_badfd(), selrescan(), selscan(), seltdclear(), seltdinit(), seltdwait(), swizzle_fdset, tc_precexp, and tc_tick_sbt.

Referenced by kern_pselect(), and sys_select().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_specialfd()

int kern_specialfd ( struct thread *  td,
int  type,
void *  arg 
)

Definition at line 935 of file sys_generic.c.

References eventfd_create_file(), fd, finstall(), and type.

Referenced by sys___specialfd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_writev()

int kern_writev ( struct thread *  td,
int  fd,
struct uio *  auio 
)

Definition at line 484 of file sys_generic.c.

References cap_write_rights, dofilewrite(), fd, and fget_write().

Referenced by sys_write(), sys_writev(), and vn_sendfile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MALLOC_DEFINE() [1/4]

static MALLOC_DEFINE ( M_IOCTLOPS  ,
"ioctlops"  ,
"ioctl data buffer"   
)
static

◆ MALLOC_DEFINE() [2/4]

MALLOC_DEFINE ( M_IOV  ,
"iov"  ,
"large iov's"   
)

◆ MALLOC_DEFINE() [3/4]

static MALLOC_DEFINE ( M_SELECT  ,
"select"  ,
"select() buffer"   
)
static

◆ MALLOC_DEFINE() [4/4]

MALLOC_DEFINE ( M_SELFD  ,
"selfd"  ,
"selfd"   
)

◆ poll_no_poll()

int poll_no_poll ( int  events)

Definition at line 996 of file sys_generic.c.

Referenced by invfo_poll(), and no_poll().

Here is the caller graph for this function:

◆ pollout()

static int pollout ( struct thread *  td,
struct pollfd *  fds,
struct pollfd *  ufds,
u_int  nfd 
)
static

Definition at line 1686 of file sys_generic.c.

Referenced by kern_poll().

Here is the caller graph for this function:

◆ pollrescan()

static int pollrescan ( struct thread *  td)
static

Definition at line 1636 of file sys_generic.c.

References cap_event_rights, fd, fget_only_user(), fget_unlocked(), and selfdfree().

Referenced by kern_poll_kfds().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pollscan()

static int pollscan ( struct thread *  td,
struct pollfd *  fds,
u_int  nfd 
)
static

Definition at line 1707 of file sys_generic.c.

References cap_event_rights, fget_only_user(), fget_unlocked(), and selfdalloc().

Referenced by kern_poll_kfds().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ seldrain()

void seldrain ( struct selinfo *  sip)

Definition at line 1851 of file sys_generic.c.

References doselwakeup().

Referenced by destroy_vpollinfo(), eventfd_close(), kqueue_destroy(), mqueue_free(), pipeclose(), ptsdrv_free(), sofree(), and tty_dealloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ select_check_badfd()

static int select_check_badfd ( fd_set *  fd_in,
int  nd,
int  ndu,
int  abi_nfdbits 
)
static

Definition at line 1098 of file sys_generic.c.

References addr, and res.

Referenced by kern_select().

Here is the caller graph for this function:

◆ selectinit() [1/2]

static void selectinit ( void *  )
static

◆ selectinit() [2/2]

static void selectinit ( void *dummy  __unused)
static

Definition at line 2059 of file sys_generic.c.

References mtx_pool_create(), and mtxpool_select.

Here is the call graph for this function:

◆ selfdalloc()

static void selfdalloc ( struct thread *  td,
void *  cookie 
)
static

Definition at line 1817 of file sys_generic.c.

References malloc().

Referenced by pollscan(), selscan(), and selsocket().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selfdfree()

static void selfdfree ( struct seltd stp,
struct selfd sfp 
)
static

Definition at line 1833 of file sys_generic.c.

References free().

Referenced by pollrescan(), selrescan(), and seltdclear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selflags()

static __inline int selflags ( fd_mask **  ibits,
int  idx,
fd_mask  bit 
)
static

Definition at line 1328 of file sys_generic.c.

References flags, and select_flags.

Referenced by selrescan(), and selscan().

Here is the caller graph for this function:

◆ selrecord()

void selrecord ( struct thread *  selector,
struct selinfo *  sip 
)

Definition at line 1869 of file sys_generic.c.

References mtx, mtx_pool_find(), mtxpool_select, panic(), and SELTD_RESCAN.

Referenced by devpoll(), eventfd_poll(), kqueue_poll(), logpoll(), mqf_poll(), pipe_poll(), procdesc_poll(), ptsdev_poll(), sopoll_generic(), ttydev_poll(), and vn_pollrecord().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selrescan()

static int selrescan ( struct thread *  td,
fd_mask **  ibits,
fd_mask **  obits 
)
static

Definition at line 1382 of file sys_generic.c.

References cap_event_rights, ev, fd, fget_only_user(), fget_unlocked(), selfdfree(), selflags(), and selsetbits().

Referenced by kern_select().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selscan()

static int selscan ( struct thread *  td,
fd_mask **  ibits,
fd_mask **  obits,
int  nfd 
)
static

Definition at line 1432 of file sys_generic.c.

References cap_event_rights, ev, fd, fget_only_user(), fget_unlocked(), flags, selfdalloc(), selflags(), and selsetbits().

Referenced by kern_select().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selsetbits()

static __inline int selsetbits ( fd_mask **  ibits,
fd_mask **  obits,
int  idx,
fd_mask  bit,
int  events 
)
static

Definition at line 1349 of file sys_generic.c.

References select_flags.

Referenced by selrescan(), and selscan().

Here is the caller graph for this function:

◆ selsocket()

int selsocket ( struct socket *  so,
int  events,
struct timeval *  tvp,
struct thread *  td 
)

Definition at line 1763 of file sys_generic.c.

References selfdalloc(), seltdclear(), seltdinit(), seltdwait(), sopoll(), tc_precexp, and tc_tick_sbt.

Here is the call graph for this function:

◆ seltdclear()

static void seltdclear ( struct thread *  td)
static

Definition at line 2044 of file sys_generic.c.

References selfdfree().

Referenced by kern_poll_kfds(), kern_select(), and selsocket().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ seltdfini()

void seltdfini ( struct thread *  td)

Definition at line 2020 of file sys_generic.c.

References cv_destroy(), and free().

Referenced by exit1(), and thread_dtor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ seltdinit()

static void seltdinit ( struct thread *  td)
static

Definition at line 1969 of file sys_generic.c.

References cv_init(), and malloc().

Referenced by kern_poll_kfds(), kern_select(), and selsocket().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ seltdwait()

static int seltdwait ( struct thread *  td,
sbintime_t  sbt,
sbintime_t  precision 
)
static

Definition at line 1988 of file sys_generic.c.

References SELTD_PENDING, and SELTD_RESCAN.

Referenced by kern_poll_kfds(), kern_select(), and selsocket().

Here is the caller graph for this function:

◆ selwakeup()

void selwakeup ( struct selinfo *  sip)

Definition at line 1917 of file sys_generic.c.

References doselwakeup().

Referenced by _mqueue_recv(), _mqueue_send(), devctl_queue(), eventfd_read(), eventfd_write(), mqueue_fdclose(), procdesc_exit(), ptsdrv_inwakeup(), ptsdrv_outwakeup(), and tty_wakeup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selwakeuppri()

void selwakeuppri ( struct selinfo *  sip,
int  pri 
)

Definition at line 1924 of file sys_generic.c.

References doselwakeup().

Referenced by kqueue_drain(), kqueue_wakeup(), logtimeout(), pipeselwakeup(), sohasoutofband(), solisten_wakeup(), and sowakeup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sys___specialfd()

int sys___specialfd ( struct thread *  td,
struct __specialfd_args *  args 
)

Definition at line 967 of file sys_generic.c.

References kern_specialfd().

Here is the call graph for this function:

◆ sys_fspacectl()

int sys_fspacectl ( struct thread *  td,
struct fspacectl_args *  uap 
)

Definition at line 865 of file sys_generic.c.

References kern_fspacectl().

Here is the call graph for this function:

◆ sys_ftruncate()

int sys_ftruncate ( struct thread *  td,
struct ftruncate_args uap 
)

Definition at line 623 of file sys_generic.c.

References ftruncate_args::fd, kern_ftruncate(), and ftruncate_args::length.

Here is the call graph for this function:

◆ sys_ioctl()

int sys_ioctl ( struct thread *  td,
struct ioctl_args uap 
)

Definition at line 653 of file sys_generic.c.

References __aligned, ioctl_args::com, data, ioctl_args::data, ioctl_args::fd, free(), kern_ioctl(), malloc(), printf(), SYS_IOCTL_SMALL_ALIGN, and SYS_IOCTL_SMALL_SIZE.

Here is the call graph for this function:

◆ sys_poll()

int sys_poll ( struct thread *  td,
struct poll_args *  uap 
)

Definition at line 1474 of file sys_generic.c.

References kern_poll(), and ts.

Here is the call graph for this function:

◆ sys_posix_fallocate()

int sys_posix_fallocate ( struct thread *  td,
struct posix_fallocate_args *  uap 
)

Definition at line 824 of file sys_generic.c.

References kern_posix_error(), and kern_posix_fallocate().

Here is the call graph for this function:

◆ sys_ppoll()

int sys_ppoll ( struct thread *  td,
struct ppoll_args *  uap 
)

Definition at line 1567 of file sys_generic.c.

References kern_poll(), set, and ts.

Here is the call graph for this function:

◆ sys_pread()

int sys_pread ( struct thread *  td,
struct pread_args uap 
)

Definition at line 223 of file sys_generic.c.

References pread_args::buf, pread_args::fd, kern_pread(), pread_args::nbyte, and pread_args::offset.

Here is the call graph for this function:

◆ sys_preadv()

int sys_preadv ( struct thread *  td,
struct preadv_args uap 
)

Definition at line 307 of file sys_generic.c.

References copyinuio(), preadv_args::fd, free(), preadv_args::iovcnt, preadv_args::iovp, kern_preadv(), and preadv_args::offset.

Here is the call graph for this function:

◆ sys_pselect()

int sys_pselect ( struct thread *  td,
struct pselect_args *  uap 
)

Definition at line 1012 of file sys_generic.c.

References kern_pselect(), set, and ts.

Here is the call graph for this function:

◆ sys_pwrite()

int sys_pwrite ( struct thread *  td,
struct pwrite_args uap 
)

Definition at line 424 of file sys_generic.c.

References pwrite_args::buf, pwrite_args::fd, kern_pwrite(), pwrite_args::nbyte, and pwrite_args::offset.

Here is the call graph for this function:

◆ sys_pwritev()

int sys_pwritev ( struct thread *  td,
struct pwritev_args uap 
)

Definition at line 509 of file sys_generic.c.

References copyinuio(), pwritev_args::fd, free(), pwritev_args::iovcnt, pwritev_args::iovp, kern_pwritev(), and pwritev_args::offset.

Here is the call graph for this function:

◆ sys_read()

int sys_read ( struct thread *  td,
struct read_args uap 
)

Definition at line 192 of file sys_generic.c.

References read_args::buf, read_args::fd, kern_readv(), and read_args::nbyte.

Here is the call graph for this function:

◆ sys_readv()

int sys_readv ( struct thread *  td,
struct readv_args uap 
)

Definition at line 268 of file sys_generic.c.

References copyinuio(), readv_args::fd, free(), readv_args::iovcnt, readv_args::iovp, and kern_readv().

Here is the call graph for this function:

◆ sys_select()

int sys_select ( struct thread *  td,
struct select_args uap 
)

Definition at line 1071 of file sys_generic.c.

References select_args::ex, select_args::in, kern_select(), select_args::nd, select_args::ou, and select_args::tv.

Here is the call graph for this function:

◆ sys_write()

int sys_write ( struct thread *  td,
struct write_args uap 
)

Definition at line 393 of file sys_generic.c.

References write_args::buf, write_args::fd, kern_writev(), and write_args::nbyte.

Here is the call graph for this function:

◆ sys_writev()

int sys_writev ( struct thread *  td,
struct writev_args uap 
)

Definition at line 470 of file sys_generic.c.

References copyinuio(), writev_args::fd, free(), writev_args::iovcnt, writev_args::iovp, and kern_writev().

Here is the call graph for this function:

◆ SYSINIT()

SYSINIT ( select  ,
SI_SUB_SYSCALLS  ,
SI_ORDER_ANY  ,
selectinit  ,
NULL   
)

Variable Documentation

◆ mtxpool_select

struct mtx_pool* mtxpool_select
static

Definition at line 164 of file sys_generic.c.

Referenced by selectinit(), and selrecord().

◆ select_flags

const int select_flags[3]
static
Initial value:
= {
POLLRDNORM | POLLHUP | POLLERR,
POLLWRNORM | POLLHUP | POLLERR,
POLLRDBAND | POLLERR
}

Definition at line 1317 of file sys_generic.c.

Referenced by selflags(), and selsetbits().