From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 24-SEP-1990 17:24:03.22
To:	MRGATE::"ARISIA::EVERHART"
CC:	
Subj:	RE: Help with getting username

Received:  by crdgw1.ge.com (5.57/GE 1.73)
	 id AA11616; Mon, 24 Sep 90 16:53:14 EDT
Received: From CRDGW1.GE.COM by CRVAX.SRI.COM with TCP; Mon, 24 SEP 90 10:21:36 PDT
Received:  by crdgw1.ge.com (5.57/GE 1.73)
	 id AA02175; Mon, 24 Sep 90 13:12:56 EDT
Date:  Mon, 24 Sep 90 13:12:56 EDT
Message-Id:  <9009241712.AA02175@crdgw1.ge.com>
From: sessions%sparev.DECNET@crdgw1 (Zack Sessions 8*292-5517)
To: info-vax@sparev.DECNET
Subject: RE: Help with getting username

Sanjay Jain, University of Wisconsin-Eau Claire asks:
>I need to check the username for the person running a C program and check it
>against an entry in a single - file database. I am using C and RDML. What is
>the easiest way of doing this.

Try the cuserid() function.

$ create username.c
#include <stdio.h>
#include <stdlib.h>
main()
{
	char username[13];
	printf("Your username is %s\n",cuserid(NULL));
	cuserid(username);
	printf("Your username is still %s\n",username);
}
^Z
$ cc username.c
$ link username
$ run username
Your username is SESSIONS
Your username is still SESSIONS

Get the idea?

(you must not have the C documentation)

Zack C. Sessions
Sessions@Sparev.dnet.ge.com (Internet)
Sessions%Sparev.dnet.ge.com@crdgw1.ge.com (Alternate Internet)
...!uflorida!ki4pv!macs!stetson!rewop!sencland!sessions (UUCP at home)

