summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--procfs/Makefile26
-rw-r--r--procfs/TODO24
-rw-r--r--procfs/dircat.c (renamed from dircat.c)0
-rw-r--r--procfs/dircat.h (renamed from dircat.h)0
-rw-r--r--procfs/main.c (renamed from main.c)0
-rw-r--r--procfs/main.h (renamed from main.h)0
-rw-r--r--procfs/netfs.c (renamed from netfs.c)0
-rw-r--r--procfs/process.c (renamed from process.c)0
-rw-r--r--procfs/process.h (renamed from process.h)0
-rw-r--r--procfs/procfs.c (renamed from procfs.c)0
-rw-r--r--procfs/procfs.h (renamed from procfs.h)0
-rw-r--r--procfs/procfs_dir.c (renamed from procfs_dir.c)0
-rw-r--r--procfs/procfs_dir.h (renamed from procfs_dir.h)0
-rw-r--r--procfs/proclist.c (renamed from proclist.c)0
-rw-r--r--procfs/proclist.h (renamed from proclist.h)0
-rw-r--r--procfs/rootdir.c (renamed from rootdir.c)0
-rw-r--r--procfs/rootdir.h (renamed from rootdir.h)0
17 files changed, 50 insertions, 0 deletions
diff --git a/procfs/Makefile b/procfs/Makefile
new file mode 100644
index 00000000..a397522f
--- /dev/null
+++ b/procfs/Makefile
@@ -0,0 +1,26 @@
+TARGET = procfs
+OBJS = procfs.o netfs.o procfs_dir.o \
+ process.o proclist.o rootdir.o dircat.o main.o
+LIBS = -lnetfs -lps
+
+CC = gcc
+CFLAGS = -Wall -g
+CPPFLAGS =
+LDFLAGS =
+
+ifdef PROFILE
+CFLAGS= -g -pg
+CPPFLAGS= -DPROFILE
+LDFLAGS= -static
+LIBS= -lnetfs -lfshelp -liohelp -lps -lports -lthreads -lihash -lshouldbeinlibc
+endif
+
+CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+clean:
+ $(RM) $(TARGET) $(OBJS)
diff --git a/procfs/TODO b/procfs/TODO
new file mode 100644
index 00000000..952d67bc
--- /dev/null
+++ b/procfs/TODO
@@ -0,0 +1,24 @@
+Known bugs to be fixed
+----------------------
+
+* The non-owned processes sometimes show up with INT_MAX as their owner,
+ instead of opt_anon_uid. This is likely to be a libps problem.
+
+Improvements and new features
+-----------------------------
+
+* There is a lot of dynamic memory allocation going on and it comes with a
+ cost in performance. We could try to limit such allocation, as long as it
+ keeps the inner interface simple and preserves the read/readdir semantics
+ (performance is probably not critical for a proc filesystem.)
+ One way would be to add an (optional) "needed_length" field to
+ procfs_node_ops, and arrange to pass a sufficent buffer in (*contents,
+ *contents_len) when get_contents is called. Then the user-provided buffer
+ might be used directly under some circumstances.
+
+* Add thread directories as [pid]/task/[n]. This shouldn't be too hard if we
+ use "process" nodes for threads, and provide an "exists" hook for the "task"
+ entry itself so that it's disabled in thread nodes. It might prove necessary
+ to have "optional" libps flags for some content generators, though, since
+ some of them might be missing for threads.
+
diff --git a/dircat.c b/procfs/dircat.c
index 5a60899a..5a60899a 100644
--- a/dircat.c
+++ b/procfs/dircat.c
diff --git a/dircat.h b/procfs/dircat.h
index 4177b384..4177b384 100644
--- a/dircat.h
+++ b/procfs/dircat.h
diff --git a/main.c b/procfs/main.c
index 3a976ccc..3a976ccc 100644
--- a/main.c
+++ b/procfs/main.c
diff --git a/main.h b/procfs/main.h
index 4e28b7eb..4e28b7eb 100644
--- a/main.h
+++ b/procfs/main.h
diff --git a/netfs.c b/procfs/netfs.c
index 24a6603f..24a6603f 100644
--- a/netfs.c
+++ b/procfs/netfs.c
diff --git a/process.c b/procfs/process.c
index 17a38ea8..17a38ea8 100644
--- a/process.c
+++ b/procfs/process.c
diff --git a/process.h b/procfs/process.h
index b230a281..b230a281 100644
--- a/process.h
+++ b/procfs/process.h
diff --git a/procfs.c b/procfs/procfs.c
index ae5a6769..ae5a6769 100644
--- a/procfs.c
+++ b/procfs/procfs.c
diff --git a/procfs.h b/procfs/procfs.h
index 64782ec4..64782ec4 100644
--- a/procfs.h
+++ b/procfs/procfs.h
diff --git a/procfs_dir.c b/procfs/procfs_dir.c
index c250aa48..c250aa48 100644
--- a/procfs_dir.c
+++ b/procfs/procfs_dir.c
diff --git a/procfs_dir.h b/procfs/procfs_dir.h
index 94c5b019..94c5b019 100644
--- a/procfs_dir.h
+++ b/procfs/procfs_dir.h
diff --git a/proclist.c b/procfs/proclist.c
index 58b942dc..58b942dc 100644
--- a/proclist.c
+++ b/procfs/proclist.c
diff --git a/proclist.h b/procfs/proclist.h
index bfe95b3d..bfe95b3d 100644
--- a/proclist.h
+++ b/procfs/proclist.h
diff --git a/rootdir.c b/procfs/rootdir.c
index 1fa71b03..1fa71b03 100644
--- a/rootdir.c
+++ b/procfs/rootdir.c
diff --git a/rootdir.h b/procfs/rootdir.h
index 6980da8f..6980da8f 100644
--- a/rootdir.h
+++ b/procfs/rootdir.h