diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2014-08-20 21:11:13 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-08-26 12:29:24 +0200 |
commit | 8e2707b81b0c90295c9fdf92a576925442d22147 (patch) | |
tree | e95ad185bfb7169ddaa1cfdceb6a9b134b3ec8b8 /package/sash/src/free.c | |
parent | 62f5a17a49e65c6639460abbf352b158b36301a7 (diff) |
add sash, simpleinit and a uclibc config for nonmmu case
Diffstat (limited to 'package/sash/src/free.c')
-rw-r--r-- | package/sash/src/free.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/package/sash/src/free.c b/package/sash/src/free.c new file mode 100644 index 000000000..281f10995 --- /dev/null +++ b/package/sash/src/free.c @@ -0,0 +1,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) + 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); +} + |