From: Davidlohr Bueso Date: Tue, 3 May 2011 18:57:01 +0000 (-0300) Subject: lib: [procutils.c]: general purpose procfs parsing functions X-Git-Tag: v2.20-rc1~303 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9734045d9d11330b7782fbcffccf74fc98cdcc5c;p=thirdparty%2Futil-linux.git lib: [procutils.c]: general purpose procfs parsing functions We include the following functions as a first approach: - proc_open_tasks(): allocate resources and setup basic data - proc_next_tid(): iterate over the thread group - proc_close_tasks(): free used resources [kzak@redhat.com: - free() on error in proc_open_tasks(), - always call free() in proc_close_tasks() - ignore non-digit dirs and return 1 on end-of-dir in proc_next_tid()] Signed-off-by: Davidlohr Bueso Signed-off-by: Karel Zak --- diff --git a/lib/Makefile.am b/lib/Makefile.am index 2b6445987e..7d966ff995 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -3,7 +3,7 @@ include $(top_srcdir)/config/include-Makefile.am AM_CPPFLAGS += -DTEST_PROGRAM noinst_PROGRAMS = test_blkdev test_ismounted test_wholedisk test_mangle \ - test_tt test_canonicalize test_at test_strutils + test_tt test_canonicalize test_at test_strutils test_procutils if LINUX if HAVE_CPU_SET_T noinst_PROGRAMS += test_cpuset @@ -16,6 +16,7 @@ test_wholedisk_SOURCES = wholedisk.c test_mangle_SOURCES = mangle.c test_at_SOURCES = at.c test_strutils_SOURCES = strutils.c +test_procutils_SOURCES = procutils.c if LINUX test_cpuset_SOURCES = cpuset.c endif