* 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.
#endif /* not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/find/ls.c,v 1.17 2004/01/20 09:27:03 des Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/find/ls.c,v 1.23 2011/09/28 18:53:36 ed Exp $");
#include <sys/param.h>
#include <sys/stat.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
+
#ifdef __APPLE__
-/* definition from utmp.h */
-#define UT_NAMESIZE 8
+#undef MAXLOGNAME
+#define MAXLOGNAME 17
#endif /* __APPLE__ */
#include "find.h"
(void)printf("%6lu %8"PRId64" ", (u_long) sb->st_ino, sb->st_blocks);
(void)strmode(sb->st_mode, modep);
-#ifdef __APPLE__
- (void)printf("%s %3u %-*s %-*s ", modep, sb->st_nlink, UT_NAMESIZE,
- user_from_uid(sb->st_uid, 0), UT_NAMESIZE,
-#else /* !__APPLE__ */
(void)printf("%s %3u %-*s %-*s ", modep, sb->st_nlink, MAXLOGNAME - 1,
user_from_uid(sb->st_uid, 0), MAXLOGNAME - 1,
-#endif /* __APPLE__ */
group_from_gid(sb->st_gid, 0));
if (S_ISCHR(sb->st_mode) || S_ISBLK(sb->st_mode))
- (void)printf("%3d, %3d ", major(sb->st_rdev),
- minor(sb->st_rdev));
+ (void)printf("%#8jx ", (uintmax_t)sb->st_rdev);
else
(void)printf("%8"PRId64" ", sb->st_size);
printtime(sb->st_mtime);