* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
static const char sccsid[] = "@(#)conv.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/hexdump/conv.c,v 1.8 2004/07/16 11:07:07 johan Exp $");
+__FBSDID("$FreeBSD$");
#include <sys/types.h>
wchar_t wc;
size_t clen, oclen;
int converr, pad, width;
- char peekbuf[MB_LEN_MAX];
+ u_char peekbuf[MB_LEN_MAX];
if (pr->mbleft > 0) {
str = "**";
if (clen == 0)
clen = 1;
else if (clen == (size_t)-1 || (clen == (size_t)-2 &&
- buf == peekbuf)) {
+ p == peekbuf)) {
memset(&pr->mbstate, 0, sizeof(pr->mbstate));
wc = *p;
clen = 1;
* can complete it.
*/
oclen = bufsize;
- bufsize = peek(p = (u_char *)peekbuf, MB_CUR_MAX);
+ bufsize = peek(p = peekbuf, MB_CUR_MAX);
goto retry;
}
clen += oclen;
*pr->cchar = 'C';
assert(strcmp(pr->fmt, "%3C") == 0);
width = wcwidth(wc);
- assert(width > 0);
+ assert(width >= 0);
pad = 3 - width;
if (pad < 0)
pad = 0;
Appending the character
.Cm b ,
.Cm k ,
+.Cm m ,
or
-.Cm m
+.Cm g
to
.Ar offset
causes it to be interpreted as a multiple of
.Li 512 ,
.Li 1024 ,
-or
.Li 1048576 ,
+or
+.Li 1073741824 ,
respectively.
.It Fl v
Cause
.Nm
.Fl A
.Nm
+.Fl F
+.Op Ar user
+.Nm
.Fl G Op Fl n
.Op Ar user
.Nm
.It Fl A
Display the process audit user ID and other process audit properties, which
requires privilege.
+.It Fl F
+Display the full name of the user.
.It Fl G
Display the different group IDs (effective, real and supplementary)
as white-space separated numbers, in no particular order.
void pline(struct passwd *);
void pretty(struct passwd *);
void auditid(void);
+void fullname(struct passwd *);
void group(struct passwd *, int);
void maclabel(void);
void usage(void);
struct passwd *pw;
int Gflag, Mflag, Pflag, ch, gflag, id, nflag, pflag, rflag, uflag;
int Aflag;
+ int Fflag;
const char *myname;
Gflag = Mflag = Pflag = gflag = nflag = pflag = rflag = uflag = 0;
Aflag = 0;
+ Fflag = 0;
myname = strrchr(argv[0], '/');
myname = (myname != NULL) ? myname + 1 : argv[0];
}
while ((ch = getopt(argc, argv,
- (isgroups || iswhoami) ? "" : "APGMagnpru")) != -1)
+ (isgroups || iswhoami) ? "" : "AFPGMagnpru")) != -1)
switch(ch) {
#ifdef USE_BSM_AUDIT
case 'A':
Aflag = 1;
break;
#endif
+ case 'F':
+ Fflag = 1;
+ break;
case 'G':
Gflag = 1;
break;
if (iswhoami && argc > 0)
usage();
- switch(Aflag + Gflag + Mflag + Pflag + gflag + pflag + uflag) {
+ switch(Aflag + Fflag + Gflag + Mflag + Pflag + gflag + pflag + uflag) {
case 1:
break;
case 0:
}
#endif
+ if (Fflag) {
+ fullname(pw);
+ exit(0);
+ }
+
if (gflag) {
id = pw ? pw->pw_gid : rflag ? getgid() : getegid();
if (nflag && (gr = getgrgid(id)))
}
#endif
+void
+fullname(struct passwd *pw)
+{
+
+ if (!pw) {
+ if ((pw = getpwuid(getuid())) == NULL)
+ err(1, "getpwuid");
+ }
+
+ (void)printf("%s\n", pw->pw_gecos);
+}
+
void
group(struct passwd *pw, int nflag)
{
#endif
} else {
#ifdef __APPLE__
- groups = malloc(NGROUPS + 1);
+ groups = malloc((NGROUPS + 1) * sizeof(gid_t));
#endif
groups[0] = getgid();
ngroups = getgroups(NGROUPS, groups + 1) + 1;
else if (iswhoami)
(void)fprintf(stderr, "usage: whoami\n");
else
- (void)fprintf(stderr, "%s\n%s%s\n%s\n%s\n%s\n%s\n%s\n",
+ (void)fprintf(stderr, "%s\n%s%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
"usage: id [user]",
#ifdef USE_BSM_AUDIT
" id -A\n",
#else
"",
#endif
+ " id -F [user]",
" id -G [-n] [user]",
" id -M",
" id -P [user]",
.Pp
The options are as follows:
.Bl -tag -width 10n -offset indent
-.It Fl d | v
+.It Fl v
Be more verbose about what will be done.
-For a single
-.Fl d
-option, a list of the processes that will be sent the signal will be
-printed, or a message indicating that no matching processes have been
-found.
.It Fl e
Use the effective user ID instead of the (default) real user ID for matching
processes specified with the
running under the real UID of the caller.
.It Fl s
Show only what would be done, but do not send any signal.
+.It Fl d
+Print detailed information about the processes matched,
+but do not send any signal.
.It Fl SIGNAL
Send a different signal instead of the default
.Dv TERM .
FCBA142A14A141A300AA698B /* xargs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = xargs.c; sourceTree = "<group>"; };
FCBA142D14A141A300AA698B /* yes.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = yes.1; sourceTree = "<group>"; };
FCBA142E14A141A300AA698B /* yes.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = yes.c; sourceTree = "<group>"; };
- FCBA149E14A141FF00AA698B /* alias copy */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = "alias copy"; path = apply; sourceTree = BUILT_PRODUCTS_DIR; };
+ FCBA149E14A141FF00AA698B /* apply */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = apply; sourceTree = BUILT_PRODUCTS_DIR; };
FCBA14B414A1422D00AA698B /* basename */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = basename; sourceTree = BUILT_PRODUCTS_DIR; };
FCBA14BD14A1423E00AA698B /* chroot */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = chroot; sourceTree = BUILT_PRODUCTS_DIR; };
FCBA14C514A1426800AA698B /* date */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = date; sourceTree = BUILT_PRODUCTS_DIR; };
FCBA14D514A1433F00AA698B /* echo */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = echo; sourceTree = BUILT_PRODUCTS_DIR; };
FCBA14DD14A1434A00AA698B /* env */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = env; sourceTree = BUILT_PRODUCTS_DIR; };
FCBA151414A1453A00AA698B /* expr */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = expr; sourceTree = BUILT_PRODUCTS_DIR; };
- FCBA151C14A1454D00AA698B /* expr copy */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = "expr copy"; path = false; sourceTree = BUILT_PRODUCTS_DIR; };
+ FCBA151C14A1454D00AA698B /* false */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = false; sourceTree = BUILT_PRODUCTS_DIR; };
FCBA152414A1455600AA698B /* find */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = find; sourceTree = BUILT_PRODUCTS_DIR; };
FCBA152C14A1455900AA698B /* getopt */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = getopt; sourceTree = BUILT_PRODUCTS_DIR; };
FCBA153414A1455C00AA698B /* hostname */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = hostname; sourceTree = BUILT_PRODUCTS_DIR; };
FC80BF6114A05A2F00C6F7F5 /* Products */ = {
isa = PBXGroup;
children = (
- FCBA149E14A141FF00AA698B /* alias copy */,
+ FCBA149E14A141FF00AA698B /* apply */,
FCBA14B414A1422D00AA698B /* basename */,
FCBA14BD14A1423E00AA698B /* chroot */,
FCBA14C514A1426800AA698B /* date */,
FCBA14D514A1433F00AA698B /* echo */,
FCBA14DD14A1434A00AA698B /* env */,
FCBA151414A1453A00AA698B /* expr */,
- FCBA151C14A1454D00AA698B /* expr copy */,
+ FCBA151C14A1454D00AA698B /* false */,
FCBA152414A1455600AA698B /* find */,
FCBA152C14A1455900AA698B /* getopt */,
FCBA153414A1455C00AA698B /* hostname */,
);
name = apply;
productName = shell_cmds;
- productReference = FCBA149E14A141FF00AA698B /* alias copy */;
+ productReference = FCBA149E14A141FF00AA698B /* apply */;
productType = "com.apple.product-type.tool";
};
FCBA14AE14A1422D00AA698B /* basename */ = {
);
name = false;
productName = shell_cmds;
- productReference = FCBA151C14A1454D00AA698B /* expr copy */;
+ productReference = FCBA151C14A1454D00AA698B /* false */;
productType = "com.apple.product-type.tool";
};
FCBA151E14A1455600AA698B /* find */ = {
.St -p1003.2-92 .
.El
.Pp
-The
-.Xr csh 1
-has its own and syntactically different builtin version of
-.Nm .
-The utility described here
-is available as
-.Pa /usr/bin/time
-to
-.Xr csh
-users.
+Some shells may provide a builtin
+.Nm
+command which is similar or identical to this utility.
+Consult the
+.Xr builtin 1
+manual page.
.Sh DIAGNOSTICS
The
.Nm
shall be that of
.Ar utility .
.Sh SEE ALSO
+.Xr builtin 1 ,
.Xr csh 1 ,
.Xr getrusage 2
.Sh FILES
#else
#if defined(__ppc__) || defined(__ppc64__)
fputs("powerpc", stdout);
-#elif defined (__i386__) || defined(__x86_64__)
+#elif defined(__i386__) || defined(__x86_64__)
fputs("i386", stdout);
-#elif defined(__arm__)
+#elif defined(__arm__) || defined(__arm64__)
fputs("arm", stdout);
#else
fputs("unknown", stdout);