summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-08-30Fix the handling of processes without an ownerJeremie Koenig
* main.c (argp_parser): New option --anonymous-owner. * main.h: Publish it. * process.c (process_lookup_pid): Use it to set the file owner uid of non-owned processes.
2010-08-30Use a global ps_contextJeremie Koenig
* proclist.c, proclist.h (proclist_create_node): Use a ps_context passed by the caller; errors are no longer possible, rename to proclist_make_node and change the signature accordingly. * rootdir.c, rootdir.h (rootdir_create_node): Likewise. * main.c (main): Create the ps_context here and pass it to root_make_node. (root_make_node): Pass it to proclist_make_node and rootdir_make_node.
2010-08-30Add a TODO-listJeremie Koenig
* TODO: New file.
2010-08-30netfs_server_loop never returnsJeremie Koenig
* main.c: Don't call netfs_server_loop repeatedly; it should never return.
2010-08-30Handle errors in mainJeremie Koenig
* main.c (main): Handle errors from argp_parse and root_make_node.
2010-08-30Add a --compatible optionJeremie Koenig
* main.c (argp_parser): Add --compatible, which sets the options required for compatibility with the procps tools.
2010-08-30Add a status file to process directoriesJeremie Koenig
* process.c: Add a status file.
2010-08-30Add statm to process directoriesJeremie Koenig
* process.c: Add the statm file.
2010-08-30Add a global cmdline fileJeremie Koenig
* main.c (argp_parser, main): Add the --kernel-pid option. * main.h: Publish it. * rootdir.c (rootdir_gc_cmdline): New function.
2010-08-30Add meminfo and vmstatJeremie Koenig
* rootdir.c: Add a (non-empty) meminfo and a vmstat file.
2010-08-30Add a fake-self option to control the self symlinkJeremie Koenig
* main.c (argp_parse, main): Add the --fake-self option. * main.h: Publish it. * rootdir.c (rootdir_gc_fakeself, rootdir_entries, rootdir_create_node): Use it.
2010-08-30Add --stat-mode to override the perms for [pid]/statJeremie Koenig
* main.c (argp_parser, main): Add the --stat-mode option. * process.c (process_lookup_pid): Use it.
2010-08-30Add --clk-tck to set the clock unitJeremie Koenig
* main.c (argp_parser, main): Add and parse the --clk-tck option. * main.h: Publish opt_clk_tck. * process.c (sc_tc): Use the user-provided clock frequency. * rootdir.c (rootdir_gc_stat): Likewise.
2010-08-30Play nice with the procps old_Hertz_hackJeremie Koenig
* rootdir.c (rootdir_gc_uptime, rootdir_gc_stat): assume a completely idle rather than completely busy system, so that the idle seconds can be meaningfully divided by the idle jiffies by procps.
2010-08-30Add an empty meminfo root fileJeremie Koenig
* rootdir.c: Add "meminfo", empty for now.
2010-08-30Add a fake "self" symlinkJeremie Koenig
* rootdir.c: Add a fake "self" symlink which always points to init.
2010-08-30Add loadavgJeremie Koenig
* rootdir.c: Add the root file "loadavg".
2010-08-30New root files: version, uptime, statJeremie Koenig
* rootdir.c, rootdir.h: New files. * main.c: Use rootdir_create_node. * Makefile: Add the rootdir module.
2010-08-30Set a restrictive mode on some sensitive filesJeremie Koenig
* process.c (process_file_make_node, entries): Set the environ and stat files as readable only by the owner of the process.
2010-08-30Encapsulate access to node->nn_statJeremie Koenig
* procfs.c, procfs.h (procfs_node_chown, procfs_node_chmod, procfs_node_chtype): New functions, encapsulate access to some nn_stat fields. * process.c (process_lookup_pid): Use procfs_node_chown instead of direct access.
2010-08-30Implement symlinksJeremie Koenig
* netfs.c (netfs_validate_stat): For symlinks, fetch the contents and propagate their length into the nn_stat.st_size field. (netfs_attempt_readlink): Implement using procfs_get_contents.
2010-08-30Use libps and enhance [pid]/statJeremie Koenig
* Makefile: Add libps to the $(LIBS). * proclist.c, proclist.h: Embed the proc server port in a ps_context structure. (proclist_make_node): Change to prototype to allow for the possibility of error. Rename to proclist_create_node to reflect the change and non-triviality. * process.c, process.h: Revamp. Use a full-blown procstat structure instead of just the procinfo fetched from the process server. Use the additional data to complement [pid]/stat. (process_lookup_pid): Get a ps_context structure instead of a port to the process server. * main.c (root_make_node): Convert to the new interface for proclist_create_node.
2010-08-30Handle the ref counter spinlock on cleanupJeremie Koenig
* netfs.c (netfs_node_norefs): Handle the reference counters spinlock so as to avoid deadlocking on reentry.
2010-08-30Invent path-based inode numbersJeremie Koenig
* procfs.h, procfs.c (procfs_make_ino): New function, invents an inode number by hashing the parent's and the name of an entry. (procfs_lookup): Use it to assign an inode number to child nodes at lookup time. * main.c (root_make_node): Assign an arbitrary inode number to the root directory.
2010-08-30Implement lookup for . and ..Jeremie Koenig
* procfs.c (procfs_lookup): Keep track of the parent directory, implement the lookup of the dot-directories. (procfs_cleanup): Release the reference to the parent node, if applicable. * procfs.h: Add a comment about the parent reference. * netfs.c (netfs_attempt_lookup): Lock the looked up node after the directory has been unlocked, in case they are the same.
2010-08-30Add the dot entries to directoriesJeremie Koenig
* procfs_dir.c (procfs_dir_get_contents): Prepend the . and .. entries to the ones from the given table.
2010-08-30Add a basic [pid]/stat fileJeremie Koenig
* process.c: Add a basic stat file.
2010-08-30Set the owner of process directories.Jeremie Koenig
* process.c (process_make_node): Use the owner_uid from the procinfo structure to set the owner of the created directory.
2010-08-30Fuse the proclist into the root nodeJeremie Koenig
* dircat.c, dircat.h: New files, merge directories. * Makefile: Add the dircat module. * main.c: Use dircat to merge the proclist into the root directory, instead of having it as a stand-alone one. * procfs.h, procfs.c: Add a "refresh hack" to have the contents of the root directory recreated on each request. * proclist.c (proclist_make_node): Enable the hack in question.
2010-08-30Fetch process information and reject the non-existing onesJeremie Koenig
* process.c, process.h (process_make_node): Make static, include a procinfo structure into the node information. (process_lookup_pid): New function, replaces process_make_node as the outer interface, returns an error for non-existing processes. * proclist.c (proclist_lookup): Convert to the new interface.
2010-08-30Add real process nodesJeremie Koenig
* process.c, process.h: New files, implement a process directory with cmdline and environ files. * Makefile: Add the process module. * proclist.c: Replace stub pid files with the real thing.
2010-08-30More cleanup possibilitiesJeremie Koenig
* procfs.c, procfs.h: Extend the signature of the cleanup_contents callback in the procfs_node_ops structure to include the hook and contents_len. (cleanup_contents_with_free, cleanup_contents_with_vm_deallocate): New functions, can be used as a cleanup_contents callback for simple cases. * procfs_dir.c, procfs_dir.h (procfs_dir_make_node): Update, add a cleanup callback, make sure the cleanup callback is invoked if there is an error. * proclist.c (proclist_make_node), main.c (main): Update to match the new interfaces.
2010-08-30Fix the failure semantics of procfs_make_nodeJeremie Koenig
* procfs.c (procfs_make_node): Invoke the cleanup callback on failure, so that callers don't have to. * procfs.h: Document the change. * procfs_dir.c (procfs_dir_make_node), procfs_file.c (procfs_file_make_node), proclist.c (proclist_make_node): Update to reflect the change.
2010-08-30Add the list of processes as a directoryJeremie Koenig
* proclist.h, proclist.c: New files. * main.c: Add a proclist directory based on them. * Makefile: Include the proclist module.
2010-08-30Implement simple directoriesJeremie Koenig
* procfs_dir.h: New file; declare the procfs_dir_make_node function, based on the procfs_dir_entry structure. * procfs_dir.c: New file; implement simple directories. * Makefile: Add the procfs_dir module. * main.c: Use it.
2010-08-30Add a helper module for simple regular filesJeremie Koenig
* procfs_file.h: New file, declares procfs_file_make_node. * procfs_file.c: New file, implements procfs_file_make_node. * main.c: Use them. * Makefile: Add the procfs_file module.
2010-08-30Basic infrastructureJeremie Koenig
* procfs.h: New file; basic interfaces for procfs nodes. * procfs.c: New file; implement the basic infrastructure. * netfs.c: New file; bridge libnetfs and the procfs interfaces. * main.c: New file; mostly a "Hello, World!" for now. * Makefile: New file; standalone for now.
2010-08-18Implement /proc/mounts as a symlink to /etc/mtabJeremie Koenig
* procfs_nonpid_files.c (procfs_create_mounts): New function. * procfs_dir.c (procfs_fill_root_dir): Call procfs_create_mounts. Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org>
2010-08-18Set an appropriate st_mode on symlinks.Jeremie Koenig
* procfs_pid_files.c (update_pid_entries): When symlink_target is not NULL, set st_size to the symlink length and st_mode to S_IFLNK | 0777.
2010-08-18update_pid_entries(): fix awkwardly indented uninitialized memory leakJeremie Koenig
* procfs_pid_files.c (update_pid_entries): Replace dynamic allocation of `stat' with automatic allocation. Memset `stat' to 0.
2010-08-01Switch to the new ChangeLog style.Thomas Schwinge
* ChangeLog: Wipe out content, and add instructions about how to get it back.
2010-08-012010-05-31 Samuel Thibault <samuel.thibault@ens-lyon.org>Samuel Thibault
* procfs_nonpid_files.c (procfs_read_nonpid_meminfo): Print swap sizes using %llu.
2010-08-012008-12-12 Samuel Thibault <samuel.thibault@ens-lyon.org>Samuel Thibault
* procfs_nonpid_files.c (procfs_read_nonpid_meminfo): Divide by 1024 value returned by get_swap_size and get_swap_free to get kilobytes.
2010-08-012008-09-02 Madhusudan.C.S <madhusudancs@gmail.com>Madhusudan.C.S
* netfs.c: (netfs_get_dirents): Add call to procfs_dir_entries_remove().
2010-08-012008-08-30 Madhusudan.C.S <madhusudancs@gmail.com>Madhusudan.C.S
* procfs_dir.c: (procfs_dir_create): Assign newly created directory to its pointer in netnode. (procfs_dir_remove): Removed function. (free_entry): New function. (ordered_unlink): Likewise. (delete): Likewise. (sweep): Likewise. (procfs_dir_entries_remove): Likewise. (is_in_pid_list): Removed call to make_dir_invalid (). (procfs_fill_root_dir): struct stat *stat -> struct stat stat. Add Read and Execute permissions to all in stat.st_mode. Set stat.st_nlink to 1. Set stat.st_size to 0. Add struct proc_stat *ps definition. Set struct proc_stat data from _proc_stat_create () function and set stat.st_uid and stat.st_gid from the data in that structure. * procfs_pid_files.c: (update_pid_entries): Add Read permissions to all in stat->st_mode.
2010-08-012008-08-29 Madhusudan.C.S <madhusudancs@gmail.com>Madhusudan.C.S
* AUTHORS: File removed. * COPYING: Likewise. * README: Likewise.
2010-08-012008-08-29 Madhusudan.C.S <madhusudancs@gmail.com>Madhusudan.C.S
* ChangeLog: Revised.
2010-08-012008-08-29 Madhusudan.C.S <madhusudancs@gmail.com>Madhusudan.C.S
* Makefile: (Copyright): 1997, 2000 -> 2008 (CC): Removed. (CFLAGS): Removed. (INCLUDES): Removed. (all): Removed. ($(target)): Removed. (%.o): Removed. (HURDLIBS): -lnetfs -> netfs, -lfshelp -> fshelp, -liohelp -> iohelp, -lthreads -> threads, -lports -> ports, -lihash -> ihash, -lps -> ps, -lshouldbeinlibc -> shouldbeinlibc. (include): Add include ../Makeconf
2010-08-012008-08-18 Madhusudan.C.S <madhusudancs@gmail.com>Madhusudan.C.S
* procfs_nonpid_files.c: (procfs_write_nonpid_stat): Changed to procfs_read_nonpid_stat. (procfs_write_nonpid_meminfo): Changed to procfs_read_nonpid_meminfo. (procfs_write_nonpid_loadavg): Changed to procfs_read_nonpid_loadavg. (procfs_write_nonpid_uptime): Changed to procfs_read_nonpid_uptime. (procfs_write_nonpid_version):Changed to procfs_read_nonpid_version. * procfs_pid_files.c: (procfs_write_stat_file): Changed to procfs_read_stat_file. Changed the comment correspondingly from Write to Read. (procfs_write_cmdline_file ): Changed to procfs_read_cmdline_file. Changed the comment correspondingly from Write to Read. (procfs_write_status_file): Changed to procfs_read_status_file. Changed the comment correspondingly from Write to Read. (procfs_write_statm_file): Changed to procfs_read_statm_file. Changed the comment correspondingly from Write to Read. (procfs_write_files_contents): Changed to procfs_read_files_contents. Changed the comment correspondingly from Write to Read. Changed the call to procfs_write_nonpid_stat to procfs_read_nonpid_stat. Changed the call to procfs_write_stat_file to procfs_read_stat_file. Changed the call to procfs_write_cmdline_file to procfs_read_cmdline_file. Changed the call to procfs_write_status_file to procfs_read_status_file. Changed the call to procfs_write_statm_file to procfs_read_statm_file. Changed the call to procfs_write_nonpid_meminfo to procfs_read_nonpid_meminfo. Changed the call to procfs_write_nonpid_loadavg to procfs_read_nonpid_loadavg. Changed the call to procfs_write_nonpid_uptime to procfs_read_nonpid_uptime. Changed the call to procfs_write_nonpid_version to procfs_read_nonpid_version. netfs.c: (netfs_attempt_read): Changed the call from procfs_write_files_contents to procfs_read_files_contents.
2010-08-012008-08-18 Madhusudan.C.S <madhusudancs@gmail.com>Madhusudan.C.S
* README: Initial Documentation.