#ifndef lint
static char *RCSid = "$Id: rexxext.c,v 1.7 1993/02/09 17:30:13 anders Exp anders $";
#endif

/*
 *  The Regina Rexx Interpreter
 *  Copyright (C) 1992-1994  Anders Christensen <anders@pvv.unit.no>
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public
 *  License along with this library; if not, write to the Free
 *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include "rexx.h"
#include <stdio.h>
#if !defined(VMS)                                       /* MH 10-06-96 */
# ifdef HAVE_UNISTD_H
#  include <unistd.h>                                    /* MH 10-06-96 */
# endif
# if !defined(__WATCOMC__) && !defined(_MSC_VER)        /* MH 10-06-96 */
#  include <pwd.h>                                      /* MH 10-06-96 */
# endif                                                 /* MH 10-06-96 */
#endif

streng *rex_userid( paramboxptr parms ) 
{
   checkparam(  parms,  0,  0 , "USERID" ) ;
#if defined(VMS) || defined(__WATCOMC__) || defined(_MSC_VER) /* MH 10-06-96 */
   return nullstringptr() ;
#else
   return(Str_cre(getpwuid(getuid())->pw_name)) ;
#endif
}
