Lines Matching +defs:major +defs:mode
165 // flags: 1=make last dir (with mode lastmode, otherwise skips last component)
186 mode_t mode = (0777&~toys.old_umask)|0300;
194 // Use the mode from the -m option only for the last directory.
196 if (flags&1) mode = lastmode;
200 if (mkdirat(atfd, dir, mode)) {
764 int wfchmodat(int fd, char *name, mode_t mode)
766 int rc = fchmodat(fd, name, mode, 0);
769 perror_msg("chmod '%s' to %04o", name, mode);
937 // premute mode bits based on posix mode strings.
938 mode_t string_to_mode(char *modestr, mode_t mode)
942 mode_t extrabits = mode & ~(07777);
944 // Handle octal mode
946 mode = estrtol(str, &s, 8);
947 if (errno || *s || (mode & ~(07777))) goto barf;
949 return mode | extrabits;
978 if ((dowhat&32) && (S_ISDIR(mode) || (mode&0111))) dowhat |= 1;
980 // Copy mode from another category?
982 dowhat = (mode>>(3*(s-whys)))&7;
989 // Ok, apply the bits to the mode.
1010 if (dohow == '=' || (bit && dohow == '-')) mode &= ~where;
1011 if (bit && dohow != '-') mode |= where;
1018 return mode|extrabits;
1020 error_exit("bad mode '%s'", modestr);
1023 // Format access mode into a drwxrwxrwx string
1024 void mode_to_string(mode_t mode, char *buf)
1031 bit = mode & (1<<i);
1033 if (!c && (mode & (1<<((d=i/3)+9)))) {
1040 if (S_ISDIR(mode)) c = 'd';
1041 else if (S_ISBLK(mode)) c = 'b';
1042 else if (S_ISCHR(mode)) c = 'c';
1043 else if (S_ISLNK(mode)) c = 'l';
1044 else if (S_ISFIFO(mode)) c = 'p';
1045 else if (S_ISSOCK(mode)) c = 's';
1250 int dev_makedev(int major, int minor)
1252 return (minor&0xff)|((major&0xfff)<<8)|((minor&0xfff00)<<12);