[comp.sys.apollo] Help needed on sys calls to get user, group names

ssridhar@pase60.Convergent.Com (Srinivasan Sridhar) (04/18/91)

I need help on two subjects- both involving system calls in Sys 5.

How do you get USER and GROUP NAMES using sys calls ?
===================================================

1. Using system calls (such as ios_$ and name_$), the call should return/
   point to user name of the person executing the object code.  It does not
   matter if the call looks up the /etc/passwd and other /etc files to do
   so.

   I have examined the Sys V Progammers reference,
		       Domain/OS Call Reference (Volumes I and II)
		       and other related manuals.
   I have not seen any function that does this easily.  Alternatively,
   is there a way I can use the getuid() calls to acheive this ??

2. A system call to return/point to the owner and group of an object.


Are there any system calls that perform the same function as chacl ?
==================================================================

Using Sys V calls, the program should change the acls of an object. 
Is there a call to do this ?

The next question was again posed to Apollo, Chelmsford and the reply 
that I got only made it more confusing !

Help with the name_$read_dir_lc() call
======================================

This call has been declared as a void.  But the description says that the
call supplies a list of canonical directory entries.  Now name_$read....()
cannot be the object type name_$canonical_dir_entry_t (because of ANSI C
rules saying that a void function cannot return values _or_ be cast to
other object types).

Also, one of the arguments to the function namely *dir_list seems to be the
best candidate to return a directory list of the form name_$canonical_..._t.
But this variable has been declared a pointer to a char.

The question is- how do I get name_$canonical_dir_entries_t from the
function?

BTW, the obsolete form of this same system call seemed to return the
complete structure associated with directory entries thru' *dir_list.
i.e, name_$read_dir(...,*dir_list,...) used to return the structure 
associated with a directory thru' *dir_list.  For some reason this 
drastically changed with the implementation of the _lc extension.

========================================================================
Srinivasan Sridhar 				ssridhar@convergent.com
UNIX Systems Group, UNISYS NCG, San Jose, CA    (408) 435-7660
========================================================================

DERSTAD@CIM-VAX.HONEYWELL.COM (04/21/91)

>  Also, one of the arguments to the function namely *dir_list seems to be the
>  best candidate to return a directory list of the form name_$canonical_..._t.
>  But this variable has been declared a pointer to a char.

If you check the help file for name_$read_dir_lc, you'll note

   "To extract information from dir_data, programmers should treat it
    as a pointer to an object of the type name_$canonical_dir_entry_t.
    The entnxt field gives the offset within dir_data of the
    next record..."

Dave Erstad
DERSTAD@cim-vax.honeywell.com
Honeywell SSEC