ls.c (94792) | ls.c (100495) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 23 unchanged lines hidden (view full) --- 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)ls.c 8.1 (Berkeley) 6/6/93"; 37#endif 38#endif /* not lint */ 39#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 23 unchanged lines hidden (view full) --- 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)ls.c 8.1 (Berkeley) 6/6/93"; 37#endif 38#endif /* not lint */ 39#include <sys/cdefs.h> |
40__FBSDID("$FreeBSD: head/usr.bin/find/ls.c 94792 2002-04-15 19:27:41Z obrien $"); | 40__FBSDID("$FreeBSD: head/usr.bin/find/ls.c 100495 2002-07-22 11:36:25Z robert $"); |
41 42#include <sys/param.h> 43#include <sys/stat.h> 44 45#include <inttypes.h> 46#include <err.h> 47#include <errno.h> 48#include <fts.h> 49#include <grp.h> 50#include <langinfo.h> 51#include <pwd.h> 52#include <stdio.h> 53#include <string.h> 54#include <time.h> 55#include <unistd.h> | 41 42#include <sys/param.h> 43#include <sys/stat.h> 44 45#include <inttypes.h> 46#include <err.h> 47#include <errno.h> 48#include <fts.h> 49#include <grp.h> 50#include <langinfo.h> 51#include <pwd.h> 52#include <stdio.h> 53#include <string.h> 54#include <time.h> 55#include <unistd.h> |
56#include <utmp.h> | |
57 58#include "find.h" 59 60/* Derived from the print routines in the ls(1) source code. */ 61 62static void printlink(char *); 63static void printtime(time_t); 64 65void 66printlong(name, accpath, sb) 67 char *name; /* filename to print */ 68 char *accpath; /* current valid path to filename */ 69 struct stat *sb; /* stat buffer */ 70{ 71 char modep[15]; 72 73 (void)printf("%6lu %4"PRId64" ", (u_long) sb->st_ino, sb->st_blocks); 74 (void)strmode(sb->st_mode, modep); | 56 57#include "find.h" 58 59/* Derived from the print routines in the ls(1) source code. */ 60 61static void printlink(char *); 62static void printtime(time_t); 63 64void 65printlong(name, accpath, sb) 66 char *name; /* filename to print */ 67 char *accpath; /* current valid path to filename */ 68 struct stat *sb; /* stat buffer */ 69{ 70 char modep[15]; 71 72 (void)printf("%6lu %4"PRId64" ", (u_long) sb->st_ino, sb->st_blocks); 73 (void)strmode(sb->st_mode, modep); |
75 (void)printf("%s %3u %-*s %-*s ", modep, sb->st_nlink, UT_NAMESIZE, 76 user_from_uid(sb->st_uid, 0), UT_NAMESIZE, | 74 (void)printf("%s %3u %-*s %-*s ", modep, sb->st_nlink, MAXLOGNAME - 1, 75 user_from_uid(sb->st_uid, 0), MAXLOGNAME - 1, |
77 group_from_gid(sb->st_gid, 0)); 78 79 if (S_ISCHR(sb->st_mode) || S_ISBLK(sb->st_mode)) 80 (void)printf("%3d, %3d ", major(sb->st_rdev), 81 minor(sb->st_rdev)); 82 else 83 (void)printf("%8"PRId64" ", sb->st_size); 84 printtime(sb->st_mtime); --- 45 unchanged lines hidden --- | 76 group_from_gid(sb->st_gid, 0)); 77 78 if (S_ISCHR(sb->st_mode) || S_ISBLK(sb->st_mode)) 79 (void)printf("%3d, %3d ", major(sb->st_rdev), 80 minor(sb->st_rdev)); 81 else 82 (void)printf("%8"PRId64" ", sb->st_size); 83 printtime(sb->st_mtime); --- 45 unchanged lines hidden --- |