Lines Matching refs:flags
103 getfsids(Sfio_t* sp, const char* name, int flags, register int lastchar)
112 if (flags & O_FLAG) flags = 1;
113 else flags = 0;
115 else if (flags & N_FLAG) flags = 1;
116 else flags = -1;
123 if (flags > 0) x = 0;
155 if (flags > 0) sfprintf(sp, "%s", s);
162 if (flags < 0) sfprintf(sp, "%u", fs->fs_id);
178 putid(Sfio_t* sp, int flags, const char* label, const char* name, long number)
181 if (flags & O_FLAG)
194 getids(Sfio_t* sp, const char* name, register int flags)
218 if (flags & GG_FLAG)
247 flags |= X_FLAG;
248 if (!(flags & N_FLAG) || (flags & (G_FLAG|GG_FLAG)))
261 if (!(flags & N_FLAG) || (flags & S_FLAG))
275 if (flags & G_FLAG)
276 group = (flags & R_FLAG) ? getgid() : getegid();
277 if (flags & (GG_FLAG|N_FLAG|U_FLAG))
278 user = (flags & R_FLAG) ? getuid() : geteuid();
280 if (flags & S_FLAG)
283 if (flags & N_FLAG)
288 if ((flags & N_FLAG) && (flags & G_FLAG))
291 if ((flags & N_FLAG) && (flags & S_FLAG))
297 if ((flags & (U_FLAG|G_FLAG|S_FLAG)) == (U_FLAG|G_FLAG|S_FLAG))
299 putid(sp, flags, "uid", name, user);
300 putid(sp, flags, " gid", gname, group);
301 if ((flags & X_FLAG) && name)
317 if (flags & O_FLAG)
326 getfsids(sp, name, flags, '=');
332 putid(sp, flags, " euid", (pw = getpwuid(euid)) ? pw->pw_name : (char*)0, euid);
334 putid(sp, flags, " egid", (grp = getgrgid(egid)) ? grp->gr_name : (char*)0, egid);
345 if (flags & O_FLAG) sfprintf(sp, "%s", grp->gr_name);
353 putid(sp, flags, " fsid", fs_name, fs_id);
359 if (flags & U_FLAG)
361 if ((flags & N_FLAG) && name) sfputr(sp, name, '\n');
364 else if (flags & G_FLAG)
366 if ((flags & N_FLAG) && gname) sfputr(sp, gname, '\n');
369 else if (flags & GG_FLAG)
371 if ((flags & X_FLAG) && name)
384 if (flags & N_FLAG) sfprintf(sp, "%s", grp->gr_name);
398 if ((flags & N_FLAG) && (grp = getgrgid(group)))
408 else if (flags & S_FLAG)
410 if ((flags & X_FLAG) && name) getfsids(sp, name, flags, 0);
411 else if ((flags & N_FLAG) && fs_name) sfputr(sp, fs_name, '\n');
421 register int flags = 0;
432 flags |= GG_FLAG;
435 flags |= G_FLAG;
438 flags |= N_FLAG;
441 flags |= R_FLAG;
444 flags |= S_FLAG;
447 flags |= U_FLAG;
460 n = (flags & (GG_FLAG|G_FLAG|S_FLAG|U_FLAG));
465 if (!(flags & ~(N_FLAG|R_FLAG)))
467 if (flags & N_FLAG) flags |= O_FLAG;
468 flags |= (U_FLAG|G_FLAG|N_FLAG|R_FLAG|S_FLAG|GG_FLAG);
470 error_info.errors = getids(sfstdout, *argv, flags);