Lines Matching refs:class
26 printf("\tsets <path> to a protection class from A to F.\n");
27 printf("\tIf no class is specified, reports the current class for <path>.\n");
64 classtochar(int class)
66 if (class < 0) {
72 if (class == 0) {
76 return 'A' + (class - 1);
82 int error = 0, class = 0, do_set = 0, fd = 0;
90 class = chartoclass(*argv[2]);
100 * If we're trying to set the protection class, go through normal open(2).
122 * protection class even if the device is locked.
142 error = fcntl(fd, F_SETPROTECTIONCLASS, class);
144 char new_class = classtochar(class);
146 printf("could not set protection class (directory none): %s\n", strerror(errno));
149 printf("could not set protection class %c: %s\n", new_class, strerror(errno));
154 class = fcntl(fd, F_GETPROTECTIONCLASS);
155 if (class < 0) {
157 /* Directories are allowed to not have a class set. */
158 printf("%s has no protection class set\n", argv[1]);
161 printf("could not get protection class: %s\n", strerror(errno));
162 error = class;
166 char new_class = classtochar(class);
168 printf("%s is in protection class (directory none) \n", argv[1]);
171 printf("%s is in protection class %c\n", argv[1], new_class);