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\n\
118 ID@. Otherwise, @var{fid} is negative and @var{msg} contains a\n\
119 system-dependent error message.\n\
124 retval(1) = std::string ();
127 int nargin = args.
length ();
144 if (i_old >= 0 && i_new >= 0)
156 error (
"dup2: invalid stream");
166 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} exec (@var{file}, @var{args})\n\
167 Replace current process with a new process. Calling @code{exec} without\n\
168 first calling @code{fork} will terminate your current Octave process and\n\
169 replace it with the program named by @var{file}. For example,\n\
172 exec (\"ls\" \"-l\")\n\
176 will run @code{ls} and return you to your shell prompt.\n\
178 If successful, @code{exec} does not return. If @code{exec} does return,\n\
179 @var{err} will be nonzero, and @var{msg} will contain a system-dependent\n\
185 retval(1) = std::string ();
188 int nargin = args.
length ();
190 if (nargin == 1 || nargin == 2)
192 std::string exec_file = args(0).string_value ();
206 exec_args.
resize (len + 1);
208 exec_args[0] = exec_file;
210 for (
int i = 0; i < len; i++)
211 exec_args[i+1] = tmp[i];
214 error (
"exec: arguments must be character strings");
220 exec_args[0] = exec_file;
239 error (
"exec: FILE must be a string");
249 @deftypefn {Built-in Function} {[@var{in}, @var{out}, @var{pid}] =} popen2 (@var{command}, @var{args})\n\
250 Start a subprocess with two-way communication. The name of the process\n\
251 is given by @var{command}, and @var{args} is an array of strings\n\
252 containing options for the command. The file identifiers for the input\n\
253 and output streams of the subprocess are returned in @var{in} and\n\
254 @var{out}. If execution of the command is successful, @var{pid}\n\
255 contains the process ID of the subprocess. Otherwise, @var{pid} is\n\
261 [in, out, pid] = popen2 (\"sort\", \"-r\");\n\
262 fputs (in, \"these\\nare\\nsome\\nstrings\\n\");\n\
264 EAGAIN = errno (\"EAGAIN\");\n\
269 fputs (stdout, s);\n\
270 elseif (errno () == EAGAIN)\n\
286 Note that @code{popen2}, unlike @code{popen}, will not @nospell{\"reap\"} the\n\
287 child process. If you don't use @code{waitpid} to check the child's\n\
288 exit status, it will linger until Octave exits.\n\
289 @seealso{popen, waitpid}\n\
298 int nargin = args.length ();
300 if (nargin >= 1 && nargin <= 3)
302 std::string exec_file = args(0).string_value ();
316 arg_list.
resize (len + 1);
318 arg_list[0] = exec_file;
320 for (
int i = 0; i < len; i++)
321 arg_list[i+1] = tmp[i];
324 error (
"popen2: arguments must be character strings");
330 arg_list[0] = exec_file;
335 bool sync_mode = (nargin == 3 ? args(2).bool_value () :
false);
347 FILE *ifile = fdopen (fildes[1],
"r");
348 FILE *ofile = fdopen (fildes[0],
"w");
358 Cell file_ids (1, 2);
365 error (msg.c_str ());
369 error (
"popen2: arguments must be character strings");
372 error (
"popen2: COMMAND argument must be a string");
450 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} fcntl (@var{fid}, @var{request}, @var{arg})\n\
451 Change the properties of the open file @var{fid}. The following values\n\
452 may be passed as @var{request}:\n\
456 Return a duplicate file descriptor.\n\
459 Return the file descriptor flags for @var{fid}.\n\
462 Set the file descriptor flags for @var{fid}.\n\
465 Return the file status flags for @var{fid}. The following codes may be\n\
466 returned (some of the flags may be undefined on some systems).\n\
470 Open for reading only.\n\
473 Open for writing only.\n\
476 Open for reading and writing.\n\
479 Append on each write.\n\
482 Create the file if it does not exist.\n\
485 Non-blocking mode.\n\
488 Wait for writes to complete.\n\
495 Set the file status flags for @var{fid} to the value specified by\n\
496 @var{arg}. The only flags that can be changed are @w{@code{O_APPEND}} and\n\
497 @w{@code{O_NONBLOCK}}.\n\
500 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\
501 Otherwise, @var{err} is nonzero and @var{msg} contains a\n\
502 system-dependent error message.\n\
507 retval(1) = std::string ();
510 int nargin = args.
length ();
520 int req = args(1).int_value (
true);
521 int arg = args(2).int_value (
true);
527 error (
"fcntl: invalid file id");
540 error (
"fcntl: FID, REQUEST, and ARG must be integers");
550 @deftypefn {Built-in Function} {[@var{pid}, @var{msg}] =} fork ()\n\
551 Create a copy of the current process.\n\
553 Fork can return one of the following values:\n\
557 You are in the parent process. The value returned from @code{fork} is\n\
558 the process id of the child process. You should probably arrange to\n\
559 wait for any child processes to exit.\n\
562 You are in the child process. You can call @code{exec} to start another\n\
563 process. If that fails, you should probably call @code{exit}.\n\
566 The call to @code{fork} failed for some reason. You must take evasive\n\
567 action. A system dependent error message will be waiting in @var{msg}.\n\
573 retval(1) = std::string ();
576 int nargin = args.
length ();
595 @deftypefn {Built-in Function} {pgid =} getpgrp ()\n\
596 Return the process group id of the current process.\n\
601 retval(1) = std::string ();
604 int nargin = args.
length ();
621 @deftypefn {Built-in Function} {pid =} getpid ()\n\
622 Return the process id of the current process.\n\
627 int nargin = args.
length ();
639 @deftypefn {Built-in Function} {pid =} getppid ()\n\
640 Return the process id of the parent process.\n\
645 int nargin = args.
length ();
657 @deftypefn {Built-in Function} {egid =} getegid ()\n\
658 Return the effective group id of the current process.\n\
663 int nargin = args.
length ();
675 @deftypefn {Built-in Function} {gid =} getgid ()\n\
676 Return the real group id of the current process.\n\
681 int nargin = args.
length ();
693 @deftypefn {Built-in Function} {euid =} geteuid ()\n\
694 Return the effective user id of the current process.\n\
699 int nargin = args.
length ();
711 @deftypefn {Built-in Function} {uid =} getuid ()\n\
712 Return the real user id of the current process.\n\
717 int nargin = args.
length ();
729 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} kill (@var{pid}, @var{sig})\n\
730 Send signal @var{sig} to process @var{pid}.\n\
732 If @var{pid} is positive, then signal @var{sig} is sent to @var{pid}.\n\
734 If @var{pid} is 0, then signal @var{sig} is sent to every process\n\
735 in the process group of the current process.\n\
737 If @var{pid} is -1, then signal @var{sig} is sent to every process\n\
740 If @var{pid} is less than -1, then signal @var{sig} is sent to every\n\
741 process in the process group @var{-pid}.\n\
743 If @var{sig} is 0, then no signal is sent, but error checking is still\n\
746 Return 0 if successful, otherwise return -1.\n\
751 retval(1) = std::string ();
754 if (args.length () == 2)
756 pid_t pid = args(0).int_value (
true);
760 int sig = args(1).int_value (
true);
781 @deftypefn {Built-in Function} {@var{info} =} lstat (@var{symlink})\n\
782 @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{symlink})\n\
783 Return a structure @var{info} containing information about the symbolic link\n\
786 The function outputs are described in the documentation for @code{stat}.\n\
787 @seealso{stat, symlink}\n\
792 if (args.length () == 1)
794 std::string fname = args(0).string_value ();
811 @deftypefn {Built-in Function} {} mkfifo (@var{name}, @var{mode})\n\
812 @deftypefnx {Built-in Function} {[@var{err}, @var{msg}] =} mkfifo (@var{name}, @var{mode})\n\
813 Create a FIFO special file named @var{name} with file mode @var{mode}\n\
815 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\
816 Otherwise, @var{err} is nonzero and @var{msg} contains a\n\
817 system-dependent error message.\n\
823 retval(1) = std::string ();
826 int nargin = args.
length ();
830 if (args(0).is_string ())
832 std::string name = args(0).string_value ();
834 if (args(1).is_scalar_type ())
836 long mode = args(1).long_value ();
850 error (
"mkfifo: invalid MODE");
853 error (
"mkfifo: MODE must be an integer");
856 error (
"mkfifo: FILE must be a string");
866 @deftypefn {Built-in Function} {[@var{read_fd}, @var{write_fd}, @var{err}, @var{msg}] =} pipe ()\n\
867 Create a pipe and return the reading and writing ends of the pipe\n\
868 into @var{read_fd} and @var{write_fd} respectively.\n\
870 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\
871 Otherwise, @var{err} is nonzero and @var{msg} contains a\n\
872 system-dependent error message.\n\
878 retval(3) = std::string ();
883 int nargin = args.
length ();
897 FILE *ifile = fdopen (fid[0],
"r");
898 FILE *ofile = fdopen (fid[1],
"w");
921 @deftypefn {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} stat (@var{file})\n\
922 @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} stat (@var{fid})\n\
923 @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{file})\n\
924 @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{fid})\n\
925 Return a structure @var{info} containing the following information about\n\
926 @var{file} or file identifier @var{fid}.\n\
930 ID of device containing a directory entry for this file.\n\
933 File number of the file.\n\
936 File mode, as an integer. Use the functions @w{@code{S_ISREG}},\n\
937 @w{@code{S_ISDIR}}, @w{@code{S_ISCHR}}, @w{@code{S_ISBLK}},\n\
938 @w{@code{S_ISFIFO}}, @w{@code{S_ISLNK}}, or @w{@code{S_ISSOCK}} to extract\n\
939 information from this value.\n\
942 File mode, as a string of ten letters or dashes as would be returned by\n\
949 User ID of file's owner.\n\
952 Group ID of file's group.\n\
955 ID of device for block or character special files.\n\
961 Time of last access in the same form as time values returned from\n\
962 @code{time}. @xref{Timing Utilities}.\n\
965 Time of last modification in the same form as time values returned from\n\
966 @code{time}. @xref{Timing Utilities}.\n\
969 Time of last file status change in the same form as time values\n\
970 returned from @code{time}. @xref{Timing Utilities}.\n\
973 Size of blocks in the file.\n\
976 Number of blocks allocated for file.\n\
979 If the call is successful @var{err} is 0 and @var{msg} is an empty\n\
980 string. If the file does not exist, or some other error occurs, @var{info}\n\
981 is an empty matrix, @var{err} is @minus{}1, and @var{msg} contains the\n\
982 corresponding system error message.\n\
984 If @var{file} is a symbolic link, @code{stat} will return information\n\
985 about the actual file that is referenced by the link. Use @code{lstat}\n\
986 if you want information about the symbolic link itself.\n\
991 [info, err, msg] = stat (\"/vmlinuz\")\n\
1000 mtime = 847219094\n\
1004 mode = -rw-r--r--\n\
1005 modestr = -rw-r--r--\n\
1009 @result{} err = 0\n\
1012 @seealso{lstat, ls, dir}\n\
1017 if (args.length () == 1)
1019 if (args(0).is_scalar_type ())
1032 std::string fname = args(0).string_value ();
1050 @deftypefn {Built-in Function} {} S_ISREG (@var{mode})\n\
1051 Return true if @var{mode} corresponds to a regular file.\n\
1053 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1054 @seealso{stat, lstat}\n\
1059 if (args.length () == 1)
1066 error (
"S_ISREG: invalid MODE value");
1076 @deftypefn {Built-in Function} {} S_ISDIR (@var{mode})\n\
1077 Return true if @var{mode} corresponds to a directory.\n\
1079 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1080 @seealso{stat, lstat}\n\
1085 if (args.length () == 1)
1092 error (
"S_ISDIR: invalid MODE value");
1102 @deftypefn {Built-in Function} {} S_ISCHR (@var{mode})\n\
1103 Return true if @var{mode} corresponds to a character device.\n\
1105 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1106 @seealso{stat, lstat}\n\
1111 if (args.length () == 1)
1118 error (
"S_ISCHR: invalid MODE value");
1128 @deftypefn {Built-in Function} {} S_ISBLK (@var{mode})\n\
1129 Return true if @var{mode} corresponds to a block device.\n\
1131 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1132 @seealso{stat, lstat}\n\
1137 if (args.length () == 1)
1144 error (
"S_ISBLK: invalid MODE value");
1154 @deftypefn {Built-in Function} {} S_ISFIFO (@var{mode})\n\
1155 Return true if @var{mode} corresponds to a fifo.\n\
1157 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1158 @seealso{stat, lstat}\n\
1163 if (args.length () == 1)
1170 error (
"S_ISFIFO: invalid MODE value");
1180 @deftypefn {Built-in Function} {} S_ISLNK (@var{mode})\n\
1181 Return true if @var{mode} corresponds to a symbolic link.\n\
1183 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1184 @seealso{stat, lstat}\n\
1189 if (args.length () == 1)
1196 error (
"S_ISLNK: invalid MODE value");
1206 @deftypefn {Built-in Function} {} S_ISSOCK (@var{mode})\n\
1207 Return true if @var{mode} corresponds to a socket.\n\
1209 The value of @var{mode} is assumed to be returned from a call to @code{stat}.\n\
1210 @seealso{stat, lstat}\n\
1215 if (args.length () == 1)
1222 error (
"S_ISSOCK: invalid MODE value");
1230 DEFUN (gethostname, args, ,
1232 @deftypefn {Built-in Function} {} gethostname ()\n\
1233 Return the hostname of the system where Octave is running.\n\
1238 if (args.length () == 0)
1246 DEFUN (uname, args, ,
1248 @deftypefn {Built-in Function} {[@var{uts}, @var{err}, @var{msg}] =} uname ()\n\
1249 Return system information in the structure. For example:\n\
1256 nodename = segfault\n\
1257 release = 2.6.15-1-amd64-k8-smp\n\
1259 machine = #2 SMP Thu Feb 23 04:57:49 UTC 2006\n\
1264 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\
1265 Otherwise, @var{err} is nonzero and @var{msg} contains a\n\
1266 system-dependent error message.\n\
1271 if (args.length () == 0)
1283 retval(2) = sysinfo.
message ();
1284 retval(1) = sysinfo.
error ();
1295 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} unlink (@var{file})\n\
1296 Delete the file named @var{file}.\n\
1298 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\
1299 Otherwise, @var{err} is nonzero and @var{msg} contains a\n\
1300 system-dependent error message.\n\
1305 retval(1) = std::string ();
1308 int nargin = args.
length ();
1312 if (args(0).is_string ())
1314 std::string name = args(0).string_value ();
1324 error (
"unlink: FILE must be a string");
1334 @deftypefn {Built-in Function} {[@var{pid}, @var{status}, @var{msg}] =} waitpid (@var{pid}, @var{options})\n\
1335 Wait for process @var{pid} to terminate. The @var{pid} argument can be:\n\
1339 Wait for any child process.\n\
1342 Wait for any child process whose process group ID is equal to that of\n\
1343 the Octave interpreter process.\n\
1346 Wait for termination of the child process with ID @var{pid}.\n\
1349 The @var{options} argument can be a bitwise OR of zero or more of\n\
1350 the following constants:\n\
1354 Wait until signal is received or a child process exits (this is the\n\
1355 default if the @var{options} argument is missing).\n\
1358 Do not hang if status is not immediately available.\n\
1361 Report the status of any child processes that are stopped, and whose\n\
1362 status has not yet been reported since they stopped.\n\
1365 Return if a stopped child has been resumed by delivery of @code{SIGCONT}.\n\
1366 This value may not be meaningful on all systems.\n\
1369 If the returned value of @var{pid} is greater than 0, it is the process\n\
1370 ID of the child process that exited. If an error occurs, @var{pid} will\n\
1371 be less than zero and @var{msg} will contain a system-dependent error\n\
1372 message. The value of @var{status} contains additional system-dependent\n\
1373 information about the subprocess that exited.\n\
1374 @seealso{WCONTINUE, WCOREDUMP, WEXITSTATUS, WIFCONTINUED, WIFSIGNALED, WIFSTOPPED, WNOHANG, WSTOPSIG, WTERMSIG, WUNTRACED}\n\
1379 retval(2) = std::string ();
1383 int nargin = args.
length ();
1385 if (nargin == 1 || nargin == 2)
1387 pid_t pid = args(0).int_value (
true);
1393 if (args.length () == 2)
1394 options = args(1).int_value (
true);
1410 error (
"waitpid: OPTIONS must be an integer");
1413 error (
"waitpid: PID must be an integer value");
1423 @deftypefn {Built-in Function} {} WIFEXITED (@var{status})\n\
1424 Given @var{status} from a call to @code{waitpid}, return true if the\n\
1425 child terminated normally.\n\
1426 @seealso{waitpid, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\
1431 if (args.length () == 1)
1438 error (
"WIFEXITED: STATUS must be an integer");
1446 @deftypefn {Built-in Function} {} WEXITSTATUS (@var{status})\n\
1447 Given @var{status} from a call to @code{waitpid}, return the exit\n\
1448 status of the child. This function should only be employed if\n\
1449 @code{WIFEXITED} returned true.\n\
1450 @seealso{waitpid, WIFEXITED, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\
1455 if (args.length () == 1)
1462 error (
"WEXITSTATUS: STATUS must be an integer");
1470 @deftypefn {Built-in Function} {} WIFSIGNALED (@var{status})\n\
1471 Given @var{status} from a call to @code{waitpid}, return true if the\n\
1472 child process was terminated by a signal.\n\
1473 @seealso{waitpid, WIFEXITED, WEXITSTATUS, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\
1478 if (args.length () == 1)
1485 error (
"WIFSIGNALED: STATUS must be an integer");
1493 @deftypefn {Built-in Function} {} WTERMSIG (@var{status})\n\
1494 Given @var{status} from a call to @code{waitpid}, return the number of\n\
1495 the signal that caused the child process to terminate. This function\n\
1496 should only be employed if @code{WIFSIGNALED} returned true.\n\
1497 @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\
1502 if (args.length () == 1)
1509 error (
"WTERMSIG: STATUS must be an integer");
1517 @deftypefn {Built-in Function} {} WCOREDUMP (@var{status})\n\
1518 Given @var{status} from a call to @code{waitpid}, return true if the\n\
1519 child produced a core dump. This function should only be employed if\n\
1520 @code{WIFSIGNALED} returned true. The macro used to implement this\n\
1521 function is not specified in POSIX.1-2001 and is not available on some\n\
1522 Unix implementations (e.g., AIX, SunOS).\n\
1523 @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\
1528 if (args.length () == 1)
1535 error (
"WCOREDUMP: STATUS must be an integer");
1543 @deftypefn {Built-in Function} {} WIFSTOPPED (@var{status})\n\
1544 Given @var{status} from a call to @code{waitpid}, return true if the\n\
1545 child process was stopped by delivery of a signal; this is only\n\
1546 possible if the call was done using @code{WUNTRACED} or when the child\n\
1547 is being traced (see ptrace(2)).\n\
1548 @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WSTOPSIG, WIFCONTINUED}\n\
1553 if (args.length () == 1)
1560 error (
"WIFSTOPPED: STATUS must be an integer");
1568 @deftypefn {Built-in Function} {} WSTOPSIG (@var{status})\n\
1569 Given @var{status} from a call to @code{waitpid}, return the number of\n\
1570 the signal which caused the child to stop. This function should only\n\
1571 be employed if @code{WIFSTOPPED} returned true.\n\
1572 @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WIFCONTINUED}\n\
1577 if (args.length () == 1)
1584 error (
"WSTOPSIG: STATUS must be an integer");
1592 @deftypefn {Built-in Function} {} WIFCONTINUED (@var{status})\n\
1593 Given @var{status} from a call to @code{waitpid}, return true if the\n\
1594 child process was resumed by delivery of @code{SIGCONT}.\n\
1595 @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG}\n\
1600 if (args.length () == 1)
1607 error (
"WIFCONTINUED: STATUS must be an integer");
1615 @deftypefn {Built-in Function} {[@var{cname}, @var{status}, @var{msg}] =} canonicalize_file_name (@var{fname})\n\
1616 Return the canonical name of file @var{fname}. If the file does not exist\n\
1617 the empty string (\"\") is returned.\n\
1618 @seealso{make_absolute_filename, is_absolute_filename, is_rooted_relative_filename}\n\
1623 if (args.length () == 1)
1625 std::string name = args(0).string_value ();
1634 retval(1) = msg.
empty () ? 0 : -1;
1638 error (
"canonicalize_file_name: NAME must be a character string");
1651 int nargin = args.
length ();
1661 #if !defined (O_NONBLOCK) && defined (O_NDELAY)
1662 #define O_NONBLOCK O_NDELAY
1667 @deftypefn {Built-in Function} {} F_DUPFD ()\n\
1668 Return the numerical value to pass to @code{fcntl} to return a\n\
1669 duplicate file descriptor.\n\
1670 @seealso{fcntl, F_GETFD, F_GETFL, F_SETFD, F_SETFL}\n\
1673 #if defined (F_DUPFD)
1676 error (
"F_DUPFD: not available on this system");
1683 @deftypefn {Built-in Function} {} F_GETFD ()\n\
1684 Return the numerical value to pass to @code{fcntl} to return the\n\
1685 file descriptor flags.\n\
1686 @seealso{fcntl, F_DUPFD, F_GETFL, F_SETFD, F_SETFL}\n\
1689 #if defined (F_GETFD)
1692 error (
"F_GETFD: not available on this system");
1699 @deftypefn {Built-in Function} {} F_GETFL ()\n\
1700 Return the numerical value to pass to @code{fcntl} to return the\n\
1701 file status flags.\n\
1702 @seealso{fcntl, F_DUPFD, F_GETFD, F_SETFD, F_SETFL}\n\
1705 #if defined (F_GETFL)
1708 error (
"F_GETFL: not available on this system");
1715 @deftypefn {Built-in Function} {} F_SETFD ()\n\
1716 Return the numerical value to pass to @code{fcntl} to set the file\n\
1717 descriptor flags.\n\
1718 @seealso{fcntl, F_DUPFD, F_GETFD, F_GETFL, F_SETFL}\n\
1721 #if defined (F_SETFD)
1724 error (
"F_SETFD: not available on this system");
1731 @deftypefn {Built-in Function} {} F_SETFL ()\n\
1732 Return the numerical value to pass to @code{fcntl} to set the file\n\
1734 @seealso{fcntl, F_DUPFD, F_GETFD, F_GETFL, F_SETFD}\n\
1737 #if defined (F_SETFL)
1740 error (
"F_SETFL: not available on this system");
1747 @deftypefn {Built-in Function} {} O_APPEND ()\n\
1748 Return the numerical value of the file status flag that may be\n\
1749 returned by @code{fcntl} to indicate each write operation appends,\n\
1750 or that may be passed to @code{fcntl} to set the write mode to append.\n\
1751 @seealso{fcntl, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\
1754 #if defined (O_APPEND)
1757 error (
"O_APPEND: not available on this system");
1764 @deftypefn {Built-in Function} {} O_ASYNC ()\n\
1765 Return the numerical value of the file status flag that may be\n\
1766 returned by @code{fcntl} to indicate asynchronous I/O.\n\
1767 @seealso{fcntl, O_APPEND, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\
1770 #if defined (O_ASYNC)
1773 error (
"O_ASYNC: not available on this system");
1780 @deftypefn {Built-in Function} {} O_CREAT ()\n\
1781 Return the numerical value of the file status flag that may be\n\
1782 returned by @code{fcntl} to indicate that a file should be\n\
1783 created if it does not exist.\n\
1784 @seealso{fcntl, O_APPEND, O_ASYNC, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\
1787 #if defined (O_CREAT)
1790 error (
"O_CREAT: not available on this system");
1797 @deftypefn {Built-in Function} {} O_EXCL ()\n\
1798 Return the numerical value of the file status flag that may be\n\
1799 returned by @code{fcntl} to indicate that file locking is used.\n\
1800 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\
1803 #if defined (O_EXCL)
1806 error (
"O_EXCL: not available on this system");
1813 @deftypefn {Built-in Function} {} O_NONBLOCK ()\n\
1814 Return the numerical value of the file status flag that may be\n\
1815 returned by @code{fcntl} to indicate that non-blocking I/O is in use,\n\
1816 or that may be passsed to @code{fcntl} to set non-blocking I/O.\n\
1817 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\
1820 #if defined (O_NONBLOCK)
1823 error (
"O_NONBLOCK: not available on this system");
1830 @deftypefn {Built-in Function} {} O_RDONLY ()\n\
1831 Return the numerical value of the file status flag that may be\n\
1832 returned by @code{fcntl} to indicate that a file is open for\n\
1834 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\
1837 #if defined (O_RDONLY)
1840 error (
"O_RDONLY: not available on this system");
1847 @deftypefn {Built-in Function} {} O_RDWR ()\n\
1848 Return the numerical value of the file status flag that may be\n\
1849 returned by @code{fcntl} to indicate that a file is open for both\n\
1850 reading and writing.\n\
1851 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_SYNC, O_TRUNC, O_WRONLY}\n\
1854 #if defined (O_RDWR)
1857 error (
"O_RDWR: not available on this system");
1864 @deftypefn {Built-in Function} {} O_SYNC ()\n\
1865 Return the numerical value of the file status flag that may be\n\
1866 returned by @code{fcntl} to indicate that a file is open for\n\
1868 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY}\n\
1871 #if defined (O_SYNC)
1874 error (
"O_SYNC: not available on this system");
1881 @deftypefn {Built-in Function} O_TRUNC ()\n\
1882 Return the numerical value of the file status flag that may be\n\
1883 returned by @code{fcntl} to indicate that if file exists, it should\n\
1884 be truncated when writing.\n\
1885 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_WRONLY}\n\
1888 #if defined (O_TRUNC)
1891 error (
"O_TRUNC: not available on this system");
1898 @deftypefn {Built-in Function} {} O_WRONLY ()\n\
1899 Return the numerical value of the file status flag that may be\n\
1900 returned by @code{fcntl} to indicate that a file is open for\n\
1902 @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC}\n\
1905 #if defined (O_WRONLY)
1908 error (
"O_WRONLY: not available on this system");
1913 #if !defined (WNOHANG)
1919 @deftypefn {Built-in Function} {} WNOHANG ()\n\
1920 Return the numerical value of the option argument that may be\n\
1921 passed to @code{waitpid} to indicate that it should return its\n\
1922 status immediately instead of waiting for a process to exit.\n\
1923 @seealso{waitpid, WUNTRACED, WCONTINUE}\n\
1929 #if !defined (WUNTRACED)
1935 @deftypefn {Built-in Function} {} WUNTRACED ()\n\
1936 Return the numerical value of the option argument that may be\n\
1937 passed to @code{waitpid} to indicate that it should also return\n\
1938 if the child process has stopped but is not traced via the\n\
1939 @code{ptrace} system call\n\
1940 @seealso{waitpid, WNOHANG, WCONTINUE}\n\
1946 #if !defined (WCONTINUE)
1952 @deftypefn {Built-in Function} {} WCONTINUE ()\n\
1953 Return the numerical value of the option argument that may be\n\
1954 passed to @code{waitpid} to indicate that it should also return\n\
1955 if a stopped child has been resumed by delivery of a @code{SIGCONT}\n\
1957 @seealso{waitpid, WNOHANG, WUNTRACED}\n\