GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
syscalls.cc File Reference
#include <cstdio>
#include <cstring>
#include "cmd-hist.h"
#include "fcntl-wrappers.h"
#include "file-ops.h"
#include "file-stat.h"
#include "lo-utils.h"
#include "oct-env.h"
#include "oct-syscalls.h"
#include "oct-uname.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "event-manager.h"
#include "input.h"
#include "interpreter.h"
#include "oct-hist.h"
#include "oct-map.h"
#include "oct-stdstrm.h"
#include "oct-stream.h"
#include "ovl.h"
#include "sysdep.h"
#include "utils.h"
#include "variables.h"
Include dependency graph for syscalls.cc:

Go to the source code of this file.

Functions

static octave_value const_value (const octave_value_list &args, int val)
 
static int convert (int x, int ibase, int obase)
 
OCTAVE_EXPORT octave_value_list Fcanonicalize_file_name (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fdup2 (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fexec (octave::interpreter &interp, 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 (octave::interpreter &interp, const octave_value_list &args, int nargout)
 
OCTAVE_EXPORT octave_value_list Ffork (octave::interpreter &interp, 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 nargout)
 
OCTAVE_EXPORT octave_value_list Flstat (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fmkfifo (const octave_value_list &args, int nargout)
 
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 (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fpopen2 (octave::interpreter &interp, 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 (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Funame (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Funlink (octave::interpreter &interp, const octave_value_list &args, int nargout)
 
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 sys::base_file_stat &fs)
 
static octave_value_list mk_stat_result (const sys::base_file_stat &fs)
 

Function Documentation

◆ const_value()

◆ convert()

static int convert ( int  x,
int  ibase,
int  obase 
)
static

Definition at line 685 of file syscalls.cc.

References error(), and x.

Referenced by Fmkfifo().

◆ Fcanonicalize_file_name()

OCTAVE_EXPORT octave_value_list Fcanonicalize_file_name ( const octave_value_list args,
int   
)

Definition at line 1408 of file syscalls.cc.

References canonicalize_file_name(), ovl(), and print_usage().

◆ Fdup2()

OCTAVE_EXPORT octave_value_list Fdup2 ( octave::interpreter &  interp,
const octave_value_list args,
int   
)

Definition at line 122 of file syscalls.cc.

References dup2(), stream::file_number(), stream_list::lookup(), ovl(), and print_usage().

◆ Fexec()

◆ FF_DUPFD()

OCTAVE_EXPORT octave_value_list FF_DUPFD ( const octave_value_list args,
int   
)

Definition at line 1437 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_f_dupfd_wrapper().

◆ FF_GETFD()

OCTAVE_EXPORT octave_value_list FF_GETFD ( const octave_value_list args,
int   
)

Definition at line 1453 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_f_getfd_wrapper().

◆ FF_GETFL()

OCTAVE_EXPORT octave_value_list FF_GETFL ( const octave_value_list args,
int   
)

Definition at line 1469 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_f_getfl_wrapper().

◆ FF_SETFD()

OCTAVE_EXPORT octave_value_list FF_SETFD ( const octave_value_list args,
int   
)

Definition at line 1485 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_f_setfd_wrapper().

◆ FF_SETFL()

OCTAVE_EXPORT octave_value_list FF_SETFL ( const octave_value_list args,
int   
)

Definition at line 1501 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_f_setfl_wrapper().

◆ Ffcntl()

OCTAVE_EXPORT octave_value_list Ffcntl ( octave::interpreter &  interp,
const octave_value_list args,
int  nargout 
)

◆ Ffork()

OCTAVE_EXPORT octave_value_list Ffork ( octave::interpreter &  interp,
const octave_value_list args,
int   
)

Definition at line 499 of file syscalls.cc.

References error(), fork(), ovl(), and print_usage().

◆ Fgetegid()

OCTAVE_EXPORT octave_value_list Fgetegid ( const octave_value_list args,
int   
)

Definition at line 561 of file syscalls.cc.

References getegid(), ovl(), and print_usage().

◆ Fgeteuid()

OCTAVE_EXPORT octave_value_list Fgeteuid ( const octave_value_list args,
int   
)

Definition at line 587 of file syscalls.cc.

References geteuid(), ovl(), and print_usage().

◆ Fgetgid()

OCTAVE_EXPORT octave_value_list Fgetgid ( const octave_value_list args,
int   
)

Definition at line 574 of file syscalls.cc.

References getgid(), ovl(), and print_usage().

◆ Fgethostname()

OCTAVE_EXPORT octave_value_list Fgethostname ( const octave_value_list args,
int   
)

Definition at line 1061 of file syscalls.cc.

References ovl(), and print_usage().

◆ Fgetpgrp()

OCTAVE_EXPORT octave_value_list Fgetpgrp ( const octave_value_list args,
int   
)

Definition at line 518 of file syscalls.cc.

References getpgrp(), ovl(), and print_usage().

◆ Fgetpid()

OCTAVE_EXPORT octave_value_list Fgetpid ( const octave_value_list args,
int   
)

Definition at line 535 of file syscalls.cc.

References getpid(), ovl(), and print_usage().

◆ Fgetppid()

OCTAVE_EXPORT octave_value_list Fgetppid ( const octave_value_list args,
int   
)

Definition at line 548 of file syscalls.cc.

References getppid(), ovl(), and print_usage().

◆ Fgetuid()

OCTAVE_EXPORT octave_value_list Fgetuid ( const octave_value_list args,
int   
)

Definition at line 600 of file syscalls.cc.

References getuid(), ovl(), and print_usage().

◆ Fkill()

OCTAVE_EXPORT octave_value_list Fkill ( const octave_value_list args,
int  nargout 
)

Definition at line 631 of file syscalls.cc.

References error(), kill(), ovl(), and print_usage().

◆ Flstat()

OCTAVE_EXPORT octave_value_list Flstat ( const octave_value_list args,
int   
)

Definition at line 670 of file syscalls.cc.

References mk_stat_result(), and print_usage().

◆ Fmkfifo()

OCTAVE_EXPORT octave_value_list Fmkfifo ( const octave_value_list args,
int  nargout 
)

Definition at line 723 of file syscalls.cc.

References convert(), error(), mkfifo(), ovl(), and print_usage().

◆ FO_APPEND()

OCTAVE_EXPORT octave_value_list FO_APPEND ( const octave_value_list args,
int   
)

Definition at line 1521 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_o_append_wrapper().

◆ FO_ASYNC()

OCTAVE_EXPORT octave_value_list FO_ASYNC ( const octave_value_list args,
int   
)

Definition at line 1540 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_o_async_wrapper().

◆ FO_CREAT()

OCTAVE_EXPORT octave_value_list FO_CREAT ( const octave_value_list args,
int   
)

Definition at line 1560 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_o_creat_wrapper().

◆ FO_EXCL()

OCTAVE_EXPORT octave_value_list FO_EXCL ( const octave_value_list args,
int   
)

Definition at line 1579 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_o_excl_wrapper().

◆ FO_NONBLOCK()

OCTAVE_EXPORT octave_value_list FO_NONBLOCK ( const octave_value_list args,
int   
)

Definition at line 1599 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_o_nonblock_wrapper().

◆ FO_RDONLY()

OCTAVE_EXPORT octave_value_list FO_RDONLY ( const octave_value_list args,
int   
)

Definition at line 1618 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_o_rdonly_wrapper().

◆ FO_RDWR()

OCTAVE_EXPORT octave_value_list FO_RDWR ( const octave_value_list args,
int   
)

Definition at line 1638 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_o_rdwr_wrapper().

◆ FO_SYNC()

OCTAVE_EXPORT octave_value_list FO_SYNC ( const octave_value_list args,
int   
)

Definition at line 1657 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_o_sync_wrapper().

◆ FO_TRUNC()

OCTAVE_EXPORT octave_value_list FO_TRUNC ( const octave_value_list args,
int   
)

Definition at line 1677 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_o_trunc_wrapper().

◆ FO_WRONLY()

OCTAVE_EXPORT octave_value_list FO_WRONLY ( const octave_value_list args,
int   
)

Definition at line 1696 of file syscalls.cc.

References const_value(), err_disabled_feature(), and octave_o_wronly_wrapper().

◆ Fpipe()

OCTAVE_EXPORT octave_value_list Fpipe ( octave::interpreter &  interp,
const octave_value_list args,
int   
)

Definition at line 781 of file syscalls.cc.

References stdiostream::create(), stream_list::insert(), ovl(), pipe(), and print_usage().

◆ Fpopen2()

OCTAVE_EXPORT octave_value_list Fpopen2 ( octave::interpreter &  interp,
const octave_value_list args,
int   
)

◆ FS_ISBLK()

OCTAVE_EXPORT octave_value_list FS_ISBLK ( const octave_value_list args,
int   
)

Definition at line 993 of file syscalls.cc.

References ovl(), and print_usage().

◆ FS_ISCHR()

OCTAVE_EXPORT octave_value_list FS_ISCHR ( const octave_value_list args,
int   
)

Definition at line 975 of file syscalls.cc.

References ovl(), and print_usage().

◆ FS_ISDIR()

OCTAVE_EXPORT octave_value_list FS_ISDIR ( const octave_value_list args,
int   
)

Definition at line 957 of file syscalls.cc.

References ovl(), and print_usage().

◆ FS_ISFIFO()

OCTAVE_EXPORT octave_value_list FS_ISFIFO ( const octave_value_list args,
int   
)

Definition at line 1011 of file syscalls.cc.

References ovl(), and print_usage().

◆ FS_ISLNK()

OCTAVE_EXPORT octave_value_list FS_ISLNK ( const octave_value_list args,
int   
)

Definition at line 1029 of file syscalls.cc.

References ovl(), and print_usage().

◆ FS_ISREG()

OCTAVE_EXPORT octave_value_list FS_ISREG ( const octave_value_list args,
int   
)

Definition at line 939 of file syscalls.cc.

References ovl(), and print_usage().

◆ FS_ISSOCK()

OCTAVE_EXPORT octave_value_list FS_ISSOCK ( const octave_value_list args,
int   
)

Definition at line 1047 of file syscalls.cc.

References ovl(), and print_usage().

◆ Fstat()

OCTAVE_EXPORT octave_value_list Fstat ( octave::interpreter &  interp,
const octave_value_list args,
int   
)

Definition at line 902 of file syscalls.cc.

References stream_list::get_file_number(), mk_stat_result(), and print_usage().

◆ Funame()

OCTAVE_EXPORT octave_value_list Funame ( const octave_value_list args,
int   
)

Definition at line 1092 of file syscalls.cc.

References m, ovl(), and print_usage().

◆ Funlink()

OCTAVE_EXPORT octave_value_list Funlink ( octave::interpreter &  interp,
const octave_value_list args,
int  nargout 
)

◆ Fwaitpid()

OCTAVE_EXPORT octave_value_list Fwaitpid ( const octave_value_list args,
int   
)

Definition at line 1228 of file syscalls.cc.

References ovl(), print_usage(), and waitpid().

Referenced by gnuplot_graphics_toolkit::send_quit().

◆ FWCONTINUE()

OCTAVE_EXPORT octave_value_list FWCONTINUE ( const octave_value_list args,
int   
)

Definition at line 1743 of file syscalls.cc.

References const_value(), and wcontinue().

◆ FWCOREDUMP()

OCTAVE_EXPORT octave_value_list FWCOREDUMP ( const octave_value_list args,
int   
)

Definition at line 1333 of file syscalls.cc.

References ovl(), print_usage(), and wcoredump().

◆ FWEXITSTATUS()

OCTAVE_EXPORT octave_value_list FWEXITSTATUS ( const octave_value_list args,
int   
)

Definition at line 1276 of file syscalls.cc.

References ovl(), print_usage(), and wexitstatus().

◆ FWIFCONTINUED()

OCTAVE_EXPORT octave_value_list FWIFCONTINUED ( const octave_value_list args,
int   
)

Definition at line 1389 of file syscalls.cc.

References ovl(), print_usage(), and wifcontinued().

◆ FWIFEXITED()

OCTAVE_EXPORT octave_value_list FWIFEXITED ( const octave_value_list args,
int   
)

Definition at line 1257 of file syscalls.cc.

References ovl(), print_usage(), and wifexited().

◆ FWIFSIGNALED()

OCTAVE_EXPORT octave_value_list FWIFSIGNALED ( const octave_value_list args,
int   
)

Definition at line 1293 of file syscalls.cc.

References ovl(), print_usage(), and wifsignaled().

◆ FWIFSTOPPED()

OCTAVE_EXPORT octave_value_list FWIFSTOPPED ( const octave_value_list args,
int   
)

Definition at line 1353 of file syscalls.cc.

References ovl(), print_usage(), and wifstopped().

◆ FWNOHANG()

OCTAVE_EXPORT octave_value_list FWNOHANG ( const octave_value_list args,
int   
)

Definition at line 1715 of file syscalls.cc.

References const_value(), and wnohang().

◆ FWSTOPSIG()

OCTAVE_EXPORT octave_value_list FWSTOPSIG ( const octave_value_list args,
int   
)

Definition at line 1372 of file syscalls.cc.

References ovl(), print_usage(), and wstopsig().

◆ FWTERMSIG()

OCTAVE_EXPORT octave_value_list FWTERMSIG ( const octave_value_list args,
int   
)

Definition at line 1312 of file syscalls.cc.

References ovl(), print_usage(), and wtermsig().

◆ FWUNTRACED()

OCTAVE_EXPORT octave_value_list FWUNTRACED ( const octave_value_list args,
int   
)

Definition at line 1729 of file syscalls.cc.

References const_value(), and wuntraced().

◆ mk_stat_map()

static octave_scalar_map mk_stat_map ( const sys::base_file_stat &  fs)
static

Definition at line 65 of file syscalls.cc.

References m, and NaN.

Referenced by mk_stat_result().

◆ mk_stat_result()

static octave_value_list mk_stat_result ( const sys::base_file_stat &  fs)
static

Definition at line 105 of file syscalls.cc.

References mk_stat_map(), and ovl().

Referenced by Flstat(), and Fstat().