home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!ucbvax!NSCVAX.PRINCETON.EDU!dragon
- From: dragon@NSCVAX.PRINCETON.EDU (Mighty Firebreather)
- Newsgroups: comp.os.vms
- Subject: RE: sys$change_acl()
- Message-ID: <0095E640.E5B7A140.7754@nscvax.princeton.edu>
- Date: 31 Jul 92 14:03:13 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: world
- Organization: The Internet
- Lines: 64
-
-
- Robert Alan Whitaker, Jr. <RW764419@PUCAL.BITNET> writes:
- >
- > For some time now, I have been trying to get the sys$change_acl system
- >function to work, and have been unsuccessful. I have succeeded in creating
- >new files with ACL's attached to them, using sys$create(), but I would also
- >like to be able to change current files. I believe that my problem lies in
- >the itmlst parameter of the sys$change_acl() function, but I haven't been able
- >to figure it out, nor have I been able to find a description of the itmlst
- >structure, other than what it says in one of the manuals, which says that it
- >should contain: code (word), buflen (word), bufadr (long word), and unused
- >(long word), which led me to believe that it should be of the following
- >format:
- >
- >struct itmlst {
- > unsigned int code;
- > unsigned int buflen;
- > unsigned long int bufadr; /* or char *bufadr; */
- > unsigned long int unused; /* or char *unused; */
- > };
- >
- >I have not been able to get this and many other (my version number is about
- >220 now) variations to work.
- >
- >Does anyone know the correct syntax for this?
- >
- >Does anyone have an example in C that they could send me???
- >
-
-
- You have committed the sin of assuming that "int" specifies a
- particular length. It does not! On VMS "int" happens to be the same as
- "long"; e.g. a long word (32 bits). "short" and "long" specify short and
- long integers respectively; int can be either, depending on the pleasure of
- the implementor. "short" and "long" do not necessarily mean 16 and 32 bits
- either; it could be 18 and 36 or whatever the computer architecture being
- used provides.
-
- Try:
-
- struct itmlst {
- unsigned short code;
- unsigned short buflen;
- unsigned long int bufadr; /* or char *bufadr; */
- unsigned long int unused; /* or char *unused; */
- };
-
- Be sure to follow the last itmlst with a longword of zero.
-
- And remember, to write portable code, code "int" only when you
- don't care how long it is. Obviously this particular case will not be
- portable since it depends on a VMS system service, but it's conceiveable
- that another compiler could have a different idea of the proper length of
- "int".
-
-
- *************************************************************************
- * *
- * Here, there be dragons! *
- * dragon@nscvax.princeton.edu *
- * *
- * Richard B. Gilbert *
- *************************************************************************
-
-