GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Macros | Functions
syscalls.cc File Reference
#include <cstdio>
#include <cstring>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include "cmd-hist.h"
#include "file-ops.h"
#include "file-stat.h"
#include "oct-env.h"
#include "oct-syscalls.h"
#include "oct-uname.h"
#include "defun.h"
#include "error.h"
#include "gripes.h"
#include "lo-utils.h"
#include "oct-hist.h"
#include "oct-map.h"
#include "oct-obj.h"
#include "oct-stdstrm.h"
#include "oct-stream.h"
#include "sysdep.h"
#include "utils.h"
#include "variables.h"
#include "input.h"
Include dependency graph for syscalls.cc:

Go to the source code of this file.

Macros

#define WCONTINUE   0
#define WNOHANG   0
#define WUNTRACED   0

Functions

static octave_value const_value (const octave_value_list &args, int val)
OCTAVE_EXPORT octave_value_list Fcanonicalize_file_name (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fdup2 (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fexec (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FF_DUPFD (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FF_GETFD (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FF_GETFL (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FF_SETFD (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FF_SETFL (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Ffcntl (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Ffork (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fgetegid (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fgeteuid (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fgetgid (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fgethostname (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fgetpgrp (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fgetpid (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fgetppid (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fgetuid (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fkill (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Flstat (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fmkfifo (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_APPEND (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_ASYNC (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_CREAT (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_EXCL (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_NONBLOCK (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_RDONLY (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_RDWR (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_SYNC (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_TRUNC (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_WRONLY (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fpipe (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fpopen2 (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FS_ISBLK (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FS_ISCHR (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FS_ISDIR (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FS_ISFIFO (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FS_ISLNK (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FS_ISREG (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FS_ISSOCK (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fstat (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Funame (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Funlink (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fwaitpid (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWCONTINUE (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWCOREDUMP (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWEXITSTATUS (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWIFCONTINUED (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWIFEXITED (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWIFSIGNALED (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWIFSTOPPED (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWNOHANG (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWSTOPSIG (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWTERMSIG (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWUNTRACED (const octave_value_list &args, int)
static octave_scalar_map mk_stat_map (const base_file_stat &fs)
static octave_value_list mk_stat_result (const base_file_stat &fs)

Macro Definition Documentation

#define WCONTINUE   0

Definition at line 1947 of file syscalls.cc.

Referenced by FWCONTINUE().

#define WNOHANG   0

Definition at line 1914 of file syscalls.cc.

Referenced by FWNOHANG(), and octave_child_list::octave_child_list_rep::wait().

#define WUNTRACED   0

Definition at line 1930 of file syscalls.cc.

Referenced by FWUNTRACED().

Function Documentation

static octave_value const_value ( const octave_value_list args,
int  val 
)
static
OCTAVE_EXPORT octave_value_list Fcanonicalize_file_name ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list Fdup2 ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list Fexec ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FF_DUPFD ( const octave_value_list args,
int   
)

Definition at line 1671 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FF_GETFD ( const octave_value_list args,
int   
)

Definition at line 1687 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FF_GETFL ( const octave_value_list args,
int   
)

Definition at line 1703 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FF_SETFD ( const octave_value_list args,
int   
)

Definition at line 1719 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FF_SETFL ( const octave_value_list args,
int   
)

Definition at line 1735 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list Ffcntl ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list Ffork ( const octave_value_list args,
int   
)

Definition at line 569 of file syscalls.cc.

References octave_syscalls::fork(), octave_value_list::length(), and print_usage().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list Fgetegid ( const octave_value_list args,
int   
)

Definition at line 659 of file syscalls.cc.

References octave_syscalls::getegid(), octave_value::length(), and print_usage().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list Fgeteuid ( const octave_value_list args,
int   
)

Definition at line 695 of file syscalls.cc.

References octave_syscalls::geteuid(), octave_value::length(), and print_usage().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list Fgetgid ( const octave_value_list args,
int   
)

Definition at line 677 of file syscalls.cc.

References octave_syscalls::getgid(), octave_value::length(), and print_usage().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list Fgethostname ( const octave_value_list args,
int   
)

Definition at line 1234 of file syscalls.cc.

References octave_env::get_host_name(), and print_usage().

OCTAVE_EXPORT octave_value_list Fgetpgrp ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list Fgetpid ( const octave_value_list args,
int   
)

Definition at line 623 of file syscalls.cc.

References octave_syscalls::getpid(), octave_value::length(), and print_usage().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list Fgetppid ( const octave_value_list args,
int   
)

Definition at line 641 of file syscalls.cc.

References octave_syscalls::getppid(), octave_value::length(), and print_usage().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list Fgetuid ( const octave_value_list args,
int   
)

Definition at line 713 of file syscalls.cc.

References octave_syscalls::getuid(), octave_value::length(), and print_usage().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list Fkill ( const octave_value_list args,
int   
)

Definition at line 747 of file syscalls.cc.

References error_state, octave_syscalls::kill(), and print_usage().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list Flstat ( const octave_value_list args,
int   
)

Definition at line 788 of file syscalls.cc.

References error_state, mk_stat_result(), and print_usage().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list Fmkfifo ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FO_APPEND ( const octave_value_list args,
int   
)

Definition at line 1752 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FO_ASYNC ( const octave_value_list args,
int   
)

Definition at line 1768 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FO_CREAT ( const octave_value_list args,
int   
)

Definition at line 1785 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FO_EXCL ( const octave_value_list args,
int   
)

Definition at line 1801 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FO_NONBLOCK ( const octave_value_list args,
int   
)

Definition at line 1818 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FO_RDONLY ( const octave_value_list args,
int   
)

Definition at line 1835 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FO_RDWR ( const octave_value_list args,
int   
)

Definition at line 1852 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FO_SYNC ( const octave_value_list args,
int   
)

Definition at line 1869 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FO_TRUNC ( const octave_value_list args,
int   
)

Definition at line 1886 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FO_WRONLY ( const octave_value_list args,
int   
)

Definition at line 1903 of file syscalls.cc.

References const_value(), error(), and octave_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list Fpipe ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list Fpopen2 ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FS_ISBLK ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FS_ISCHR ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FS_ISDIR ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FS_ISFIFO ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FS_ISLNK ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FS_ISREG ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FS_ISSOCK ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list Fstat ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list Funame ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list Funlink ( const octave_value_list args,
int   
)

Definition at line 1301 of file syscalls.cc.

References error(), octave_value_list::length(), octave_unlink(), and print_usage().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list Fwaitpid ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FWCONTINUE ( const octave_value_list args,
int   
)

Definition at line 1958 of file syscalls.cc.

References const_value(), and WCONTINUE.

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FWCOREDUMP ( const octave_value_list args,
int   
)

Definition at line 1524 of file syscalls.cc.

References octave_wait::coredump(), error(), error_state, and octave_value::int_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FWEXITSTATUS ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FWIFCONTINUED ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FWIFEXITED ( const octave_value_list args,
int   
)

Definition at line 1427 of file syscalls.cc.

References error(), error_state, octave_wait::ifexited(), and octave_value::int_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FWIFSIGNALED ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list FWIFSTOPPED ( const octave_value_list args,
int   
)

Definition at line 1549 of file syscalls.cc.

References error(), error_state, octave_wait::ifstopped(), and octave_value::int_value().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FWNOHANG ( const octave_value_list args,
int   
)

Definition at line 1924 of file syscalls.cc.

References const_value(), and WNOHANG.

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FWSTOPSIG ( const octave_value_list args,
int   
)

Definition at line 1573 of file syscalls.cc.

References error(), error_state, octave_value::int_value(), and octave_wait::stopsig().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FWTERMSIG ( const octave_value_list args,
int   
)

Definition at line 1498 of file syscalls.cc.

References error(), error_state, octave_value::int_value(), and octave_wait::termsig().

Referenced by install_syscalls_fcns().

OCTAVE_EXPORT octave_value_list FWUNTRACED ( const octave_value_list args,
int   
)

Definition at line 1941 of file syscalls.cc.

References const_value(), and WUNTRACED.

Referenced by install_syscalls_fcns().

static octave_scalar_map mk_stat_map ( const base_file_stat fs)
static
static octave_value_list mk_stat_result ( const base_file_stat fs)
static

Definition at line 92 of file syscalls.cc.

References base_file_stat::error(), mk_stat_map(), and octave_value().

Referenced by Flstat(), and Fstat().