Mercurial > octave
changeset 21727:e0da98857c19
rename octave::syscalls namespace to octave::sys
* oct-syscalls.h: Rename octave::syscalls namespace to octave::sys.
Change all uses.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 18 May 2016 12:14:34 -0400 |
parents | f05a00e611ff |
children | c218a5b31ad7 |
files | libinterp/corefcn/oct-procbuf.cc libinterp/corefcn/sighandlers.cc libinterp/corefcn/syscalls.cc liboctave/system/oct-env.cc liboctave/system/oct-syscalls.cc liboctave/system/oct-syscalls.h |
diffstat | 6 files changed, 31 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/oct-procbuf.cc Wed May 18 15:17:00 2016 -0400 +++ b/libinterp/corefcn/oct-procbuf.cc Wed May 18 12:14:34 2016 -0400 @@ -90,7 +90,7 @@ if (is_open ()) return 0; - if (octave::syscalls::pipe (pipe_fds) < 0) + if (octave::sys::pipe (pipe_fds) < 0) return 0; if (mode & std::ios::in) @@ -202,7 +202,7 @@ do { - wait_pid = octave::syscalls::waitpid (proc_pid, &wstatus, 0); + wait_pid = octave::sys::waitpid (proc_pid, &wstatus, 0); } while (wait_pid == -1 && errno == EINTR); }
--- a/libinterp/corefcn/sighandlers.cc Wed May 18 15:17:00 2016 -0400 +++ b/libinterp/corefcn/sighandlers.cc Wed May 18 12:14:34 2016 -0400 @@ -1021,7 +1021,7 @@ { int status; - if (octave::syscalls::waitpid (pid, &status, WNOHANG) > 0) + if (octave::sys::waitpid (pid, &status, WNOHANG) > 0) { oc.have_status = 1;
--- a/libinterp/corefcn/syscalls.cc Wed May 18 15:17:00 2016 -0400 +++ b/libinterp/corefcn/syscalls.cc Wed May 18 12:14:34 2016 -0400 @@ -122,7 +122,7 @@ { std::string msg; - int status = octave::syscalls::dup2 (i_old, i_new, msg); + int status = octave::sys::dup2 (i_old, i_new, msg); return ovl (status, msg); } @@ -187,7 +187,7 @@ std::string msg; - int status = octave::syscalls::execvp (exec_file, exec_args, msg); + int status = octave::sys::execvp (exec_file, exec_args, msg); return ovl (status, msg); } @@ -274,7 +274,7 @@ std::string msg; pid_t pid; - pid = octave::syscalls::popen2 (exec_file, arg_list, sync_mode, + pid = octave::sys::popen2 (exec_file, arg_list, sync_mode, filedesc, msg, interactive); if (pid < 0) error (msg.c_str ()); @@ -440,7 +440,7 @@ std::string msg; - int status = octave::syscalls::fcntl (fid, req, arg, msg); + int status = octave::sys::fcntl (fid, req, arg, msg); return ovl (status, msg); } @@ -476,7 +476,7 @@ std::string msg; - pid_t pid = octave::syscalls::fork (msg); + pid_t pid = octave::sys::fork (msg); return ovl (pid, msg); } @@ -492,7 +492,7 @@ std::string msg; - pid_t pid = octave::syscalls::getpgrp (msg); + pid_t pid = octave::sys::getpgrp (msg); return ovl (pid, msg); } @@ -507,7 +507,7 @@ if (args.length () != 0) print_usage (); - return ovl (octave::syscalls::getpid ()); + return ovl (octave::sys::getpid ()); } DEFUNX ("getppid", Fgetppid, args, , @@ -520,7 +520,7 @@ if (args.length () != 0) print_usage (); - return ovl (octave::syscalls::getppid ()); + return ovl (octave::sys::getppid ()); } DEFUNX ("getegid", Fgetegid, args, , @@ -533,7 +533,7 @@ if (args.length () != 0) print_usage (); - return ovl (octave::syscalls::getegid ()); + return ovl (octave::sys::getegid ()); } DEFUNX ("getgid", Fgetgid, args, , @@ -546,7 +546,7 @@ if (args.length () != 0) print_usage (); - return ovl (octave::syscalls::getgid ()); + return ovl (octave::sys::getgid ()); } DEFUNX ("geteuid", Fgeteuid, args, , @@ -559,7 +559,7 @@ if (args.length () != 0) print_usage (); - return ovl (octave::syscalls::geteuid ()); + return ovl (octave::sys::geteuid ()); } DEFUNX ("getuid", Fgetuid, args, , @@ -572,7 +572,7 @@ if (args.length () != 0) print_usage (); - return ovl (octave::syscalls::getuid ()); + return ovl (octave::sys::getuid ()); } DEFUNX ("kill", Fkill, args, , @@ -606,7 +606,7 @@ std::string msg; - int status = octave::syscalls::kill (pid, sig, msg); + int status = octave::sys::kill (pid, sig, msg); return ovl (status, msg); } @@ -725,7 +725,7 @@ int fid[2]; std::string msg; - int status = octave::syscalls::pipe (fid, msg); + int status = octave::sys::pipe (fid, msg); if (status < 0) return ovl (-1, -1, -1, msg); @@ -1132,7 +1132,7 @@ std::string msg; int status; - pid_t result = octave::syscalls::waitpid (pid, &status, options, msg); + pid_t result = octave::sys::waitpid (pid, &status, options, msg); return ovl (result, status, msg); }
--- a/liboctave/system/oct-env.cc Wed May 18 15:17:00 2016 -0400 +++ b/liboctave/system/oct-env.cc Wed May 18 12:14:34 2016 -0400 @@ -479,7 +479,7 @@ if (hd.empty ()) { - octave_passwd pw = octave_passwd::getpwuid (octave::syscalls::getuid ()); + octave_passwd pw = octave_passwd::getpwuid (octave::sys::getuid ()); hd = pw ? pw.dir () : std::string (file_ops::dir_sep_str ()); } @@ -492,7 +492,7 @@ { if (user_name.empty ()) { - octave_passwd pw = octave_passwd::getpwuid (octave::syscalls::getuid ()); + octave_passwd pw = octave_passwd::getpwuid (octave::sys::getuid ()); user_name = pw ? pw.name () : std::string ("unknown"); }
--- a/liboctave/system/oct-syscalls.cc Wed May 18 15:17:00 2016 -0400 +++ b/liboctave/system/oct-syscalls.cc Wed May 18 12:14:34 2016 -0400 @@ -50,13 +50,13 @@ namespace octave { namespace - syscalls + sys { int dup2 (int old_fd, int new_fd) { std::string msg; - return octave::syscalls::dup2 (old_fd, new_fd, msg); + return octave::sys::dup2 (old_fd, new_fd, msg); } int @@ -82,7 +82,7 @@ execvp (const std::string& file, const string_vector& argv) { std::string msg; - return octave::syscalls::execvp (file, argv, msg); + return octave::sys::execvp (file, argv, msg); } int @@ -228,7 +228,7 @@ pipe (int *fildes) { std::string msg; - return octave::syscalls::pipe (fildes, msg); + return octave::sys::pipe (fildes, msg); } int @@ -250,7 +250,7 @@ waitpid (pid_t pid, int *status, int options) { std::string msg; - return octave::syscalls::waitpid (pid, status, options, msg); + return octave::sys::waitpid (pid, status, options, msg); } pid_t @@ -276,7 +276,7 @@ kill (pid_t pid, int sig) { std::string msg; - return octave::syscalls::kill (pid, sig, msg); + return octave::sys::kill (pid, sig, msg); } int @@ -304,7 +304,7 @@ { std::string msg; bool interactive = false; - return octave::syscalls::popen2 (cmd, args, sync_mode, fildes, msg, + return octave::sys::popen2 (cmd, args, sync_mode, fildes, msg, interactive); } @@ -313,7 +313,7 @@ bool sync_mode, int *fildes, std::string& msg) { bool interactive = false; - return octave::syscalls::popen2 (cmd, args, sync_mode, fildes, msg, + return octave::sys::popen2 (cmd, args, sync_mode, fildes, msg, interactive); } @@ -372,7 +372,7 @@ #if defined (F_SETFL) && defined (O_NONBLOCK) if (! sync_mode - && octave::syscalls::fcntl (child_stdout[0], F_SETFL, + && octave::sys::fcntl (child_stdout[0], F_SETFL, O_NONBLOCK, msg) < 0) msg = "popen2: error setting file mode -- " + msg; else @@ -403,7 +403,7 @@ fcntl (int fd, int cmd, long arg) { std::string msg; - return octave::syscalls::fcntl (fd, cmd, arg, msg); + return octave::sys::fcntl (fd, cmd, arg, msg); } int