home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / vms / 12999 < prev    next >
Encoding:
Text File  |  1992-07-31  |  3.0 KB  |  76 lines

  1. Path: sparky!uunet!cis.ohio-state.edu!ucbvax!NSCVAX.PRINCETON.EDU!dragon
  2. From: dragon@NSCVAX.PRINCETON.EDU (Mighty Firebreather)
  3. Newsgroups: comp.os.vms
  4. Subject: RE: sys$change_acl()
  5. Message-ID: <0095E640.E5B7A140.7754@nscvax.princeton.edu>
  6. Date: 31 Jul 92 14:03:13 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 64
  11.  
  12.  
  13.     Robert Alan Whitaker, Jr. <RW764419@PUCAL.BITNET> writes:
  14. >
  15. >        For some time now, I have been trying to get the sys$change_acl system
  16. >function to work, and have been unsuccessful.  I have succeeded in creating
  17. >new files with ACL's attached to them, using sys$create(), but I would also
  18. >like to be able to change current files.  I believe that my problem lies in
  19. >the itmlst parameter of the sys$change_acl() function, but I haven't been able
  20. >to figure it out, nor have I been able to find a description of the itmlst
  21. >structure, other than what it says in one of the manuals, which says that it
  22. >should contain: code (word), buflen (word), bufadr (long word), and unused
  23. >(long word), which led me to believe that it should be of the following
  24. >format:
  25. >
  26. >struct itmlst {
  27. >        unsigned int code;
  28. >        unsigned int buflen;
  29. >        unsigned long int bufadr;  /* or char *bufadr; */
  30. >        unsigned long int unused;  /* or char *unused; */
  31. >        };
  32. >
  33. >I have not been able to get this and many other (my version number is about
  34. >220 now) variations to work.
  35. >
  36. >Does anyone know the correct syntax for this?
  37. >
  38. >Does anyone have an example in C that they could send me???
  39. >
  40.  
  41.  
  42.     You have committed the sin of assuming that "int" specifies a
  43. particular length.  It does not!  On VMS "int" happens to be the same as
  44. "long"; e.g. a long word (32 bits).  "short" and "long" specify short and
  45. long integers respectively; int can be either, depending on the pleasure of
  46. the implementor.  "short" and "long" do not necessarily mean 16 and 32 bits
  47. either; it could be 18 and 36 or whatever the computer architecture being
  48. used provides. 
  49.  
  50.     Try:
  51.  
  52. struct itmlst {
  53.         unsigned short code;
  54.         unsigned short buflen;
  55.         unsigned long int bufadr;  /* or char *bufadr; */
  56.         unsigned long int unused;  /* or char *unused; */
  57.         };
  58.  
  59.     Be sure to follow the last itmlst with a longword of zero.
  60.  
  61.     And remember, to write portable code, code "int" only when you 
  62. don't care how long it is.  Obviously this particular case will not be
  63. portable since it depends on a VMS system service, but it's conceiveable
  64. that another compiler could have a different idea of the proper length of
  65. "int".
  66.  
  67.  
  68. *************************************************************************
  69. *                                                                       *
  70. *                        Here, there be dragons!                        *
  71. *                      dragon@nscvax.princeton.edu                      *
  72. *                                                                       *
  73. *                                                Richard B. Gilbert     *
  74. *************************************************************************
  75.  
  76.