Source
stringclasses
1 value
Date
int64
2k
2.01k
Text
stringlengths
20
19M
Token_count
int64
7
8.91M
freebsd_cvs_archive
2,000
d29 1 a29 1 "$FreeBSD: src/bin/date/vary.c,v 1.7 1999/08/27 23:13:59 peter Exp $"; d56 22 d154 1 a154 1 return mktime(t) != -1; d171 8 a178 6 if (!adjyear(t, '+', (t->tm_mon + val) / 12)) return 0; val %= 12; t->tm_mon += val; if (t->tm_mon > 11) t->tm_mon -= 12; d188 2 a189 ...
887
freebsd_cvs_archive
2,000
d29 1 a29 1 "$FreeBSD: src/bin/date/vary.c,v 1.12 2000/05/23 23:58:18 brian Exp $"; a55 13 static int adjhour(struct tm *, char, int, int); static int domktime(struct tm *t, char type) { time_t ret; while ((ret = mktime(t)) == -1 && t->tm_year > 68 && t->tm_year < 138) /* While mktime() fails, adjust by an ...
1,721
freebsd_cvs_archive
2,000
d29 1 a29 1 "$FreeBSD: src/bin/date/vary.c,v 1.8.2.1 2000/05/28 13:05:44 asmodai Exp $"; a31 1 #include <err.h> d96 1 a96 2 if ((*nextp = (struct vary *)malloc(sizeof(struct vary))) == NULL) err(1, "malloc");
95
freebsd_cvs_archive
2,004
d29 1 a29 1 "$FreeBSD$"; a152 2 int lmdays; a198 5 /* e.g., -v-1m on March, 31 is the last day of February in common sense */ lmdays = daysinmonth(t); if (t->tm_mday > lmdays) t->tm_mday = lmdays;
91
freebsd_cvs_archive
2,000
d29 1 a29 1 "$FreeBSD: src/bin/date/vary.c,v 1.4.2.2 1999/08/29 14:12:05 peter Exp $"; d44 2 a45 2 { 5, "may" }, { 6, "june" }, { 7, "july" }, { 8, "august" }, { 9, "september" }, { 10, "october" }, { 11, "november" }, { 12, "december" },
131
freebsd_cvs_archive
2,000
d29 1 a29 1 "$FreeBSD: src/bin/date/vary.c,v 1.4.2.3 2000/02/18 23:45:04 alfred Exp $"; d44 1 a44 1 { 5, "may"}, { 6, "june" }, { 7, "july" }, { 8, "august" }, a55 13 static int adjhour(struct tm *, char, int, int); static int domktime(struct tm *t, char type) { time_t ret; while ((ret = mktime(t)) == -1 && t...
1,808
freebsd_cvs_archive
2,000
d26 1 a26 1 * $FreeBSD: src/bin/date/vary.c,v 1.2.2.2 1999/09/05 10:59:37 peter Exp $ d41 2 a42 2 { 5, "may" }, { 6, "june" }, { 7, "july" }, { 8, "august" }, { 9, "september" }, { 10, "october" }, { 11, "november" }, { 12, "december" },
130
freebsd_cvs_archive
2,012
/*- * Copyright (c) 1997 Brian Somers <brian@Awfulhak.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice...
377
freebsd_cvs_archive
2,013
a0 36 /*- * Copyright (c) 1997 Brian Somers <brian@Awfulhak.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * ...
387
freebsd_cvs_archive
2,013
/*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and use in s...
3,861
freebsd_cvs_archive
2,013
a0 498 /*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and u...
3,866
freebsd_cvs_archive
2,014
d40 1 a40 1 __FBSDID("$FreeBSD: stable/9/bin/dd/args.c 264579 2014-04-17 00:34:49Z delphij $"); a47 1 #include <signal.h> a67 1 static void f_status(char *); a89 1 { "status", f_status, C_STATUS,C_STATUS }, a293 12 static void f_status(char *arg) { if (strcmp(arg, "none") == 0) ddflags |= C_NOINFO; else if (strcm...
162
freebsd_cvs_archive
2,002
d57 15 a71 15 static int c_arg __P((const void *, const void *)); static int c_conv __P((const void *, const void *)); static void f_bs __P((char *)); static void f_cbs __P((char *)); static void f_conv __P((char *)); static void f_count __P((char *)); static void f_files __P((char *)); static void f_ibs __P((char *));...
485
freebsd_cvs_archive
2,000
d43 1 a43 1 "$FreeBSD: src/bin/dd/args.c,v 1.26 2000/07/01 05:36:25 green Exp $"; d70 2 a71 2 static quad_t get_num __P((char *)); static off_t get_offset __P((char *)); d188 1 a188 1 quad_t res; d200 1 a200 1 quad_t res; d212 1 d214 2 a215 2 cpy_cnt = get_num(arg); if (cpy_cnt < 0) d217 1 a217 1 if (cpy_cnt == ...
767
freebsd_cvs_archive
2,012
/*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and use in s...
2,168
freebsd_cvs_archive
2,013
a0 268 /*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and u...
2,178
freebsd_cvs_archive
2,013
/*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and use in source ...
8,427
freebsd_cvs_archive
2,013
a0 284 /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and use in ...
8,416
freebsd_cvs_archive
2,014
d40 1 a40 1 __FBSDID("$FreeBSD: stable/9/bin/dd/conv_tab.c 264579 2014-04-17 00:34:49Z delphij $"); a43 6 #include <signal.h> #include <stdint.h> #include "dd.h" #include "extern.h"
74
freebsd_cvs_archive
2,013
/*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and use in s...
4,131
freebsd_cvs_archive
2,013
d46 1 a46 1 __FBSDID("$FreeBSD: head/bin/dd/dd.c 249063 2013-04-03 19:19:45Z brooks $"); d361 1 a361 1 if (ddflags & C_BS) {
64
freebsd_cvs_archive
2,013
a0 494 /*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and u...
4,045
freebsd_cvs_archive
2,004
d235 2 a236 2 (void)gettimeofday(&tv, (struct timezone *)NULL); st.start = tv.tv_sec + tv.tv_usec * 1e-6;
40
freebsd_cvs_archive
2,013
d46 1 a46 1 __FBSDID("$FreeBSD: stable/9/bin/dd/dd.c 250328 2013-05-07 09:47:12Z kib $"); d354 1 a354 1 if ((ddflags & ~(C_NOERROR | C_NOTRUNC | C_SYNC)) == C_BS) {
80
freebsd_cvs_archive
2,014
d46 1 a46 1 __FBSDID("$FreeBSD: stable/9/bin/dd/dd.c 264579 2014-04-17 00:34:49Z delphij $"); a83 1 volatile sig_atomic_t need_summary; d92 1 a92 1 (void)signal(SIGINFO, siginfo_handler); a100 7 /* * Some devices such as cfi(4) may perform significant amounts * of work when a write descriptor is closed. Close th...
205
freebsd_cvs_archive
2,013
d46 1 a46 1 __FBSDID("$FreeBSD: stable/8/bin/dd/dd.c 250329 2013-05-07 09:48:42Z kib $"); d354 1 a354 1 if ((ddflags & ~(C_NOERROR | C_NOTRUNC | C_SYNC)) == C_BS) {
80
freebsd_cvs_archive
2,003
d107 10 d189 4 a192 14 /* * If converting case at the same time as another conversion, build a * table that does both at once. If just converting case, use the * built-in tables. */ if (ddflags & (C_LCASE | C_UCASE)) { if (ddflags & (C_ASCII | C_EBCDIC)) { if (ddflags & C_LCASE) { for (cnt = 0; cnt ...
264
freebsd_cvs_archive
2,002
d224 1 a224 6 else if (type & (D_DISK | D_MEM)) { if (type & D_DISK) { const int one = 1; (void)ioctl(io->fd, DIOCWLABEL, &one); } a225 1 }
69
freebsd_cvs_archive
2,002
a56 1 #include <sys/time.h> d80 2 a81 2 off_t pending = 0; /* pending seek if sparse */ u_int ddflags; /* conversion options */
48
freebsd_cvs_archive
2,002
d72 4 a75 5 static void dd_close __P((void)); static void dd_in __P((void)); int main __P((int, char *[])); static void getfdtype __P((IO *)); static void setup __P((void)); d79 1 a79 1 void (*cfunc) __P((void)); /* conversion function */ d88 1 a88 3 main(argc, argv) int argc __unused; char *argv[]; d107 1 a107 1 set...
182
freebsd_cvs_archive
2,000
d49 1 a49 1 "$FreeBSD: src/bin/dd/dd.c,v 1.30 2000/07/20 19:21:40 green Exp $"; d90 1 a90 1 int argc;
55
freebsd_cvs_archive
2,000
d49 1 a49 1 "$FreeBSD: src/bin/dd/dd.c,v 1.27 1999/10/03 18:49:51 green Exp $"; d73 1 d175 4 a178 2 if ((ddflags & (C_OF | C_SEEK | C_NOTRUNC)) == (C_OF | C_SEEK)) (void)ftruncate(out.fd, out.offset * out.dbsz); d197 1 a197 1 casetab[cnt] = tolower(cnt); d200 1 a200 1 casetab[cnt] = toupper(cnt); d219 2 ...
254
freebsd_cvs_archive
2,000
d49 1 a49 1 "$FreeBSD$"; a54 1 #include <sys/disklabel.h> a71 1 int main __P((int, char *[])); d170 2 a171 2 * Truncate the output file. If it fails on a type of output file * that it should _not_ fail on, error out. d173 2 a174 4 if ((ddflags & (C_OF | C_SEEK | C_NOTRUNC)) == (C_OF | C_SEEK) && out.flags ...
431
freebsd_cvs_archive
2,001
d49 1 a49 1 "$FreeBSD: src/bin/dd/dd.c,v 1.27.2.1 2000/08/07 08:30:17 ps Exp $"; a56 1 #include <sys/time.h>
57
freebsd_cvs_archive
2,001
d49 1 a49 1 "$FreeBSD: src/bin/dd/dd.c,v 1.27.2.2 2001/03/04 07:01:15 kris Exp $"; d90 1 a90 1 int argc __unused;
62
freebsd_cvs_archive
2,012
/*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and use in s...
1,104
freebsd_cvs_archive
2,013
a0 99 /*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and us...
1,114
freebsd_cvs_archive
2,013
/*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and use in s...
618
freebsd_cvs_archive
2,012
d34 1 a34 1 * $FreeBSD: head/bin/dd/extern.h 133762 2004-08-15 19:10:05Z rwatson $ d46 1 a46 1 void summaryx(int); d64 1
61
freebsd_cvs_archive
2,013
a0 63 /*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and us...
619
freebsd_cvs_archive
2,014
d34 1 a34 1 * $FreeBSD: stable/9/bin/dd/extern.h 264579 2014-04-17 00:34:49Z delphij $ d46 1 a46 1 void siginfo_handler(int); a63 1 extern volatile sig_atomic_t need_summary;
73
freebsd_cvs_archive
2,002
a40 2 #include <sys/cdefs.h> d58 1 a58 1 extern u_quad_t cpy_cnt; d61 1 a61 1 extern quad_t files_cnt;
46
freebsd_cvs_archive
2,002
d43 13 a55 13 void block __P((void)); void block_close __P((void)); void dd_out __P((int)); void def __P((void)); void def_close __P((void)); void jcl __P((char **)); void pos_in __P((void)); void pos_out __P((void)); void summary __P((void)); void summaryx __P((int)); void terminate __P((int)); void unblock __P((void)...
133
freebsd_cvs_archive
2,000
d38 1 a38 1 * $FreeBSD: src/bin/dd/extern.h,v 1.9 1999/09/13 21:47:10 green Exp $ a55 1 void bitswab __P((void *, size_t)); d60 1 a60 1 extern quad_t cpy_cnt;
76
freebsd_cvs_archive
2,000
d38 1 a38 1 * $FreeBSD$ a55 1 void bitswab __P((void *, size_t)); d59 1 a59 1 extern void (*cfunc) __P((void));
53
freebsd_cvs_archive
2,012
/*- * This program is in the public domain * * $FreeBSD: head/bin/dd/gen.c 139969 2005-01-10 08:39:26Z imp $ */ #include <stdio.h> int main(int argc __unused, char **argv __unused) { int i; for (i = 0; i < 256; i++) putchar(i); return (0); }
89
freebsd_cvs_archive
2,013
a0 17 /*- * This program is in the public domain * * $FreeBSD: releng/8.4/bin/dd/gen.c 139969 2005-01-10 08:39:26Z imp $ */ #include <stdio.h> int main(int argc __unused, char **argv __unused) { int i; for (i = 0; i < 256; i++) putchar(i); return (0); }
99
freebsd_cvs_archive
2,013
/*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and use in s...
795
freebsd_cvs_archive
2,012
d40 1 a40 1 __FBSDID("$FreeBSD: head/bin/dd/misc.c 239991 2012-09-01 14:45:15Z ed $"); d47 1 a60 1 char buf[100]; d66 1 a66 2 /* Use snprintf(3) so that we don't reenter stdio(3). */ (void)snprintf(buf, sizeof(buf), d69 2 a70 3 (void)write(STDERR_FILENO, buf, strlen(buf)); if (st.swab) { (void)snprintf(buf, size...
307
freebsd_cvs_archive
2,013
a0 104 /*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and u...
904
freebsd_cvs_archive
2,004
d62 1 a62 1 (void)gettimeofday(&tv, (struct timezone *)NULL);
23
freebsd_cvs_archive
2,014
d40 1 a40 1 __FBSDID("$FreeBSD: stable/9/bin/dd/misc.c 264579 2014-04-17 00:34:49Z delphij $"); a46 1 #include <signal.h> d60 1 d62 1 a62 4 if (ddflags & C_NOINFO) return; (void)gettimeofday(&tv, NULL); d66 2 a67 1 (void)fprintf(stderr, d70 3 a72 2 if (st.swab) (void)fprintf(stderr, "%ju odd length swab %s\n",...
288
freebsd_cvs_archive
2,001
d43 1 a43 1 "$FreeBSD: src/bin/dd/misc.c,v 1.21 2001/06/25 06:17:02 dd Exp $"; d59 1 a59 1 summary() d92 1 a92 2 summaryx(notused) int notused __unused; d102 1 a102 2 terminate(sig) int sig;
91
freebsd_cvs_archive
2,001
d43 1 a43 1 "$FreeBSD: src/bin/dd/misc.c,v 1.20 2001/06/24 01:55:16 dd Exp $"; d93 1 a93 1 int notused;
56
freebsd_cvs_archive
2,001
a50 2 #include <stdlib.h> #include <strings.h> d91 1 a91 1 int notused __unused; d105 2 a106 2 summary(); _exit(sig == 0 ? 0 : 1);
57
freebsd_cvs_archive
2,013
/*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and use in s...
1,524
freebsd_cvs_archive
2,013
a0 183 /*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego and Lance * Visser of Convex Computer Corporation. * * Redistribution and u...
1,518
freebsd_cvs_archive
2,014
d40 1 a40 1 __FBSDID("$FreeBSD: stable/9/bin/dd/position.c 264579 2014-04-17 00:34:49Z delphij $"); a47 1 #include <signal.h> a93 2 if (need_summary) summary();
73
freebsd_cvs_archive
2,000
d43 1 a43 1 "$FreeBSD$"; d133 1 a133 1 if (out.flags & (ISSEEK | ISPIPE)) { d169 2 a170 3 while (cnt++ < out.offset) { n = write(out.fd, out.db, out.dbsz); if (n == -1) a171 3 if ((size_t)n != out.dbsz) errx(1, "%s: write failure", out.name); }
118
freebsd_cvs_archive
2,013
/*- * Copyright (c) 1980, 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Lab...
5,512
freebsd_cvs_archive
2,013
d47 1 a47 1 __FBSDID("$FreeBSD: head/bin/df/df.c 245871 2013-01-24 05:36:37Z delphij $"); d117 1 d204 1 a204 1 if (mntbuf == 0) d213 1 a213 1 if ((mntpt = getmntpt(*argv)) == 0) { d219 1 a219 1 if ((mntpt = getmntpt(*argv)) == 0) { d286 1 a286 1 bzero(&maxwidths, sizeof(maxwidths)); d299 1 d314 1 a314 1 retur...
166
freebsd_cvs_archive
2,013
a0 614 /*- * Copyright (c) 1980, 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix Sys...
5,252
freebsd_cvs_archive
2,012
d47 1 a47 1 __FBSDID("$FreeBSD: head/bin/df/df.c 243129 2012-11-16 03:33:34Z grog $"); d400 1 a400 1 return (num * (intmax_t) fsbs / bs);
70
freebsd_cvs_archive
2,012
d47 1 a47 1 __FBSDID("$FreeBSD: head/bin/df/df.c 243049 2012-11-15 03:39:21Z grog $"); a395 1 * Attempts to avoid overflow for large file systems. d400 1 a400 5 if (fsbs != 0 && fsbs < bs) return (num / (intmax_t)(bs / fsbs)); else return (num * (intmax_t)(fsbs / bs)); d451 6
120
freebsd_cvs_archive
2,011
d110 1 a110 1 size_t i, mntsize; a189 5 mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); bzero(&maxwidths, sizeof(maxwidths)); for (i = 0; i < mntsize; i++) update_maxwidths(&maxwidths, &mntbuf[i]); d192 2 d195 7 a201 14 bzero(&maxwidths, sizeof(maxwidths)); for (i = 0; i < mntsize; i++) { if (cflag) addsta...
350
freebsd_cvs_archive
2,012
d110 1 a110 1 int i, mntsize; d190 5 a196 2 /* everything (modulo -t) */ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); d198 14 a211 7 } else { /* just the filesystems specified on the command line */ mntbuf = malloc(argc * sizeof(*mntbuf)); if (mntbuf == 0) err(1, "malloc()"); mntsize = 0; /* continued ...
345
freebsd_cvs_archive
2,013
d47 1 a47 1 __FBSDID("$FreeBSD: stable/9/bin/df/df.c 250733 2013-05-17 03:55:03Z grog $"); a55 1 #include <locale.h> a97 1 static int thousands; d114 1 a114 2 (void)setlocale(LC_ALL, ""); memset(&maxwidths, 0, sizeof(maxwidths)); d119 1 a119 1 while ((ch = getopt(argc, argv, "abcgHhiklmnPt:T,")) != -1) a182 3 case...
719
freebsd_cvs_archive
2,012
d110 1 a110 1 int i, mntsize; d190 5 a196 2 /* everything (modulo -t) */ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); d198 14 a211 7 } else { /* just the filesystems specified on the command line */ mntbuf = malloc(argc * sizeof(*mntbuf)); if (mntbuf == 0) err(1, "malloc()"); mntsize = 0; /* continued ...
345
freebsd_cvs_archive
2,009
a367 17 * Print an inode count in "human-readable" format. */ static void prthumanvalinode(int64_t bytes) { char buf[6]; int flags; flags = HN_NOSPACE | HN_DECIMAL | HN_DIVISOR_1000; humanize_number(buf, sizeof(buf) - (bytes < 0 ? 0 : 1), bytes, "", HN_AUTOSCALE, flags); (void)printf(" %5s", buf); } /* ...
303
freebsd_cvs_archive
2,004
d301 1 a301 1 int i, j; d311 14 a324 4 if (!nflag) (void)statfs(mntbuf[i].f_mntonname,&mntbuf[j]); else if (i != j) mntbuf[j] = mntbuf[i];
71
freebsd_cvs_archive
2,004
d55 1 a55 1 #include <math.h> d65 2 a66 20 #define UNITS_SI 1 #define UNITS_2 2 #define KILO_SZ(n) (n) #define MEGA_SZ(n) ((n) * (n)) #define GIGA_SZ(n) ((n) * (n) * (n)) #define TERA_SZ(n) ((n) * (n) * (n) * (n)) #define PETA_SZ(n) ((n) * (n) * (n) * (n) * (n)) #define KILO_2_SZ (KILO_SZ(1024ULL)) #define MEGA_2_SZ ...
841
freebsd_cvs_archive
2,004
d118 1 a124 1 static void addstat(struct statfs *, struct statfs *); d143 1 a143 1 struct statfs statfsbuf, totalbuf, *mntbuf; d145 1 d154 1 a154 1 memset (&totalbuf, 0, sizeof (totalbuf)); d156 1 a156 1 strncpy (totalbuf.f_mntfromname, "total", MNAMELEN); a162 3 case 'c': cflag = 1; break; d169 3 a431 1 ...
271
freebsd_cvs_archive
2,004
d436 1 a436 1 header = " Size"; d481 3 a483 1 } else if (!total)
34
freebsd_cvs_archive
2,004
d124 1 d136 1 a136 1 static int aflag = 0, hflag, iflag, nflag; d143 1 a143 1 struct statfs statfsbuf, *mntbuf; d153 3 d157 1 a157 1 while ((ch = getopt(argc, argv, "abgHhiklmnPt:")) != -1) d162 3 d224 7 a231 2 update_maxwidths(&maxwidths, &mntbuf[i]); for (i = 0; i < mntsize; i++) { d234 2 a235 1 } d272 2 d31...
353
freebsd_cvs_archive
2,003
d60 1 a60 1 #include <inttypes.h> d92 6 a97 6 size_t mntfrom; size_t total; size_t used; size_t avail; size_t iused; size_t ifree; d123 1 a123 1 static size_t int64width(int64_t); d133 2 a134 2 static __inline u_int max(u_int a, u_int b) d417 1 a417 1 mwp->mntfrom = max(mwp->mntfrom, strlen("Filesystem")); d4...
854
freebsd_cvs_archive
2,003
d123 1 a123 1 static size_t longwidth(long); d125 1 a125 1 static void prthuman(const struct statfs *, size_t); d374 1 a374 1 prthuman(const struct statfs *sfsp, size_t used) d411 1 a411 1 static long blocksize; d414 1 a414 1 size_t used, availblks, inodes; d448 7 a454 5 (void)printf(" %*ld %*ld %*ld", (u...
510
freebsd_cvs_archive
2,003
d125 1 a125 1 static void prthuman(const struct statfs *, long); d128 1 a128 1 static long regetmntinfo(struct statfs **, long, const char **); d151 2 a152 2 long mntsize; int ch, i, rv; d308 1 a308 1 long mntsize, i; d324 1 a324 1 static long d374 1 a374 1 prthuman(const struct statfs *sfsp, long used) d414 1 a...
188
freebsd_cvs_archive
2,003
d274 1 d284 6 a289 4 /* Check to make sure the arguments we've been * given are satisfied. Return an error if we * have been asked to list a mount point that does * not match the other args we've been given (-l, -t, etc.) d292 1 a292 1 rv++; d295 1
90
freebsd_cvs_archive
2,003
d60 1 d92 6 a97 6 int mntfrom; int total; int used; int avail; int iused; int ifree; d100 17 a116 3 unsigned long long vals_si [] = {1, KILO_SI_SZ, MEGA_SI_SZ, GIGA_SI_SZ, TERA_SI_SZ, PETA_SI_SZ}; unsigned long long vals_base2[] = {1, KILO_2_SZ, MEGA_2_SZ, GIGA_2_SZ, TERA_2_SZ, PETA_2_SZ}; unsigned long long *val...
839
freebsd_cvs_archive
2,002
d384 1 a384 2 static int timesthrough; static size_t headerlen; d395 1 a395 1 mwp->total = imax(mwp->total, (int)headerlen); d444 1 a444 1 size_t dummy;
66
freebsd_cvs_archive
2,003
d384 2 a385 1 static int headerlen, timesthrough; d396 1 a396 1 mwp->total = imax(mwp->total, headerlen); d445 1 a445 1 int dummy;
59
freebsd_cvs_archive
2,002
d384 2 a385 1 static int headerlen, timesthrough; d396 1 a396 1 mwp->total = imax(mwp->total, headerlen); d445 1 a445 1 int dummy;
59
freebsd_cvs_archive
2,002
d292 2 a293 2 * Make a pass over the filesystem info in ``mntbuf'' filtering out * filesystem types not in vfslist and possibly re-stating to get d370 2 a371 2 * Convert statfs returned filesystem size into BLOCKSIZE units. * Attempts to avoid overflow for large filesystems. d378 1 a378 1 * Print out status about ...
159
freebsd_cvs_archive
2,002
d494 3 a496 3 int mib[3], maxvfsconf, cnt=0, i; size_t miblen; struct ovfsconf *ptr; d498 2 a499 5 mib[0] = CTL_VFS; mib[1] = VFS_GENERIC; mib[2] = VFS_MAXTYPENUM; miblen=sizeof(maxvfsconf); if (sysctl(mib, (unsigned int)(sizeof(mib) / sizeof(mib[0])), &maxvfsconf, &miblen, NULL, 0)) { warnx("sysctl failed...
202
freebsd_cvs_archive
2,002
d206 3 a208 5 if (vfslist != NULL) { bzero(&maxwidths, sizeof(maxwidths)); for (i = 0; i < mntsize; i++) update_maxwidths(&maxwidths, &mntbuf[i]); }
66
freebsd_cvs_archive
2,002
a53 1 #include <sys/cdefs.h> a58 2 #include <ufs/ffs/fs.h> a59 3 #include <errno.h> #include <fcntl.h> #include <fstab.h> d67 2 d108 10 a117 14 int bread(off_t, void *, int); int checkvfsname(const char *, char **); char *getmntpt(char *); int longwidth(long); char *makenetvfslist(void); char **makevfslist(cha...
1,054
freebsd_cvs_archive
2,002
d94 10 d115 1 d120 1 a120 1 void prtstat(struct statfs *, int); d122 1 a122 1 int ufs_df(char *, int); d124 1 d130 5 d140 1 d144 1 a144 1 int ch, i, maxwidth, rv, width; d205 3 a207 6 maxwidth = 0; for (i = 0; i < mntsize; i++) { width = strlen(mntbuf[i].f_mntfromname); if (width > maxwidth) maxwidth = wi...
719
freebsd_cvs_archive
2,002
d54 1 d60 1 d65 1 d100 1 a100 1 int unitp [] = { NONE, KILO, MEGA, GIGA, TERA, PETA }; a425 4 #include <ufs/ufs/dinode.h> #include <ufs/ffs/fs.h> #include <errno.h> #include <fstab.h>
84
freebsd_cvs_archive
2,001
d99 12 a110 13 int bread __P((off_t, void *, int)); int checkvfsname __P((const char *, char **)); char *getmntpt __P((char *)); int main __P((int, char *[])); char *makenetvfslist __P((void)); char **makevfslist __P((char *)); void prthuman __P((struct statfs *, long)); void prthumanval __P((double)); void...
432
freebsd_cvs_archive
2,001
d551 4 a554 2 if ((str = malloc(sizeof(char) * (32 * cnt + cnt + 2))) == NULL) { warnx("malloc failed");
41
freebsd_cvs_archive
2,001
d50 1 a50 1 "$FreeBSD: src/bin/df/df.c,v 1.29 2001/06/05 21:16:27 mjacob Exp $"; d521 2 a522 1 char *makenetvfslist() d537 1 a537 1 if ((listptr=malloc(sizeof(char*) * maxvfsconf)) == NULL) { d542 1 a542 1 for (ptr=getvfsent();ptr;ptr=getvfsent()) d544 2 a545 2 listptr[cnt++] = strdup (ptr->vfc_name); if (! l...
257
freebsd_cvs_archive
2,001
d50 1 a50 1 "$FreeBSD: src/bin/df/df.c,v 1.28 2001/06/04 23:07:15 pirzyk Exp $"; d530 2 a531 2 if (sysctl(mib, (u_int) sizeof (mib) / sizeof(mib[0]), &maxvfsconf, &miblen, NULL, 0)) {
96
freebsd_cvs_archive
2,001
d50 1 a50 1 "$FreeBSD: src/bin/df/df.c,v 1.27 2001/05/20 04:12:30 kris Exp $"; d524 2 a525 1 int mib[3], maxvfsconf, miblen, cnt=0, i; d530 2 a531 1 if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), &maxvfsconf, &miblen, NULL, 0)) {
118
freebsd_cvs_archive
2,001
d50 1 a50 1 "$FreeBSD: src/bin/df/df.c,v 1.25 2001/05/08 06:58:25 kris Exp $"; d98 1 d100 2 a102 3 long regetmntinfo __P((struct statfs **, long, char **)); int bread __P((off_t, void *, int)); char *getmntpt __P((char *)); d106 1 d121 2 d124 1 a124 2 int ch, err, i, maxwidth, rv, width; char *fstype, *mntpath...
326
freebsd_cvs_archive
2,001
d50 1 a50 1 "$FreeBSD: src/bin/df/df.c,v 1.24 2000/06/03 20:17:39 jwd Exp $"; d122 3 a124 1 char *mntpt, **vfslist; d167 1 d211 34 a244 3 } else if ((stbuf.st_mode & S_IFMT) == S_IFCHR) { rv = ufs_df(*argv, maxwidth) || rv; continue;
118
freebsd_cvs_archive
2,000
d50 1 a50 1 "$FreeBSD: src/bin/df/df.c,v 1.23 1999/12/15 03:44:09 mharo Exp $"; d122 1 a122 1 char *mntpt, *mntpath, **vfslist; a210 34 } else if ((stbuf.st_mode & S_IFMT) == S_IFBLK) { if ((mntpt = getmntpt(*argv)) == 0) { mdev.fspec = *argv; mntpath = strdup("/tmp/df.XXXXXX"); if (mntpath == NULL)...
385
freebsd_cvs_archive
2,001
d50 1 a50 1 "$FreeBSD: src/bin/df/df.c,v 1.23.2.1 2000/06/13 03:19:40 jwd Exp $"; a56 1 #include <sys/sysctl.h> a98 1 char *makenetvfslist __P((void)); d125 1 a125 1 while ((ch = getopt(argc, argv, "abgHhiklmnPt:")) != -1) a154 5 case 'l': if (vfslist != NULL) errx(1, "-l and -t are mutually exclusive."); ...
594
freebsd_cvs_archive
2,001
d50 1 a50 1 "$FreeBSD$"; a98 1 int bread __P((off_t, void *, int)); a99 2 char *getmntpt __P((char *)); int main __P((int, char *[])); d102 3 a107 1 long regetmntinfo __P((struct statfs **, long, char **)); a121 2 const char *fstype; char *mntpath, *mntpt, **vfslist; d123 2 a124 3 int ch, i, maxwidth, rv, w...
698
freebsd_cvs_archive
2,001
d50 1 a50 1 "$FreeBSD: src/bin/df/df.c,v 1.23.2.3 2001/08/01 02:30:32 obrien Exp $"; a98 1 int main __P((int, char *[])); d101 2 a104 1 char *getmntpt __P((char *)); d123 2 d126 3 a128 2 int ch, eno, i, maxwidth, rv, width; char *mntpt, *mntpath, **vfslist; d176 1 a213 1 eno = errno; d219 1 a219 4 } else if...
659
freebsd_cvs_archive
2,001
d50 1 a50 1 "$FreeBSD$"; d548 2 a549 4 if (cnt == 0 || (str = malloc(sizeof(char) * (32 * cnt + cnt + 2))) == NULL) { if (cnt > 0) warnx("malloc failed");
72