36 #include <sys/types.h>
67 m.
assign (
"dev", static_cast<double> (fs.
dev ()));
74 #if defined (HAVE_STRUCT_STAT_ST_RDEV)
75 m.
assign (
"rdev", static_cast<double> (fs.
rdev ()));
81 #if defined (HAVE_STRUCT_STAT_ST_BLKSIZE)
84 #if defined (HAVE_STRUCT_STAT_ST_BLOCKS)
98 retval(2) = std::string ();
104 retval(2) = fs.
error ();
114 @deftypefn {Built-in Function} {[@var{fid}, @var{msg}] =} dup2 (@var{old}, @var{new})\n\
115 Duplicate a file descriptor.\n\
117 If successful, @var{fid} is greater than zero and contains the new file ID@.\n\
118 Otherwise, @var{fid} is negative and @var{msg} contains a system-dependent\n\
120 @seealso{fopen, fclose, fcntl}\n\
125 retval(1) = std::string ();
128 int nargin = args.
length ();
145 if (i_old >= 0 && i_new >= 0)
157 error (
"dup2: invalid stream");
167 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} exec (@var{file}, @var{args})\n\
168 Replace current process with a new process.\n\
170 Calling @code{exec} without first calling @code{fork} will terminate your\n\
171 current Octave process and replace it with the program named by @var{file}.\n\
175 exec (\"ls\" \"-l\")\n\
179 will run @code{ls} and return you to your shell prompt.\n\
181 If successful, @code{exec} does not return. If @code{exec} does return,\n\
182 @var{err} will be nonzero, and @var{msg} will contain a system-dependent\n\
188 retval(1) = std::string ();
191 int nargin = args.
length ();
193 if (nargin == 1 || nargin == 2)
195 if (args(0).is_string ())
197 std::string exec_file = args(0).string_value ();
209 exec_args.
resize (len + 1);
211 exec_args[0] = exec_file;
213 for (
int i = 0; i < len; i++)
214 exec_args[i+1] = tmp[i];
217 error (
"exec: all arguments must be strings");
223 exec_args[0] = exec_file;
242 error (
"exec: FILE must be a string");
252 @deftypefn {Built-in Function} {[@var{in}, @var{out}, @var{pid}] =} popen2 (@var{command}, @var{args})\n\
253 Start a subprocess with two-way communication.\n\
255 The name of the process is given by @var{command}, and @var{args} is an\n\
256 array of strings containing options for the command.\n\
258 The file identifiers for the input and output streams of the subprocess are\n\
259 returned in @var{in} and @var{out}. If execution of the command is\n\
260 successful, @var{pid} contains the process ID of the subprocess. Otherwise,\n\
261 @var{pid} is @minus{}1.\n\
266 [in, out, pid] = popen2 (\"sort\", \"-r\");\n\
267 fputs (in, \"these\\nare\\nsome\\nstrings\\n\");\n\
269 EAGAIN = errno (\"EAGAIN\");\n\
274 fputs (stdout, s);\n\
275 elseif (errno () == EAGAIN)\n\
291 Note that @code{popen2}, unlike @code{popen}, will not @nospell{\"reap\"} the\n\
292 child process. If you don't use @code{waitpid} to check the child's\n\
293 exit status, it will linger until Octave exits.\n\
294 @seealso{popen, waitpid}\n\
303 int nargin = args.length ();
305 if (nargin >= 1 && nargin <= 3)
307 if (args(0).is_string ())
309 std::string exec_file = args(0).string_value ();
321 arg_list.
resize (len + 1);
323 arg_list[0] = exec_file;
325 for (
int i = 0; i < len; i++)
326 arg_list[i+1] = tmp[i];
329 error (
"popen2: all arguments must be strings");
335 arg_list[0] = exec_file;
340 bool sync_mode = (nargin == 3 ? args(2).bool_value () :
false);
352 FILE *ifile = fdopen (fildes[1],
"r");
353 FILE *ofile = fdopen (fildes[0],
"w");
363 Cell file_ids (1, 2);
370 error (msg.c_str ());
374 error (
"popen2: all arguments must be strings");
377 error (
"popen2: COMMAND argument must be a string");
455 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} fcntl (@var{fid}, @var{request}, @var{arg})\n\
456 Change the properties of the open file @var{fid}.\n\
458 The following values may be passed as @var{request}:\n\
462 Return a duplicate file descriptor.\n\
465 Return the file descriptor flags for @var{fid}.\n\
468 Set the file descriptor flags for @var{fid}.\n\
471 Return the file status flags for @var{fid}. The following codes may be\n\
472 returned (some of the flags may be undefined on some systems).\n\
476 Open for reading only.\n\
479 Open for writing only.\n\
482 Open for reading and writing.\n\
485 Append on each write.\n\
488 Create the file if it does not exist.\n\
491 Non-blocking mode.\n\
494 Wait for writes to complete.\n\
501 Set the file status flags for @var{fid} to the value specified by @var{arg}.\n\
502 The only flags that can be changed are @w{@code{O_APPEND}} and\n\
503 @w{@code{O_NONBLOCK}}.\n\
506 If successful, @var{err} is 0 and @var{msg} is an empty string. Otherwise,\n\
507 @var{err} is nonzero and @var{msg} contains a system-dependent error\n\
509 @seealso{fopen, dup2}\n\
514 retval(1) = std::string ();
517 int nargin = args.
length ();
527 int req = args(1).int_value (
true);
528 int arg = args(2).int_value (
true);
534 error (
"fcntl: invalid file id");
547 error (
"fcntl: FID, REQUEST, and ARG must be integers");
557 @deftypefn {Built-in Function} {[@var{pid}, @var{msg}] =} fork ()\n\
558 Create a copy of the current process.\n\
560 Fork can return one of the following values:\n\
564 You are in the parent process. The value returned from @code{fork} is the\n\
565 process id of the child process. You should probably arrange to wait for\n\
566 any child processes to exit.\n\
569 You are in the child process. You can call @code{exec} to start another\n\
570 process. If that fails, you should probably call @code{exit}.\n\
573 The call to @code{fork} failed for some reason. You must take evasive\n\
574 action. A system dependent error message will be waiting in @var{msg}.\n\
580 retval(1) = std::string ();
583 int nargin = args.
length ();
602 @deftypefn {Built-in Function} {pgid =} getpgrp ()\n\
603 Return the process group id of the current process.\n\
608 retval(1) = std::string ();
611 int nargin = args.
length ();
628 @deftypefn {Built-in Function} {pid =} getpid ()\n\
629 Return the process id of the current process.\n\
635 int nargin = args.
length ();
647 @deftypefn {Built-in Function} {pid =} getppid ()\n\
648 Return the process id of the parent process.\n\
654 int nargin = args.
length ();
666 @deftypefn {Built-in Function} {egid =} getegid ()\n\
667 Return the effective group id of the current process.\n\
673 int nargin = args.
length ();
685 @deftypefn {Built-in Function} {gid =} getgid ()\n\
686 Return the real group id of the current process.\n\
692 int nargin = args.
length ();
704 @deftypefn {Built-in Function} {euid =} geteuid ()\n\
705 Return the effective user id of the current process.\n\
711 int nargin = args.
length ();
723 @deftypefn {Built-in Function} {uid =} getuid ()\n\
724 Return the real user id of the current process.\n\
730 int nargin = args.
length ();
742 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} kill (@var{pid}, @var{sig})\n\
743 Send signal @var{sig} to process @var{pid}.\n\
745 If @var{pid} is positive, then signal @var{sig} is sent to @var{pid}.\n\
747 If @var{pid} is 0, then signal @var{sig} is sent to every process\n\
748 in the process group of the current process.\n\
750 If @var{pid} is -1, then signal @var{sig} is sent to every process\n\
753 If @var{pid} is less than -1, then signal @var{sig} is sent to every\n\
754 process in the process group @var{-pid}.\n\
756 If @var{sig} is 0, then no signal is sent, but error checking is still\n\
759 Return 0 if successful, otherwise return -1.\n\
764 retval(1) = std::string ();
767 if (args.length () == 2)
769 pid_t pid = args(0).int_value (
true);
773 int sig = args(1).int_value (
true);
794 @deftypefn {Built-in Function} {@var{info} =} lstat (@var{symlink})\n\
795 @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{symlink})\n\
796 Return a structure @var{info} containing information about the symbolic link\n\
799 The function outputs are described in the documentation for @code{stat}.\n\
800 @seealso{stat, symlink}\n\
805 if (args.length () == 1)
807 std::string fname = args(0).string_value ();
824 @deftypefn {Built-in Function} {@var{err} =} mkfifo (@var{name}, @var{mode})\n\
825 @deftypefnx {Built-in Function} {[@var{err}, @var{msg}] =} mkfifo (@var{name}, @var{mode})\n\
826 Create a FIFO special file named @var{name} with file mode @var{mode}.\n\
828 @var{mode} is interpreted as a decimal number (@emph{not} octal) and is\n\
829 subject to umask processing. The final calculated mode is\n\
830 @code{@var{mode} - @var{umask}}.\n\
832 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\
833 Otherwise, @var{err} is nonzero and @var{msg} contains a system-dependent\n\
835 @seealso{pipe, umask}\n\
840 retval(1) = std::string ();
843 int nargin = args.
length ();
847 if (args(0).is_string ())
849 std::string name = args(0).string_value ();
851 if (args(1).is_scalar_type ())
853 long mode = args(1).long_value ();
867 error (
"mkfifo: invalid MODE");
870 error (
"mkfifo: MODE must be an integer");
873 error (
"mkfifo: FILE must be a string");
883 @deftypefn {Built-in Function} {[@var{read_fd}, @var{write_fd}, @var{err}, @var{msg}] =} pipe ()\n\
884 Create a pipe and return the reading and writing ends of the pipe into\n\
885 @var{read_fd} and @var{write_fd} respectively.\n\
887 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\
888 Otherwise, @var{err} is nonzero and @var{msg} contains a system-dependent\n\
895 retval(3) = std::string ();
900 int nargin = args.
length ();
914 FILE *ifile = fdopen (fid[0],
"r");
915 FILE *ofile = fdopen (fid[1],
"w");
938 @deftypefn {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} stat (@var{file})\n\
939 @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} stat (@var{fid})\n\
940 @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{file})\n\
941 @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{fid})\n\
942 Return a structure @var{info} containing the following information about\n\
943 @var{file} or file identifier @var{fid}.\n\
947 ID of device containing a directory entry for this file.\n\
950 File number of the file.\n\
953 File mode, as an integer. Use the functions @w{@code{S_ISREG}},\n\
954 @w{@code{S_ISDIR}}, @w{@code{S_ISCHR}}, @w{@code{S_ISBLK}},\n\
955 @w{@code{S_ISFIFO}}, @w{@code{S_ISLNK}}, or @w{@code{S_ISSOCK}} to extract\n\
956 information from this value.\n\
959 File mode, as a string of ten letters or dashes as would be returned by\n\
966 User ID of file's owner.\n\
969 Group ID of file's group.\n\
972 ID of device for block or character special files.\n\
978 Time of last access in the same form as time values returned from\n\
979 @code{time}. @xref{Timing Utilities}.\n\
982 Time of last modification in the same form as time values returned from\n\
983 @code{time}. @xref{Timing Utilities}.\n\
986 Time of last file status change in the same form as time values\n\
987 returned from @code{time}. @xref{Timing Utilities}.\n\
990 Size of blocks in the file.\n\
993 Number of blocks allocated for file.\n\
996 If the call is successful @var{err} is 0 and @var{msg} is an empty string.\n\
997 If the file does not exist, or some other error occurs, @var{info} is an\n\
998 empty matrix, @var{err} is @minus{}1, and @var{msg} contains the\n\
999 corresponding system error message.\n\
1001 If @var{file} is a symbolic link, @code{stat} will return information about\n\
1002 the actual file that is referenced by the link. Use @code{lstat} if you\n\
1003 want information about the symbolic link itself.\n\
1008 [info, err, msg] = stat (\"/vmlinuz\")\n\
1011 atime = 855399756\n\
1013 ctime = 847219094\n\
1017 mtime = 847219094\n\
1021 mode = -rw-r--r--\n\
1022 modestr = -rw-r--r--\n\
1026 @result{} err = 0\n\
1029 @seealso{lstat, ls, dir}\n\
1034 if (args.length () == 1)
1036 if (args(0).is_scalar_type ())
1049 std::string fname = args(0).string_value ();
1067 @deftypefn {Built-in Function} {} S_ISREG (@var{mode})\n\
1068 Return true if @var{mode} corresponds to a regular file.\n\
1070 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1071 @seealso{stat, lstat}\n\
1076 if (args.length () == 1)
1083 error (
"S_ISREG: invalid MODE value");
1093 @deftypefn {Built-in Function} {} S_ISDIR (@var{mode})\n\
1094 Return true if @var{mode} corresponds to a directory.\n\
1096 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1097 @seealso{stat, lstat}\n\
1102 if (args.length () == 1)
1109 error (
"S_ISDIR: invalid MODE value");
1119 @deftypefn {Built-in Function} {} S_ISCHR (@var{mode})\n\
1120 Return true if @var{mode} corresponds to a character device.\n\
1122 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1123 @seealso{stat, lstat}\n\
1128 if (args.length () == 1)
1135 error (
"S_ISCHR: invalid MODE value");
1145 @deftypefn {Built-in Function} {} S_ISBLK (@var{mode})\n\
1146 Return true if @var{mode} corresponds to a block device.\n\
1148 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1149 @seealso{stat, lstat}\n\
1154 if (args.length () == 1)
1161 error (
"S_ISBLK: invalid MODE value");
1171 @deftypefn {Built-in Function} {} S_ISFIFO (@var{mode})\n\
1172 Return true if @var{mode} corresponds to a fifo.\n\
1174 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1175 @seealso{stat, lstat}\n\
1180 if (args.length () == 1)
1187 error (
"S_ISFIFO: invalid MODE value");
1197 @deftypefn {Built-in Function} {} S_ISLNK (@var{mode})\n\
1198 Return true if @var{mode} corresponds to a symbolic link.\n\
1200 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1201 @seealso{stat, lstat}\n\
1206 if (args.length () == 1)
1213 error (
"S_ISLNK: invalid MODE value");
1223 @deftypefn {Built-in Function} {} S_ISSOCK (@var{mode})\n\
1224 Return true if @var{mode} corresponds to a socket.\n\
1226 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1227 @seealso{stat, lstat}\n\
1232 if (args.length () == 1)
1239 error (
"S_ISSOCK: invalid MODE value");
1247 DEFUN (gethostname, args, ,
1249 @deftypefn {Built-in Function} {} gethostname ()\n\
1250 Return the hostname of the system where Octave is running.\n\
1255 if (args.length () == 0)
1263 DEFUN (uname, args, ,
1265 @deftypefn {Built-in Function} {[@var{uts}, @var{err}, @var{msg}] =} uname ()\n\
1266 Return system information in the structure.\n\
1275 nodename = segfault\n\
1276 release = 2.6.15-1-amd64-k8-smp\n\
1278 machine = #2 SMP Thu Feb 23 04:57:49 UTC 2006\n\
1283 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\
1284 Otherwise, @var{err} is nonzero and @var{msg} contains a\n\
1285 system-dependent error message.\n\
1290 if (args.length () == 0)
1302 retval(2) = sysinfo.
message ();
1303 retval(1) = sysinfo.
error ();
1314 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} unlink (@var{file})\n\
1315 Delete the file named @var{file}.\n\
1317 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\
1318 Otherwise, @var{err} is nonzero and @var{msg} contains a system-dependent\n\
1320 @seealso{delete, rmdir}\n\
1325 retval(1) = std::string ();
1328 int nargin = args.
length ();
1332 if (args(0).is_string ())
1334 std::string name = args(0).string_value ();
1344 error (
"unlink: FILE must be a string");
1354 @deftypefn {Built-in Function} {[@var{pid}, @var{status}, @var{msg}] =} waitpid (@var{pid}, @var{options})\n\
1355 Wait for process @var{pid} to terminate.\n\
1357 The @var{pid} argument can be:\n\
1361 Wait for any child process.\n\
1364 Wait for any child process whose process group ID is equal to that of the\n\
1365 Octave interpreter process.\n\
1368 Wait for termination of the child process with ID @var{pid}.\n\
1371 The @var{options} argument can be a bitwise OR of zero or more of the\n\
1372 following constants:\n\
1376 Wait until signal is received or a child process exits (this is the default\n\
1377 if the @var{options} argument is missing).\n\
1380 Do not hang if status is not immediately available.\n\
1383 Report the status of any child processes that are stopped, and whose status\n\
1384 has not yet been reported since they stopped.\n\
1387 Return if a stopped child has been resumed by delivery of @code{SIGCONT}.\n\
1388 This value may not be meaningful on all systems.\n\
1391 If the returned value of @var{pid} is greater than 0, it is the process ID\n\
1392 of the child process that exited. If an error occurs, @var{pid} will be\n\
1393 less than zero and @var{msg} will contain a system-dependent error message.\n\
1394 The value of @var{status} contains additional system-dependent information\n\
1395 about the subprocess that exited.\n\
1396 @seealso{WCONTINUE, WCOREDUMP, WEXITSTATUS, WIFCONTINUED, WIFSIGNALED, WIFSTOPPED, WNOHANG, WSTOPSIG, WTERMSIG, WUNTRACED}\n\
1401 retval(2) = std::string ();
1405 int nargin = args.
length ();
1407 if (nargin == 1 || nargin == 2)
1409 pid_t pid = args(0).int_value (
true);
1415 if (args.length () == 2)
1416 options = args(1).int_value (
true);
1432 error (
"waitpid: OPTIONS must be an integer");
1435 error (
"waitpid: PID must be an integer value");
1445 @deftypefn {Built-in Function} {} WIFEXITED (@var{status})\n\
1446 Given @var{status} from a call to @code{waitpid}, return\n\
1447 true if the child terminated normally.\n\
1448 @seealso{waitpid, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\
1453 if (args.length () == 1)
1460 error (
"WIFEXITED: STATUS must be an integer");
1468 @deftypefn {Built-in Function} {} WEXITSTATUS (@var{status})\n\
1469 Given @var{status} from a call to @code{waitpid}, return\n\
1470 the exit status of the child.\n\
1472 This function should only be employed if @code{WIFEXITED} returned true.\n\
1473 @seealso{waitpid, WIFEXITED, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\
1478 if (args.length () == 1)
1485 error (
"WEXITSTATUS: STATUS must be an integer");
1493 @deftypefn {Built-in Function} {} WIFSIGNALED (@var{status})\n\
1494 Given @var{status} from a call to @code{waitpid}, return\n\
1495 true if the child process was terminated by a signal.\n\
1496 @seealso{waitpid, WIFEXITED, WEXITSTATUS, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\
1501 if (args.length () == 1)
1508 error (
"WIFSIGNALED: STATUS must be an integer");
1516 @deftypefn {Built-in Function} {} WTERMSIG (@var{status})\n\
1517 Given @var{status} from a call to @code{waitpid}, return\n\
1518 the number of the signal that caused the child process to terminate.\n\
1520 This function should only be employed if @code{WIFSIGNALED} returned true.\n\
1521 @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\
1526 if (args.length () == 1)
1533 error (
"WTERMSIG: STATUS must be an integer");
1541 @deftypefn {Built-in Function} {} WCOREDUMP (@var{status})\n\
1542 Given @var{status} from a call to @code{waitpid}, return\n\
1543 true if the child produced a core dump.\n\
1545 This function should only be employed if @code{WIFSIGNALED} returned true.\n\
1546 The macro used to implement this function is not specified in POSIX.1-2001\n\
1547 and is not available on some Unix implementations (e.g., AIX, SunOS).\n\
1548 @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\
1553 if (args.length () == 1)
1560 error (
"WCOREDUMP: STATUS must be an integer");
1568 @deftypefn {Built-in Function} {} WIFSTOPPED (@var{status})\n\
1569 Given @var{status} from a call to @code{waitpid}, return\n\
1570 true if the child process was stopped by delivery of a signal.\n\
1572 This is only possible if the call was done using @code{WUNTRACED} or when\n\
1573 the child is being traced (see ptrace(2)).\n\
1574 @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WSTOPSIG, WIFCONTINUED}\n\
1579 if (args.length () == 1)
1586 error (
"WIFSTOPPED: STATUS must be an integer");
1594 @deftypefn {Built-in Function} {} WSTOPSIG (@var{status})\n\
1595 Given @var{status} from a call to @code{waitpid}, return\n\
1596 the number of the signal which caused the child to stop.\n\
1598 This function should only be employed if @code{WIFSTOPPED} returned true.\n\
1599 @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WIFCONTINUED}\n\
1604 if (args.length () == 1)
1611 error (
"WSTOPSIG: STATUS must be an integer");
1619 @deftypefn {Built-in Function} {} WIFCONTINUED (@var{status})\n\
1620 Given @var{status} from a call to @code{waitpid}, return\n\
1621 true if the child process was resumed by delivery of @code{SIGCONT}.\n\
1622 @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG}\n\
1627 if (args.length () == 1)
1634 error (
"WIFCONTINUED: STATUS must be an integer");
1642 @deftypefn {Built-in Function} {[@var{cname}, @var{status}, @var{msg}] =} canonicalize_file_name (@var{fname})\n\
1643 Return the canonical name of file @var{fname}.\n\
1645 If the file does not exist the empty string (\"\") is returned.\n\
1646 @seealso{make_absolute_filename, is_absolute_filename, is_rooted_relative_filename}\n\
1651 if (args.length () == 1)
1653 if (args(0).is_string ())
1655 std::string name = args(0).string_value ();
1661 retval(1) = msg.
empty () ? 0 : -1;
1665 error (
"canonicalize_file_name: NAME must be a string");
1678 int nargin = args.
length ();
1688 #if !defined (O_NONBLOCK) && defined (O_NDELAY)
1689 #define O_NONBLOCK O_NDELAY
1694 @deftypefn {Built-in Function} {} F_DUPFD ()\n\
1695 Return the numerical value to pass to @code{fcntl} to return\n\
1696 a duplicate file descriptor.\n\
1697 @seealso{fcntl, F_GETFD, F_GETFL, F_SETFD, F_SETFL}\n\
1700 #if defined (F_DUPFD)
1703 error (
"F_DUPFD: not available on this system");
1710 @deftypefn {Built-in Function} {} F_GETFD ()\n\
1711 Return the numerical value to pass to @code{fcntl} to return\n\
1712 the file descriptor flags.\n\
1713 @seealso{fcntl, F_DUPFD, F_GETFL, F_SETFD, F_SETFL}\n\
1716 #if defined (F_GETFD)
1719 error (
"F_GETFD: not available on this system");
1726 @deftypefn {Built-in Function} {} F_GETFL ()\n\
1727 Return the numerical value to pass to @code{fcntl} to return\n\
1728 the file status flags.\n\
1729 @seealso{fcntl, F_DUPFD, F_GETFD, F_SETFD, F_SETFL}\n\
1732 #if defined (F_GETFL)
1735 error (
"F_GETFL: not available on this system");
1742 @deftypefn {Built-in Function} {} F_SETFD ()\n\
1743 Return the numerical value to pass to @code{fcntl} to set the file\n\
1744 descriptor flags.\n\
1745 @seealso{fcntl, F_DUPFD, F_GETFD, F_GETFL, F_SETFL}\n\
1748 #if defined (F_SETFD)
1751 error (
"F_SETFD: not available on this system");
1758 @deftypefn {Built-in Function} {} F_SETFL ()\n\
1759 Return the numerical value to pass to @code{fcntl} to set the file\n\
1761 @seealso{fcntl, F_DUPFD, F_GETFD, F_GETFL, F_SETFD}\n\
1764 #if defined (F_SETFL)
1767 error (
"F_SETFL: not available on this system");
1774 @deftypefn {Built-in Function} {} O_APPEND ()\n\
1775 Return the numerical value of the file status flag that may be\n\
1776 returned by @code{fcntl} to indicate each write operation appends,\n\
1777 or that may be passed to @code{fcntl} to set the write mode to append.\n\
1778 @seealso{fcntl, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\
1781 #if defined (O_APPEND)
1784 error (
"O_APPEND: not available on this system");
1791 @deftypefn {Built-in Function} {} O_ASYNC ()\n\
1792 Return the numerical value of the file status flag that may be\n\
1793 returned by @code{fcntl} to indicate asynchronous I/O.\n\
1794 @seealso{fcntl, O_APPEND, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\
1797 #if defined (O_ASYNC)
1800 error (
"O_ASYNC: not available on this system");
1807 @deftypefn {Built-in Function} {} O_CREAT ()\n\
1808 Return the numerical value of the file status flag that may be\n\
1809 returned by @code{fcntl} to indicate that a file should be created if it\n\
1811 @seealso{fcntl, O_APPEND, O_ASYNC, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\
1814 #if defined (O_CREAT)
1817 error (
"O_CREAT: not available on this system");
1824 @deftypefn {Built-in Function} {} O_EXCL ()\n\
1825 Return the numerical value of the file status flag that may be\n\
1826 returned by @code{fcntl} to indicate that file locking is used.\n\
1827 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\
1830 #if defined (O_EXCL)
1833 error (
"O_EXCL: not available on this system");
1840 @deftypefn {Built-in Function} {} O_NONBLOCK ()\n\
1841 Return the numerical value of the file status flag that may be\n\
1842 returned by @code{fcntl} to indicate that non-blocking I/O is in use,\n\
1843 or that may be passsed to @code{fcntl} to set non-blocking I/O.\n\
1844 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\
1847 #if defined (O_NONBLOCK)
1850 error (
"O_NONBLOCK: not available on this system");
1857 @deftypefn {Built-in Function} {} O_RDONLY ()\n\
1858 Return the numerical value of the file status flag that may be\n\
1859 returned by @code{fcntl} to indicate that a file is open for reading only.\n\
1860 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\
1863 #if defined (O_RDONLY)
1866 error (
"O_RDONLY: not available on this system");
1873 @deftypefn {Built-in Function} {} O_RDWR ()\n\
1874 Return the numerical value of the file status flag that may be\n\
1875 returned by @code{fcntl} to indicate that a file is open for both reading\n\
1877 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_SYNC, O_TRUNC, O_WRONLY}\n\
1880 #if defined (O_RDWR)
1883 error (
"O_RDWR: not available on this system");
1890 @deftypefn {Built-in Function} {} O_SYNC ()\n\
1891 Return the numerical value of the file status flag that may be\n\
1892 returned by @code{fcntl} to indicate that a file is open for synchronous I/O.\n\
1893 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY}\n\
1896 #if defined (O_SYNC)
1899 error (
"O_SYNC: not available on this system");
1906 @deftypefn {Built-in Function} {} O_TRUNC ()\n\
1907 Return the numerical value of the file status flag that may be\n\
1908 returned by @code{fcntl} to indicate that if file exists, it should be\n\
1909 truncated when writing.\n\
1910 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_WRONLY}\n\
1913 #if defined (O_TRUNC)
1916 error (
"O_TRUNC: not available on this system");
1923 @deftypefn {Built-in Function} {} O_WRONLY ()\n\
1924 Return the numerical value of the file status flag that may be\n\
1925 returned by @code{fcntl} to indicate that a file is open for writing only.\n\
1926 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC}\n\
1929 #if defined (O_WRONLY)
1932 error (
"O_WRONLY: not available on this system");
1937 #if !defined (WNOHANG)
1943 @deftypefn {Built-in Function} {} WNOHANG ()\n\
1944 Return the numerical value of the option argument that may be\n\
1945 passed to @code{waitpid} to indicate that it should return its status\n\
1946 immediately instead of waiting for a process to exit.\n\
1947 @seealso{waitpid, WUNTRACED, WCONTINUE}\n\
1953 #if !defined (WUNTRACED)
1959 @deftypefn {Built-in Function} {} WUNTRACED ()\n\
1960 Return the numerical value of the option argument that may be\n\
1961 passed to @code{waitpid} to indicate that it should also return if the child\n\
1962 process has stopped but is not traced via the @code{ptrace} system call\n\
1963 @seealso{waitpid, WNOHANG, WCONTINUE}\n\
1969 #if !defined (WCONTINUE)
1975 @deftypefn {Built-in Function} {} WCONTINUE ()\n\
1976 Return the numerical value of the option argument that may be\n\
1977 passed to @code{waitpid} to indicate that it should also return if a stopped\n\
1978 child has been resumed by delivery of a @code{SIGCONT} signal.\n\
1979 @seealso{waitpid, WNOHANG, WUNTRACED}\n\
static int dup2(int, int)
OCTAVE_EXPORT octave_value_list Fgetgid(const octave_value_list &args, int)
static uid_t getuid(void)
static bool ignoring_entries(void)
int octave_unlink(const std::string &name)
OCTAVE_EXPORT octave_value_list Fcanonicalize_file_name(const octave_value_list &args, int)
static pid_t getppid(void)
int octave_fcntl(int fd, int cmd, long arg)
static octave_stream lookup(int fid, const std::string &who=std::string())
static bool ifcontinued(int status)
octave_time ctime(void) const
std::string error(void) const
OCTAVE_EXPORT octave_value_list FF_GETFD(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_ASYNC(const octave_value_list &args, int)
static int termsig(int status)
OCTAVE_EXPORT octave_value_list Fgetpgrp(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_TRUNC(const octave_value_list &args, int)
std::string mode_as_string(void) const
OCTAVE_EXPORT octave_value_list FF_SETFD(const octave_value_list &args, int)
OCTINTERP_API void print_usage(void)
std::string release(void) const
OCTAVE_EXPORT octave_value_list FWIFSTOPPED(const octave_value_list &args, int)
octave_idx_type length(void) const
OCTAVE_EXPORT octave_value_list FWSTOPSIG(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_RDWR(const octave_value_list &args, int)
int octave_mkfifo(const std::string &nm, mode_t md)
static bool ifexited(int status)
int int_value(bool req_int=false, bool frc_str_conv=false) const
std::string sysname(void) const
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
octave_time atime(void) const
OCTAVE_EXPORT octave_value_list FWIFEXITED(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fkill(const octave_value_list &args, int)
static octave_value_list mk_stat_result(const base_file_stat &fs)
OCTAVE_EXPORT octave_value_list Fgeteuid(const octave_value_list &args, int)
std::string machine(void) const
static gid_t getegid(void)
OCTAVE_EXPORT octave_value_list Fexec(const octave_value_list &args, int)
static int stopsig(int status)
OCTAVE_EXPORT octave_value_list Fpipe(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWIFSIGNALED(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fpopen2(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fgetegid(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Ffcntl(const octave_value_list &args, int)
static void clean_up_and_save(const std::string &=std::string(), int=-1)
OCTAVE_EXPORT octave_value_list Flstat(const octave_value_list &args, int)
static int insert(octave_stream &os)
OCTAVE_EXPORT octave_value_list FO_NONBLOCK(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FF_GETFL(const octave_value_list &args, int)
static pid_t waitpid(pid_t, int *status, int)
OCTAVE_EXPORT octave_value_list FS_ISDIR(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fgetuid(const octave_value_list &args, int)
std::string message(void) const
OCTAVE_EXPORT octave_value_list Fmkfifo(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FS_ISFIFO(const octave_value_list &args, int)
void octave_history_write_timestamp(void)
OCTAVE_EXPORT octave_value_list FS_ISBLK(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_SYNC(const octave_value_list &args, int)
void resize(octave_idx_type n, const std::string &rfv=std::string())
static octave_stream create(const std::string &n, FILE *f=0, std::ios::openmode m=std::ios::in|std::ios::out, oct_mach_info::float_format ff=oct_mach_info::native_float_format(), c_file_ptr_buf::close_fcn cf=c_file_ptr_buf::file_close)
OCTAVE_EXPORT octave_value_list Fgetppid(const octave_value_list &args, int)
static int execvp(const std::string &, const string_vector &)
OCTAVE_EXPORT octave_value_list Fdup2(const octave_value_list &args, int)
static pid_t popen2(const std::string &, const string_vector &, bool, int *)
#define DEFUNX(name, fname, args_name, nargout_name, doc)
static pid_t getpid(void)
OCTAVE_EXPORT octave_value_list FWUNTRACED(const octave_value_list &args, int)
octave_idx_type length(void) const
static gid_t getgid(void)
OCTAVE_EXPORT octave_value_list Fstat(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FS_ISSOCK(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWCONTINUE(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FO_APPEND(const octave_value_list &args, int)
std::string octave_canonicalize_file_name(const std::string &name)
nlink_t nlink(void) const
OCTAVE_EXPORT octave_value_list Fwaitpid(const octave_value_list &args, int)
static pid_t fork(std::string &)
octave_idx_type length(void) const
Number of elements in the array.
OCTAVE_EXPORT octave_value_list FO_RDONLY(const octave_value_list &args, int)
octave_time mtime(void) const
OCTAVE_EXPORT octave_value_list FWIFCONTINUED(const octave_value_list &args, int)
static octave_value const_value(const octave_value_list &args, int val)
OCTAVE_EXPORT octave_value_list FS_ISREG(const octave_value_list &args, int)
void assign(const std::string &k, const octave_value &val)
OCTAVE_EXPORT octave_value_list FO_CREAT(const octave_value_list &args, int)
static bool ifsignaled(int status)
OCTAVE_EXPORT octave_value_list FO_WRONLY(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWCOREDUMP(const octave_value_list &args, int)
static bool ifstopped(int status)
static int exitstatus(int status)
OCTAVE_EXPORT octave_value_list FS_ISCHR(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list FWTERMSIG(const octave_value_list &args, int)
static bool coredump(int status)
OCTAVE_EXPORT octave_value_list FS_ISLNK(const octave_value_list &args, int)
static octave_scalar_map mk_stat_map(const base_file_stat &fs)
static uid_t geteuid(void)
OCTAVE_EXPORT octave_value_list Fgetpid(const octave_value_list &args, int)
std::string nodename(void) const
OCTAVE_EXPORT octave_value_list FF_SETFL(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Ffork(const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Funlink(const octave_value_list &args, int)
double double_value(bool frc_str_conv=false) const
OCTAVE_EXPORT octave_value_list FWEXITSTATUS(const octave_value_list &args, int)
std::string version(void) const
static int get_file_number(const octave_value &fid)
OCTAVE_EXPORT octave_value_list FO_EXCL(const octave_value_list &args, int)
static int kill(pid_t, int)
OCTAVE_EXPORT octave_value_list FF_DUPFD(const octave_value_list &args, int)
static std::string get_host_name(void)
OCTAVE_EXPORT octave_value_list FWNOHANG(const octave_value_list &args, int)
static pid_t getpgrp(std::string &)
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))