# HG changeset patch # User jwe # Date 847253538 0 # Node ID 0c788e9b53b88a5cedbff56ff4a1c9cbf7cb5cf7 # Parent 7f99808d467d23c9e8554c1a316e7fcd0effc79c [project @ 1996-11-06 04:10:07 by jwe] diff -r 7f99808d467d -r 0c788e9b53b8 ChangeLog --- a/ChangeLog Tue Nov 05 21:55:53 1996 +0000 +++ b/ChangeLog Wed Nov 06 04:12:18 1996 +0000 @@ -1,5 +1,7 @@ Tue Nov 5 12:32:30 1996 John W. Eaton + * configure.in: Add checks for geteuid, getuid. + * configure.in: Comment out code to handle --enable-readline since it doesn't work yet. diff -r 7f99808d467d -r 0c788e9b53b8 configure.in --- a/configure.in Tue Nov 05 21:55:53 1996 +0000 +++ b/configure.in Wed Nov 06 04:12:18 1996 +0000 @@ -20,7 +20,7 @@ ### along with Octave; see the file COPYING. If not, write to the Free ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -AC_REVISION($Revision: 1.225 $) +AC_REVISION($Revision: 1.227 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -179,7 +179,7 @@ READLINE_DIR=readline USE_READLINE=true LIBREADLINE=-lreadline -dnlAC_ARG_ENABLE(readline, +dnl AC_ARG_ENABLE(readline, dnl [ --enable-readline use readline library (default is yes)], dnl [if test "$enableval" = no; then dnl USE_READLINE=false; @@ -696,13 +696,13 @@ ### Checks for functions and variables. AC_CHECK_FUNCS(atexit bcopy bzero dup2 endpwent execvp fcntl fork \ - getcwd gethostname getpgrp getpid getppid getpwent \ - getpwnam getpwuid lstat memmove mkdir mkfifo on_exit \ - pipe putenv rename rindex rmdir setpwent setvbuf \ - sigaction sigpending sigprocmask sigsuspend stat \ - strcasecmp strdup strerror stricmp strncasecmp \ - strnicmp tempnam umask unlink vfprintf vsprintf \ - waitpid) + getcwd geteuid gethostname getpgrp getpid getppid \ + getpwent getpwnam getpwuid getuid lstat memmove mkdir \ + mkfifo on_exit pipe putenv rename rindex rmdir \ + setpwent setvbuf sigaction sigpending sigprocmask \ + sigsuspend stat strcasecmp strdup strerror stricmp \ + strncasecmp strnicmp tempnam umask unlink vfprintf \ + vsprintf waitpid) OCTAVE_SMART_PUTENV OCTAVE_PROGRAM_INVOCATION_NAME diff -r 7f99808d467d -r 0c788e9b53b8 src/ChangeLog --- a/src/ChangeLog Tue Nov 05 21:55:53 1996 +0000 +++ b/src/ChangeLog Wed Nov 06 04:12:18 1996 +0000 @@ -1,5 +1,10 @@ Tue Nov 5 13:00:35 1996 John W. Eaton + * syscalls.cc (Fgeteuid, Fgetuid): New functions. + + * getpwent.cc: Use gripe_not_supported from gripes.cc, instead of + local gripe_not_implemented function. + * input.cc, sysdep.cc, variables.cc: Only include readline.h and history.h if USE_READLINE is defined. diff -r 7f99808d467d -r 0c788e9b53b8 src/getpwent.cc --- a/src/getpwent.cc Tue Nov 05 21:55:53 1996 +0000 +++ b/src/getpwent.cc Wed Nov 06 04:12:18 1996 +0000 @@ -36,6 +36,7 @@ #include "defun-dld.h" #include "error.h" +#include "gripes.h" #include "help.h" #include "oct-map.h" #include "ov.h" @@ -69,16 +70,6 @@ return retval; } -#if ! (defined (HAVE_GETPWENT) || defined (HAVE_GETPWUID) \ - || defined (HAVE_GETPWNAM) || defined (HAVE_SETPWENT) \ - || defined (HAVE_ENDPWENT)) -static void -gripe_not_implemented (const char *nm) -{ - error ("%s: not implemented on this system", nm); -} -#endif - DEFUN_DLD (getpwent, , , "getpwent ()\n\ \n\ @@ -87,9 +78,14 @@ octave_value retval; #ifdef HAVE_GETPWENT - retval = mk_pw_map (getpwent ()); + int nargin = args.length (); + + if (nargin == 0) + retval = mk_pw_map (getpwent ()); + else + print_usage ("getpwent"); #else - gripe_not_implemented ("getpwent"); + gripe_not_supported ("getpwent"); #endif return retval; @@ -124,7 +120,7 @@ else print_usage ("getpwuid"); #else - gripe_not_implemented ("getpwuid"); + gripe_not_supported ("getpwuid"); #endif return retval; @@ -150,7 +146,7 @@ else print_usage ("getpwnam"); #else - gripe_not_implemented ("getpwnam"); + gripe_not_supported ("getpwnam"); #endif return retval; @@ -164,9 +160,14 @@ octave_value retval; #ifdef HAVE_SETPWENT - setpwent (); + int nargin = args.length (); + + if (nargin == 0) + setpwent (); + else + print_usage ("setpwent"); #else - gripe_not_implemented ("setpwent"); + gripe_not_supported ("setpwent"); #endif return retval; @@ -180,9 +181,14 @@ octave_value retval; #ifdef HAVE_ENDPWENT - endpwent (); + int nargin = args.length (); + + if (nargin == 0) + endpwent (); + else + print_usage ("endpwent"); #else - gripe_not_implemented ("endpwent"); + gripe_not_supported ("endpwent"); #endif return retval; diff -r 7f99808d467d -r 0c788e9b53b8 src/syscalls.cc --- a/src/syscalls.cc Tue Nov 05 21:55:53 1996 +0000 +++ b/src/syscalls.cc Wed Nov 06 04:12:18 1996 +0000 @@ -309,6 +309,40 @@ return retval; } +DEFUN (geteuid, , , + "uid = geteuid (): return the effective user id of the current process") +{ + double retval = -1.0; + +#if defined (HAVE_GETEUID) + int nargin = args.length (); + + if (nargin == 0) + retval = geteuid (); + else + print_usage ("geteuid"); +#else + gripe_not_supported ("geteuid"); +#endif +} + +DEFUN (getuid, , , + "uid = getuid (): return the real user id of the current process") +{ + double retval = -1.0; + +#if defined (HAVE_GETUID) + int nargin = args.length (); + + if (nargin == 0) + retval = getuid (); + else + print_usage ("getuid"); +#else + gripe_not_supported ("getuid"); +#endif +} + DEFUN (lstat, args, , "[S, ERR, MSG] = lstat (NAME)\n\ \n\