]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib: [procutils.c]: general purpose procfs parsing functions
authorDavidlohr Bueso <dave@gnu.org>
Tue, 3 May 2011 18:57:01 +0000 (15:57 -0300)
committerKarel Zak <kzak@redhat.com>
Wed, 4 May 2011 13:30:28 +0000 (15:30 +0200)
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 <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/Makefile.am

index 2b6445987e9e82f47fc415545065b1a2f639e9a1..7d966ff995f66648937f0ad3c19cae67d0184cce 100644 (file)
@@ -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