From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/etc/getuid.x | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 sys/etc/getuid.x (limited to 'sys/etc/getuid.x') diff --git a/sys/etc/getuid.x b/sys/etc/getuid.x new file mode 100644 index 00000000..3da5bbba --- /dev/null +++ b/sys/etc/getuid.x @@ -0,0 +1,24 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# GETUID -- Get user id, i.e., return the name of the user. We do this by +# creating a temporary file and calling fowner to get the name of the file +# owner. + +procedure getuid (user_name, maxch) + +char user_name[ARB] +int maxch +pointer sp, tempfile +int open() + +begin + call smark (sp) + call salloc (tempfile, SZ_FNAME, TY_CHAR) + + call mktemp ("tmp$uid", Memc[tempfile], SZ_FNAME) + call close (open (Memc[tempfile], NEW_FILE, BINARY_FILE)) + call fowner (Memc[tempfile], user_name, maxch) + call delete (Memc[tempfile]) + + call sfree (sp) +end -- cgit