Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
os.h File Reference
#include <stdarg.h>
#include <irq_user.h>
#include <longjmp.h>
#include <mm_id.h>

Go to the source code of this file.

Data Structures

struct  uml_stat
 
struct  openflags
 

Macros

#define CATCH_EINTR(expr)   while ((errno = 0, ((expr) < 0)) && (errno == EINTR))
 
#define OS_TYPE_FILE   1
 
#define OS_TYPE_DIR   2
 
#define OS_TYPE_SYMLINK   3
 
#define OS_TYPE_CHARDEV   4
 
#define OS_TYPE_BLOCKDEV   5
 
#define OS_TYPE_FIFO   6
 
#define OS_TYPE_SOCK   7
 
#define OS_ACC_F_OK   0 /* Test for existence. */
 
#define OS_ACC_X_OK   1 /* Test for execute permission. */
 
#define OS_ACC_W_OK   2 /* Test for write permission. */
 
#define OS_ACC_R_OK   4 /* Test for read permission. */
 
#define OS_ACC_RW_OK   (OS_ACC_W_OK | OS_ACC_R_OK) /* Test for RW permission */
 
#define OS_LIB_PATH   "/usr/lib/"
 
#define OPENFLAGS()
 

Functions

int os_stat_file (const char *file_name, struct uml_stat *buf)
 
int os_stat_fd (const int fd, struct uml_stat *buf)
 
int os_access (const char *file, int mode)
 
int os_set_exec_close (int fd)
 
int os_ioctl_generic (int fd, unsigned int cmd, unsigned long arg)
 
int os_get_ifname (int fd, char *namebuf)
 
int os_set_slip (int fd)
 
int os_mode_fd (int fd, int mode)
 
int os_seek_file (int fd, unsigned long long offset)
 
int os_open_file (const char *file, struct openflags flags, int mode)
 
int os_read_file (int fd, void *buf, int len)
 
int os_write_file (int fd, const void *buf, int count)
 
int os_file_size (const char *file, unsigned long long *size_out)
 
int os_file_modtime (const char *file, unsigned long *modtime)
 
int os_pipe (int *fd, int stream, int close_on_exec)
 
int os_set_fd_async (int fd)
 
int os_clear_fd_async (int fd)
 
int os_set_fd_block (int fd, int blocking)
 
int os_accept_connection (int fd)
 
int os_create_unix_socket (const char *file, int len, int close_on_exec)
 
int os_shutdown_socket (int fd, int r, int w)
 
void os_close_file (int fd)
 
int os_rcv_fd (int fd, int *helper_pid_out)
 
int create_unix_socket (char *file, int len, int close_on_exec)
 
int os_connect_socket (const char *name)
 
int os_file_type (char *file)
 
int os_file_mode (const char *file, struct openflags *mode_out)
 
int os_lock_file (int fd, int excl)
 
void os_flush_stdout (void)
 
int os_stat_filesystem (char *path, long *bsize_out, long long *blocks_out, long long *bfree_out, long long *bavail_out, long long *files_out, long long *ffree_out, void *fsid_out, int fsid_size, long *namelen_out, long *spare_out)
 
int os_change_dir (char *dir)
 
int os_fchange_dir (int fd)
 
unsigned os_major (unsigned long long dev)
 
unsigned os_minor (unsigned long long dev)
 
unsigned long long os_makedev (unsigned major, unsigned minor)
 
void os_early_checks (void)
 
void can_do_skas (void)
 
void os_check_bugs (void)
 
void check_host_supports_tls (int *supports_tls, int *tls_min)
 
int create_mem_file (unsigned long long len)
 
unsigned long os_process_pc (int pid)
 
int os_process_parent (int pid)
 
void os_stop_process (int pid)
 
void os_kill_process (int pid, int reap_child)
 
void os_kill_ptraced_process (int pid, int reap_child)
 
long os_ptrace_ldt (long pid, long addr, long data)
 
int os_getpid (void)
 
int os_getpgrp (void)
 
void init_new_thread_signals (void)
 
int os_map_memory (void *virt, int fd, unsigned long long off, unsigned long len, int r, int w, int x)
 
int os_protect_memory (void *addr, unsigned long len, int r, int w, int x)
 
int os_unmap_memory (void *addr, int len)
 
int os_drop_memory (void *addr, int length)
 
int can_drop_memory (void)
 
int execvp_noalloc (char *buf, const char *file, char *const argv[])
 
int run_helper (void(*pre_exec)(void *), void *pre_data, char **argv)
 
int run_helper_thread (int(*proc)(void *), void *arg, unsigned int flags, unsigned long *stack_out)
 
int helper_wait (int pid)
 
int umid_file_name (char *name, char *buf, int len)
 
int set_umid (char *name)
 
charget_umid (void)
 
void timer_init (void)
 
void set_sigstack (void *sig_stack, int size)
 
void remove_sigstack (void)
 
void set_handler (int sig)
 
int change_sig (int signal, int on)
 
void block_signals (void)
 
void unblock_signals (void)
 
int get_signals (void)
 
int set_signals (int enable)
 
void stack_protections (unsigned long address)
 
int raw (int fd)
 
void setup_machinename (char *machine_out)
 
void setup_hostinfo (char *buf, int len)
 
void os_dump_core (void) __attribute__((noreturn))
 
void um_early_printk (const char *s, unsigned int n)
 
void idle_sleep (unsigned long long nsecs)
 
int set_interval (void)
 
int timer_one_shot (int ticks)
 
long long disable_timer (void)
 
void uml_idle_timer (void)
 
long long os_nsecs (void)
 
long run_syscall_stub (struct mm_id *mm_idp, int syscall, unsigned long *args, long expected, void **addr, int done)
 
long syscall_stub_data (struct mm_id *mm_idp, unsigned long *data, int data_count, void **addr, void **stub_addr)
 
int map (struct mm_id *mm_idp, unsigned long virt, unsigned long len, int prot, int phys_fd, unsigned long long offset, int done, void **data)
 
int unmap (struct mm_id *mm_idp, unsigned long addr, unsigned long len, int done, void **data)
 
int protect (struct mm_id *mm_idp, unsigned long addr, unsigned long len, unsigned int prot, int done, void **data)
 
int is_skas_winch (int pid, int fd, void *data)
 
int start_userspace (unsigned long stub_stack)
 
int copy_context_skas0 (unsigned long stack, int pid)
 
void userspace (struct uml_pt_regs *regs)
 
int map_stub_pages (int fd, unsigned long code, unsigned long data, unsigned long stack)
 
void new_thread (void *stack, jmp_buf *buf, void(*handler)(void))
 
void switch_threads (jmp_buf *me, jmp_buf *you)
 
int start_idle_thread (void *stack, jmp_buf *switch_buf)
 
void initial_thread_cb_skas (void(*proc)(void *), void *arg)
 
void halt_skas (void)
 
void reboot_skas (void)
 
int os_waiting_for_events (struct irq_fd *active_fds)
 
int os_create_pollfd (int fd, int events, void *tmp_pfd, int size_tmpfds)
 
void os_free_irq_by_cb (int(*test)(struct irq_fd *, void *), void *arg, struct irq_fd *active_fds, struct irq_fd ***last_irq_ptr2)
 
void os_free_irq_later (struct irq_fd *active_fds, int irq, void *dev_id)
 
int os_get_pollfd (int i)
 
void os_set_pollfd (int i, int fd)
 
void os_set_ioignore (void)
 
int add_sigio_fd (int fd)
 
int ignore_sigio_fd (int fd)
 
void maybe_sigio_broken (int fd, int read)
 
void sigio_broken (int fd, int read)
 
int os_arch_prctl (int pid, int code, unsigned long *addr)
 
int get_pty (void)
 
unsigned long os_get_top_address (void)
 

Macro Definition Documentation

#define CATCH_EINTR (   expr)    while ((errno = 0, ((expr) < 0)) && (errno == EINTR))

Definition at line 14 of file os.h.

#define OPENFLAGS ( )
Value:
((struct openflags) { .r = 0, .w = 0, .s = 0, .c = 0, \
.t = 0, .a = 0, .e = 0, .cl = 0 })

Definition at line 67 of file os.h.

#define OS_ACC_F_OK   0 /* Test for existence. */

Definition at line 25 of file os.h.

#define OS_ACC_R_OK   4 /* Test for read permission. */

Definition at line 28 of file os.h.

#define OS_ACC_RW_OK   (OS_ACC_W_OK | OS_ACC_R_OK) /* Test for RW permission */

Definition at line 29 of file os.h.

#define OS_ACC_W_OK   2 /* Test for write permission. */

Definition at line 27 of file os.h.

#define OS_ACC_X_OK   1 /* Test for execute permission. */

Definition at line 26 of file os.h.

#define OS_LIB_PATH   "/usr/lib/"

Definition at line 34 of file os.h.

#define OS_TYPE_BLOCKDEV   5

Definition at line 20 of file os.h.

#define OS_TYPE_CHARDEV   4

Definition at line 19 of file os.h.

#define OS_TYPE_DIR   2

Definition at line 17 of file os.h.

#define OS_TYPE_FIFO   6

Definition at line 21 of file os.h.

#define OS_TYPE_FILE   1

Definition at line 16 of file os.h.

#define OS_TYPE_SOCK   7

Definition at line 22 of file os.h.

#define OS_TYPE_SYMLINK   3

Definition at line 18 of file os.h.

Function Documentation

int add_sigio_fd ( int  fd)

Definition at line 167 of file sigio.c.

void block_signals ( void  )

Definition at line 222 of file signal.c.

void can_do_skas ( void  )

Definition at line 480 of file start_up.c.

int can_drop_memory ( void  )

Definition at line 198 of file process.c.

int change_sig ( int  signal,
int  on 
)

Definition at line 210 of file signal.c.

void check_host_supports_tls ( int supports_tls,
int tls_min 
)

Definition at line 21 of file tls.c.

int copy_context_skas0 ( unsigned long  stack,
int  pid 
)

Definition at line 488 of file process.c.

int create_mem_file ( unsigned long long  len)

Definition at line 243 of file mem.c.

int create_unix_socket ( char file,
int  len,
int  close_on_exec 
)
long long disable_timer ( void  )

Definition at line 58 of file time.c.

int execvp_noalloc ( char buf,
const char file,
char *const  argv[] 
)

Definition at line 39 of file execvp.c.

int get_pty ( void  )

Definition at line 27 of file tty.c.

int get_signals ( void  )

Definition at line 289 of file signal.c.

char* get_umid ( void  )

Definition at line 346 of file umid.c.

void halt_skas ( void  )

Definition at line 717 of file process.c.

int helper_wait ( int  pid)

Definition at line 148 of file helper.c.

void idle_sleep ( unsigned long long  nsecs)

Definition at line 167 of file time.c.

int ignore_sigio_fd ( int  fd)

Definition at line 202 of file sigio.c.

void init_new_thread_signals ( void  )

Definition at line 235 of file process.c.

void initial_thread_cb_skas ( void(*)(void *)  proc,
void arg 
)

Definition at line 699 of file process.c.

int is_skas_winch ( int  pid,
int  fd,
void data 
)

Definition at line 26 of file process.c.

int map ( struct mm_id mm_idp,
unsigned long  virt,
unsigned long  len,
int  prot,
int  phys_fd,
unsigned long long  offset,
int  done,
void **  data 
)

Definition at line 177 of file mem.c.

int map_stub_pages ( int  fd,
unsigned long  code,
unsigned long  data,
unsigned long  stack 
)

Definition at line 579 of file process.c.

void maybe_sigio_broken ( int  fd,
int  read 
)

Definition at line 365 of file sigio.c.

void new_thread ( void stack,
jmp_buf buf,
void(*)(void handler 
)

Definition at line 635 of file process.c.

int os_accept_connection ( int  fd)

Definition at line 423 of file file.c.

int os_access ( const char file,
int  mode 
)

Definition at line 64 of file file.c.

int os_arch_prctl ( int  pid,
int  code,
unsigned long addr 
)

Definition at line 9 of file prctl.c.

int os_change_dir ( char dir)
void os_check_bugs ( void  )

Definition at line 543 of file sigio.c.

int os_clear_fd_async ( int  fd)

Definition at line 390 of file file.c.

void os_close_file ( int  fd)

Definition at line 236 of file file.c.

int os_connect_socket ( const char name)

Definition at line 208 of file file.c.

int os_create_pollfd ( int  fd,
int  events,
void tmp_pfd,
int  size_tmpfds 
)

Definition at line 52 of file irq.c.

int os_create_unix_socket ( const char file,
int  len,
int  close_on_exec 
)

Definition at line 504 of file file.c.

int os_drop_memory ( void addr,
int  length 
)

Definition at line 188 of file process.c.

void os_dump_core ( void  )

Definition at line 97 of file util.c.

void os_early_checks ( void  )

Definition at line 357 of file start_up.c.

int os_fchange_dir ( int  fd)
int os_file_mode ( const char file,
struct openflags mode_out 
)

Definition at line 151 of file file.c.

int os_file_modtime ( const char file,
unsigned long modtime 
)

Definition at line 307 of file file.c.

int os_file_size ( const char file,
unsigned long long size_out 
)

Definition at line 269 of file file.c.

int os_file_type ( char file)

Definition at line 127 of file file.c.

void os_flush_stdout ( void  )

Definition at line 531 of file file.c.

void os_free_irq_by_cb ( int(*)(struct irq_fd *, void *)  test,
void arg,
struct irq_fd active_fds,
struct irq_fd ***  last_irq_ptr2 
)

Definition at line 79 of file irq.c.

void os_free_irq_later ( struct irq_fd active_fds,
int  irq,
void dev_id 
)
int os_get_ifname ( int  fd,
char namebuf 
)

Definition at line 93 of file file.c.

int os_get_pollfd ( int  i)

Definition at line 122 of file irq.c.

unsigned long os_get_top_address ( void  )

Definition at line 144 of file task_size.c.

int os_getpgrp ( void  )

Definition at line 142 of file process.c.

int os_getpid ( void  )

Definition at line 137 of file process.c.

int os_ioctl_generic ( int  fd,
unsigned int  cmd,
unsigned long  arg 
)

Definition at line 81 of file file.c.

void os_kill_process ( int  pid,
int  reap_child 
)

Definition at line 97 of file process.c.

void os_kill_ptraced_process ( int  pid,
int  reap_child 
)

Definition at line 124 of file process.c.

int os_lock_file ( int  fd,
int  excl 
)

Definition at line 536 of file file.c.

unsigned os_major ( unsigned long long  dev)

Definition at line 563 of file file.c.

unsigned long long os_makedev ( unsigned  major,
unsigned  minor 
)

Definition at line 573 of file file.c.

int os_map_memory ( void virt,
int  fd,
unsigned long long  off,
unsigned long  len,
int  r,
int  w,
int  x 
)

Definition at line 147 of file process.c.

unsigned os_minor ( unsigned long long  dev)

Definition at line 568 of file file.c.

int os_mode_fd ( int  fd,
int  mode 
)

Definition at line 116 of file file.c.

long long os_nsecs ( void  )

Definition at line 74 of file time.c.

int os_open_file ( const char file,
struct openflags  flags,
int  mode 
)

Definition at line 172 of file file.c.

int os_pipe ( int fd,
int  stream,
int  close_on_exec 
)

Definition at line 334 of file file.c.

int os_process_parent ( int  pid)

Definition at line 58 of file process.c.

unsigned long os_process_pc ( int  pid)

Definition at line 26 of file process.c.

int os_protect_memory ( void addr,
unsigned long  len,
int  r,
int  w,
int  x 
)

Definition at line 163 of file process.c.

long os_ptrace_ldt ( long  pid,
long  addr,
long  data 
)

Definition at line 108 of file process.c.

int os_rcv_fd ( int  fd,
int helper_pid_out 
)

Definition at line 464 of file file.c.

int os_read_file ( int  fd,
void buf,
int  len 
)

Definition at line 251 of file file.c.

int os_seek_file ( int  fd,
unsigned long long  offset 
)

Definition at line 241 of file file.c.

int os_set_exec_close ( int  fd)

Definition at line 323 of file file.c.

int os_set_fd_async ( int  fd)

Definition at line 363 of file file.c.

int os_set_fd_block ( int  fd,
int  blocking 
)

Definition at line 404 of file file.c.

void os_set_ioignore ( void  )

Definition at line 132 of file irq.c.

void os_set_pollfd ( int  i,
int  fd 
)

Definition at line 127 of file irq.c.

int os_set_slip ( int  fd)

Definition at line 101 of file file.c.

int os_shutdown_socket ( int  fd,
int  r,
int  w 
)

Definition at line 445 of file file.c.

int os_stat_fd ( const int  fd,
struct uml_stat buf 
)

Definition at line 36 of file file.c.

int os_stat_file ( const char file_name,
struct uml_stat buf 
)

Definition at line 50 of file file.c.

int os_stat_filesystem ( char path,
long bsize_out,
long long blocks_out,
long long bfree_out,
long long bavail_out,
long long files_out,
long long ffree_out,
void fsid_out,
int  fsid_size,
long namelen_out,
long spare_out 
)
void os_stop_process ( int  pid)

Definition at line 92 of file process.c.

int os_unmap_memory ( void addr,
int  len 
)

Definition at line 174 of file process.c.

int os_waiting_for_events ( struct irq_fd active_fds)

Definition at line 23 of file irq.c.

int os_write_file ( int  fd,
const void buf,
int  count 
)

Definition at line 260 of file file.c.

int protect ( struct mm_id mm_idp,
unsigned long  addr,
unsigned long  len,
unsigned int  prot,
int  done,
void **  data 
)

Definition at line 251 of file mem.c.

int raw ( int  fd)

Definition at line 25 of file util.c.

void reboot_skas ( void  )

Definition at line 723 of file process.c.

void remove_sigstack ( void  )
int run_helper ( void(*)(void *)  pre_exec,
void pre_data,
char **  argv 
)

Definition at line 42 of file helper.c.

int run_helper_thread ( int(*)(void *)  proc,
void arg,
unsigned int  flags,
unsigned long stack_out 
)

Definition at line 113 of file helper.c.

long run_syscall_stub ( struct mm_id mm_idp,
int  syscall,
unsigned long args,
long  expected,
void **  addr,
int  done 
)

Definition at line 117 of file mem.c.

void set_handler ( int  sig)

Definition at line 179 of file signal.c.

int set_interval ( void  )

Definition at line 15 of file time.c.

int set_signals ( int  enable)

Definition at line 294 of file signal.c.

void set_sigstack ( void sig_stack,
int  size 
)

Definition at line 113 of file signal.c.

int set_umid ( char name)

Definition at line 233 of file umid.c.

void setup_hostinfo ( char buf,
int  len 
)

Definition at line 68 of file util.c.

void setup_machinename ( char machine_out)

Definition at line 47 of file util.c.

void sigio_broken ( int  fd,
int  read 
)

Definition at line 339 of file sigio.c.

void stack_protections ( unsigned long  address)

Definition at line 18 of file util.c.

int start_idle_thread ( void stack,
jmp_buf switch_buf 
)

Definition at line 660 of file process.c.

int start_userspace ( unsigned long  stub_stack)

Definition at line 271 of file process.c.

void switch_threads ( jmp_buf me,
jmp_buf you 
)

Definition at line 647 of file process.c.

long syscall_stub_data ( struct mm_id mm_idp,
unsigned long data,
int  data_count,
void **  addr,
void **  stub_addr 
)

Definition at line 145 of file mem.c.

void timer_init ( void  )

Definition at line 108 of file signal.c.

int timer_one_shot ( int  ticks)

Definition at line 27 of file time.c.

void um_early_printk ( const char s,
unsigned int  n 
)

Definition at line 141 of file util.c.

int umid_file_name ( char name,
char buf,
int  len 
)

Definition at line 329 of file umid.c.

void uml_idle_timer ( void  )
void unblock_signals ( void  )

Definition at line 234 of file signal.c.

int unmap ( struct mm_id mm_idp,
unsigned long  addr,
unsigned long  len,
int  done,
void **  data 
)

Definition at line 217 of file mem.c.

void userspace ( struct uml_pt_regs regs)

Definition at line 342 of file process.c.