Deleted Added
full compact
linprocfs.c (223182) linprocfs.c (224582)
1/*-
2 * Copyright (c) 2000 Dag-Erling Co��dan Sm��rgrav
3 * Copyright (c) 1999 Pierre Beyssac
4 * Copyright (c) 1993 Jan-Simon Pendry
5 * Copyright (c) 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by

--- 28 unchanged lines hidden (view full) ---

37 * SUCH DAMAGE.
38 *
39 * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94
40 */
41
42#include "opt_compat.h"
43
44#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000 Dag-Erling Co��dan Sm��rgrav
3 * Copyright (c) 1999 Pierre Beyssac
4 * Copyright (c) 1993 Jan-Simon Pendry
5 * Copyright (c) 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by

--- 28 unchanged lines hidden (view full) ---

37 * SUCH DAMAGE.
38 *
39 * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94
40 */
41
42#include "opt_compat.h"
43
44#include <sys/cdefs.h>
45__FBSDID("$FreeBSD: head/sys/compat/linprocfs/linprocfs.c 223182 2011-06-17 07:30:56Z pluknet $");
45__FBSDID("$FreeBSD: head/sys/compat/linprocfs/linprocfs.c 224582 2011-08-01 19:12:15Z kib $");
46
47#include <sys/param.h>
48#include <sys/queue.h>
49#include <sys/blist.h>
50#include <sys/conf.h>
51#include <sys/exec.h>
52#include <sys/fcntl.h>
53#include <sys/filedesc.h>

--- 443 unchanged lines hidden (view full) ---

497 cnt.v_swappgsin,
498 cnt.v_swappgsout,
499 cnt.v_intr,
500 cnt.v_swtch,
501 (long long)boottime.tv_sec);
502 return (0);
503}
504
46
47#include <sys/param.h>
48#include <sys/queue.h>
49#include <sys/blist.h>
50#include <sys/conf.h>
51#include <sys/exec.h>
52#include <sys/fcntl.h>
53#include <sys/filedesc.h>

--- 443 unchanged lines hidden (view full) ---

497 cnt.v_swappgsin,
498 cnt.v_swappgsout,
499 cnt.v_intr,
500 cnt.v_swtch,
501 (long long)boottime.tv_sec);
502 return (0);
503}
504
505static int
506linprocfs_doswaps(PFS_FILL_ARGS)
507{
508 struct xswdev xsw;
509 uintmax_t total, used;
510 int n;
511 char devname[SPECNAMELEN + 1];
512
513 sbuf_printf(sb, "Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n");
514 mtx_lock(&Giant);
515 for (n = 0; ; n++) {
516 if (swap_dev_info(n, &xsw, devname, sizeof(devname)) != 0)
517 break;
518 total = (uintmax_t)xsw.xsw_nblks * PAGE_SIZE / 1024;
519 used = (uintmax_t)xsw.xsw_used * PAGE_SIZE / 1024;
520
521 /*
522 * The space and not tab after the device name is on
523 * purpose. Linux does so.
524 */
525 sbuf_printf(sb, "/dev/%-34s unknown\t\t%jd\t%jd\t-1\n",
526 devname, total, used);
527 }
528 mtx_unlock(&Giant);
529 return (0);
530}
531
505/*
506 * Filler function for proc/uptime
507 */
508static int
509linprocfs_douptime(PFS_FILL_ARGS)
510{
511 long cp_time[CPUSTATES];
512 struct timeval tv;

--- 972 unchanged lines hidden (view full) ---

1485 pfs_create_file(root, "mtab", &linprocfs_domtab,
1486 NULL, NULL, NULL, PFS_RD);
1487 pfs_create_file(root, "partitions", &linprocfs_dopartitions,
1488 NULL, NULL, NULL, PFS_RD);
1489 pfs_create_link(root, "self", &procfs_docurproc,
1490 NULL, NULL, NULL, 0);
1491 pfs_create_file(root, "stat", &linprocfs_dostat,
1492 NULL, NULL, NULL, PFS_RD);
532/*
533 * Filler function for proc/uptime
534 */
535static int
536linprocfs_douptime(PFS_FILL_ARGS)
537{
538 long cp_time[CPUSTATES];
539 struct timeval tv;

--- 972 unchanged lines hidden (view full) ---

1512 pfs_create_file(root, "mtab", &linprocfs_domtab,
1513 NULL, NULL, NULL, PFS_RD);
1514 pfs_create_file(root, "partitions", &linprocfs_dopartitions,
1515 NULL, NULL, NULL, PFS_RD);
1516 pfs_create_link(root, "self", &procfs_docurproc,
1517 NULL, NULL, NULL, 0);
1518 pfs_create_file(root, "stat", &linprocfs_dostat,
1519 NULL, NULL, NULL, PFS_RD);
1520 pfs_create_file(root, "swaps", &linprocfs_doswaps,
1521 NULL, NULL, NULL, PFS_RD);
1493 pfs_create_file(root, "uptime", &linprocfs_douptime,
1494 NULL, NULL, NULL, PFS_RD);
1495 pfs_create_file(root, "version", &linprocfs_doversion,
1496 NULL, NULL, NULL, PFS_RD);
1497
1498 /* /proc/net/... */
1499 dir = pfs_create_dir(root, "net", NULL, NULL, NULL, 0);
1500 pfs_create_file(dir, "dev", &linprocfs_donetdev,

--- 70 unchanged lines hidden ---
1522 pfs_create_file(root, "uptime", &linprocfs_douptime,
1523 NULL, NULL, NULL, PFS_RD);
1524 pfs_create_file(root, "version", &linprocfs_doversion,
1525 NULL, NULL, NULL, PFS_RD);
1526
1527 /* /proc/net/... */
1528 dir = pfs_create_dir(root, "net", NULL, NULL, NULL, 0);
1529 pfs_create_file(dir, "dev", &linprocfs_donetdev,

--- 70 unchanged lines hidden ---