OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [userland/] [sash/] [free.c] - Blame information for rev 199

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/* free.c:
2
 *
3
 * Copyright (C) 1998  Kenneth Albanowski <kjahds@kjahds.com>,
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation; either version 2 of the License, or
8
 * (at your option) any later version.
9
 */
10
 
11
#include "sash.h"
12
 
13
#include <linux/autoconf.h>
14
 
15
#include <fcntl.h>
16
#include <sys/types.h>
17
 
18
#include <sys/stat.h>
19
#include <dirent.h>
20
#include <pwd.h>
21
#include <grp.h>
22
#include <time.h>
23
 
24
void
25
do_free(argc, argv)
26
        char    **argv;
27
{
28
        int i;
29
        FILE * f;
30
        char buf[256];
31
 
32
        f = fopen("/proc/meminfo", "r");
33
 
34
        if (!f) {
35
                perror("Unable to open /proc/meminfo: ");
36
                return;
37
        }
38
 
39
        for(i=0;i<3;i++) {
40
                fgets(buf, 250, f);
41
                fputs(buf, stdout);
42
        }
43
 
44
        fclose(f);
45
}
46
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.