summaryrefslogtreecommitdiff
path: root/package/sash/src/free.c
blob: e2a580078ffa0491bcf2c1f5acd9db8672225c89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* free.c:
 *
 * Copyright (C) 1998  Kenneth Albanowski <kjahds@kjahds.com>,
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */

#include "sash.h"

#include <fcntl.h>
#include <sys/types.h>

#include <sys/stat.h>
#include <dirent.h>
#include <pwd.h>
#include <grp.h>
#include <time.h>

void
do_free(argc, argv)
	int	argc;
	char	**argv;
{
	int i;
	FILE * f;
	char buf[256];

	f = fopen("/proc/meminfo", "r");

	if (!f) {
		perror("Unable to open /proc/meminfo: ");
		return;
	}

	for(i=0;i<3;i++) {
		fgets(buf, 250, f);
		fputs(buf, stdout);
	}

	fclose(f);
}