Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
select.c File Reference
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/syscalls.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/personality.h>
#include <linux/file.h>
#include <linux/fdtable.h>
#include <linux/fs.h>
#include <linux/rcupdate.h>
#include <linux/hrtimer.h>
#include <asm/uaccess.h>

Go to the source code of this file.

Data Structures

struct  poll_table_page
 
struct  poll_list
 

Macros

#define MAX_SLACK   (100 * NSEC_PER_MSEC)
 
#define POLL_TABLE_FULL(table)   ((unsigned long)((table)->entry+1) > PAGE_SIZE + (unsigned long)(table))
 
#define FDS_IN(fds, n)   (fds->in + n)
 
#define FDS_OUT(fds, n)   (fds->out + n)
 
#define FDS_EX(fds, n)   (fds->ex + n)
 
#define BITS(fds, n)   (*FDS_IN(fds, n)|*FDS_OUT(fds, n)|*FDS_EX(fds, n))
 
#define POLLIN_SET   (POLLRDNORM | POLLRDBAND | POLLIN | POLLHUP | POLLERR)
 
#define POLLOUT_SET   (POLLWRBAND | POLLWRNORM | POLLOUT | POLLERR)
 
#define POLLEX_SET   (POLLPRI)
 
#define POLLFD_PER_PAGE   ((PAGE_SIZE-sizeof(struct poll_list)) / sizeof(struct pollfd))
 
#define N_STACK_PPS
 

Functions

long select_estimate_accuracy (struct timespec *tv)
 
void poll_initwait (struct poll_wqueues *pwq)
 
 EXPORT_SYMBOL (poll_initwait)
 
void poll_freewait (struct poll_wqueues *pwq)
 
 EXPORT_SYMBOL (poll_freewait)
 
int poll_schedule_timeout (struct poll_wqueues *pwq, int state, ktime_t *expires, unsigned long slack)
 
 EXPORT_SYMBOL (poll_schedule_timeout)
 
int poll_select_set_timeout (struct timespec *to, long sec, long nsec)
 
int do_select (int n, fd_set_bits *fds, struct timespec *end_time)
 
int core_sys_select (int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, struct timespec *end_time)
 
 SYSCALL_DEFINE5 (select, int, n, fd_set __user *, inp, fd_set __user *, outp, fd_set __user *, exp, struct timeval __user *, tvp)
 
 SYSCALL_DEFINE6 (pselect6, int, n, fd_set __user *, inp, fd_set __user *, outp, fd_set __user *, exp, struct timespec __user *, tsp, void __user *, sig)
 
int do_sys_poll (struct pollfd __user *ufds, unsigned int nfds, struct timespec *end_time)
 
 SYSCALL_DEFINE3 (poll, struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs)
 
 SYSCALL_DEFINE5 (ppoll, struct pollfd __user *, ufds, unsigned int, nfds, struct timespec __user *, tsp, const sigset_t __user *, sigmask, size_t, sigsetsize)
 

Macro Definition Documentation

#define BITS (   fds,
  n 
)    (*FDS_IN(fds, n)|*FDS_OUT(fds, n)|*FDS_EX(fds, n))

Definition at line 337 of file select.c.

#define FDS_EX (   fds,
  n 
)    (fds->ex + n)

Definition at line 335 of file select.c.

#define FDS_IN (   fds,
  n 
)    (fds->in + n)

Definition at line 333 of file select.c.

#define FDS_OUT (   fds,
  n 
)    (fds->out + n)

Definition at line 334 of file select.c.

#define MAX_SLACK   (100 * NSEC_PER_MSEC)

Definition at line 45 of file select.c.

#define N_STACK_PPS
Value:
((sizeof(stack_pps) - sizeof(struct poll_list)) / \
sizeof(struct pollfd))

Definition at line 813 of file select.c.

#define POLL_TABLE_FULL (   table)    ((unsigned long)((table)->entry+1) > PAGE_SIZE + (unsigned long)(table))

Definition at line 98 of file select.c.

#define POLLEX_SET   (POLLPRI)

Definition at line 383 of file select.c.

#define POLLFD_PER_PAGE   ((PAGE_SIZE-sizeof(struct poll_list)) / sizeof(struct pollfd))

Definition at line 710 of file select.c.

#define POLLIN_SET   (POLLRDNORM | POLLRDBAND | POLLIN | POLLHUP | POLLERR)

Definition at line 381 of file select.c.

#define POLLOUT_SET   (POLLWRBAND | POLLWRNORM | POLLOUT | POLLERR)

Definition at line 382 of file select.c.

Function Documentation

int core_sys_select ( int  n,
fd_set __user inp,
fd_set __user outp,
fd_set __user exp,
struct timespec end_time 
)

Definition at line 516 of file select.c.

int do_select ( int  n,
fd_set_bits fds,
struct timespec end_time 
)

Definition at line 395 of file select.c.

int do_sys_poll ( struct pollfd __user ufds,
unsigned int  nfds,
struct timespec end_time 
)

Definition at line 816 of file select.c.

EXPORT_SYMBOL ( poll_initwait  )
EXPORT_SYMBOL ( poll_freewait  )
EXPORT_SYMBOL ( poll_schedule_timeout  )
void poll_freewait ( struct poll_wqueues pwq)

Definition at line 133 of file select.c.

void poll_initwait ( struct poll_wqueues pwq)

Definition at line 116 of file select.c.

int poll_schedule_timeout ( struct poll_wqueues pwq,
int  state,
ktime_t expires,
unsigned long  slack 
)

Definition at line 231 of file select.c.

int poll_select_set_timeout ( struct timespec to,
long  sec,
long  nsec 
)

poll_select_set_timeout - helper function to setup the timeout value : pointer to timespec variable for the final timeout : seconds (from user space) : nanoseconds (from user space)

Note, we do not use a timespec for the user space value here, That way we can use the function for timeval and compat interfaces as well.

Returns -EINVAL if sec/nsec are not normalized. Otherwise 0.

Definition at line 269 of file select.c.

long select_estimate_accuracy ( struct timespec tv)

Definition at line 70 of file select.c.

SYSCALL_DEFINE3 ( poll  ,
struct pollfd __user ,
ufds  ,
unsigned  int,
nfds  ,
int  ,
timeout_msecs   
)

Definition at line 903 of file select.c.

SYSCALL_DEFINE5 ( select  ,
int  ,
n  ,
fd_set __user ,
inp  ,
fd_set __user ,
outp  ,
fd_set __user ,
exp  ,
struct timeval __user ,
tvp   
)

Definition at line 591 of file select.c.

SYSCALL_DEFINE5 ( ppoll  ,
struct pollfd __user ,
ufds  ,
unsigned  int,
nfds  ,
struct timespec __user ,
tsp  ,
const sigset_t __user ,
sigmask  ,
size_t  ,
sigsetsize   
)

Definition at line 937 of file select.c.

SYSCALL_DEFINE6 ( pselect6  ,
int  ,
n  ,
fd_set __user ,
inp  ,
fd_set __user ,
outp  ,
fd_set __user ,
exp  ,
struct timespec __user ,
tsp  ,
void __user ,
sig   
)

Definition at line 669 of file select.c.