summaryrefslogtreecommitdiff
path: root/proc
Commit message (Collapse)AuthorAgeFilesLines
* library: Better PID file checks (with one small tweak)Jim Warner2022-01-131-1/+1
| | | | | | | Since gcc no longer warns of 'unreachable code', we'll just deal with any such possibility ourselves I guess. Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: Better PID file checksCraig Small2022-01-081-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This started off with fixing the compilier warning: proc/readproc.c: In function ‘simple_nextpid’: proc/readproc.c:1373:38: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 58 [-Wformat-truncation=] 1373 | snprintf(path, PROCPATHLEN, "/proc/%s", ent->d_name); | ^~ proc/readproc.c:1373:3: note: ‘snprintf’ output between 7 and 262 bytes into a destination of size 64 1373 | snprintf(path, PROCPATHLEN, "/proc/%s", ent->d_name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We know that ent->d_name will fit under 64 bytes because we check the name starts with a digit. The first change was simple and changed the printf to use tgid like the task function below it. Is everything under /proc that starts with a digit a directory with a PID only? Today, it is but there are no guarantees. The entire function works ok if every non-pid directory doesn't start with a number. We don't check for strtoul() having an issue nor if the for loop just falls off the end. The moment the kernel guys (or some module writer) think "/proc/12mykernelval" is a neat idea this function is in trouble. We won't get buffer overflow as we are using snprintf at least. This change now: We check if strtoul() actually came across a number Process the pid directory as a conditional branch Treat falling off the for loop as a not-found Signed-off-by: Craig Small <csmall@dropbear.xyz>
* misc: fixed several inconsistencies in email addressesJim Warner2022-01-082-2/+2
| | | | | | | | [ you wouldn't believe how many back-and-forths were ] [ involved in Craig convincing me there were several ] [ inconsistencies. i am so dense sometimes (often?). ] Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: add support for the 'LIBPROC_HIDE_KERNEL' varJim Warner2022-01-072-1/+15
| | | | | | | | | | | | | | This patch was prompted by Björn Fischer's merge #147 request referenced below. It has been generalized such that it now embraces both of those 'pids_fetch' types. [ and thanks to Björn for initiating this extension ] Reference(s): https://gitlab.com/procps-ng/procps/-/merge_requests/147 Prototyped-by: Björn Fischer <bf@CeBiTec.Uni-Bielefeld.DE> Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: eliminate that warning of '-Wunused-variable'Jim Warner2022-01-071-1/+1
| | | | Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: eliminate warning '-Wunused-but-set-variable'Jim Warner2022-01-071-2/+1
| | | | Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: eliminate those warnings for '-Wpointer-sign'Jim Warner2022-01-072-6/+6
| | | | Signed-off-by: Jim Warner <james.warner@comcast.net>
* misc: amend the man page & source file copyright datesJim Warner2022-01-0718-17/+37
| | | | | | | This just updates the copyright dates in the documents where I was already represented. Others are unchanged. Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: reposition those 'info' structures in headersJim Warner2021-12-166-12/+12
| | | | | | | | For some unknown reason all the 'info' structures were declared between macros and function prototypes rather than right after all the other structure declarations. Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: change 'PIDS_PROCESSOR' into a signed integerJim Warner2021-12-162-3/+3
| | | | | | | This change is really being made on behalf of the ps & top programs. Besides, over 2 billion CPUs are plenty! Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: refine support for multiple concurrent accessJim Warner2021-11-145-19/+19
| | | | | | | | | | | | | | | | | | | | | | Our new library's now well protected against potential problems which arise when a multi-threaded application opens more than one context within the same API at the same time. However, with a single-threaded application designed along those same lines, some problems remain. So, to avoid potential corruption of some data (which was classified as local 'static __thread') from those single-threaded designs, we'll move several variables to the info structure itself and remove the '__thread' qualifier. Now they're protected against both designs. [ we'll not be protected against some multi-threaded ] [ application that shares a single context yet calls ] [ that interface from separate threads. this is just ] [ bad application design & no different than sharing ] [ other modifiable global data between such threads! ] Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: this is why we hate those darn tab charactersJim Warner2021-11-141-1/+1
| | | | Signed-off-by: Jim Warner <james.warner@comcast.net>
* lib: Initialise uptime variablesCraig Small2021-11-021-1/+1
| | | | | | | | | | | | | | upminutes and uphours could both not get initialised in the procps_uptime_sprint_short() function. Error was probably introduced at the referenced commit. References: Coverity 240787 Uninitialized scalar variable Coverity 240776 Uninitialized scalar variable commit 0496b39876d569fe1cecb76ad5ef212cd14c0374 Signed-off-by: Craig Small <csmall@dropbear.xyz>
* library: remedy several 'coverity scan' resource leaksJim Warner2021-10-281-3/+13
| | | | | | | | | | This commit will place the 'file2strvec' function on a par with the 'file2str' function if ENOMEM was raised. Plus, just to keep coverity happy, we'll also clean up after potential failures with the 'openproc' function. Signed-off-by: Jim Warner <james.warner@comcast.net>
* fix uid/gid > 2^31Todd Lewis2021-10-261-5/+6
| | | | | | | | | | | | | | | | This MR revisits a partial fix from 2018. The problem stems from incorrect handling of unsigned 32-bit uid_ts and gid_ts as signed when values are large - i.e. when the high bit is set. In that case, pgrep and pkill fail to identify processes by uid. (They succeed when finding the same processes by username.) The primary fix for this is to impliment the "FIXME" comment in proc/readproc.h, the implementation of which allows the removal of the (int) casts from the partial fix from 2018. The other fixed code in this MR consists of tests in strict_atol() that detects and errors out on overflows. References: Merge !146
* library: extend thread safety to more static variablesJim Warner2021-10-253-5/+5
| | | | | | | | | | | | | | | In the commit referenced below, a '__thread' attribute was added to numerous static variables to protect them from concurrent access conflicts with multi-threading. Unfortunately, that patch did not go quite far enough. So, this commit adds a few more '__thread' qualifiers. Reference(s): commit 23cfb7136636f2d522b31417892de79b011ad3e4 Signed-off-by: Jim Warner <james.warner@comcast.net>
* uptime: Correctly print pretty/short formated neville2021-10-141-2/+38
| | | | | | | | | | | uptime -p would show empty output after 52 weeks of uptime. This commit is largely the work of Ed but reformatted for newlib branch. Signed-off-by: Craig Small <csmall@dropbear.xyz> References: procps-ng/procps!141 procps-ng/procps#217
* library: ensure thread safety via function substitutesJim Warner2021-10-022-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | Even though we we had to abandon the master branch top multi-thread effort and even though the newlib version of a multi-threaded top provides no real benefit, that whole exercise was not wasted. Rather, it has revealed some deficiencies in our library which this addresses. If two or more threads in the same address space tried to use procps_loadavg or procps_uptime simultaneously, there's a chance they would experience problems due to thread-unsafe functions our library called internally. So, this patch switches them for thread-safe versions. [ along the way we will also make that procps_uptime ] [ initialization of his 'up' & 'idle' variables mean ] [ something by delaying the -ERANGE return a little. ] Reference(s): https://www.freelists.org/post/procps/a-few-more-patches,7 Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: ensure thread safety for all static variablesJim Warner2021-10-0210-28/+28
| | | | | | | | | | | | | | | | | | | Even though we we had to abandon the master branch top multi-thread effort and even though the newlib version of a multi-threaded top provides no real benefit, that whole exercise was not wasted. Rather, it has revealed some deficiencies in our library which this addresses. If two or more threads in the same address space tried to access the same api simultaneously, there is a good chance some function-local static variables will yield some of those renowned unpredictable results. So, this patch protects them with the '__thread' storage class. Reference(s): https://www.freelists.org/post/procps/a-few-more-patches,7 Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: trade 2 strstr & atoi calls for 1 sscanf callJim Warner2021-08-241-5/+2
| | | | Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: just eliminate a couple of unnecessary bracesJim Warner2021-08-241-6/+3
| | | | Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: address major bug in the 'listed_nextpid' guyJim Warner2021-08-121-9/+22
| | | | | | | | | | | | | | | | | | | | | | | Ever since 2003, the 'listed_nextpid' routine has been misrepresenting its duties. Far from finding processes in a list given to openproc, it just inserted the next pid in that list into the passed proc_t as BOTH a tgid and tid. There was no attempt to validate such values. The net result is that tid & tgid were valid only with a thread group leader. When called with a pid for some sibling thread, the resulting tgid would be incorrect. With this commit, our little function will now attempt to validate both the tid and tgid. If this should fail then the fallback position will be the same as what we inherited. So we're no worse off & likely much better. [ note that calling the function with a thread's pid ] [ likely stems from 2011 when a 'readeither' routine ] [ was added which dealt with both tasks and threads! ] Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: disabled some code that now serves no purposeJim Warner2021-08-121-2/+2
| | | | | | | | | | | | | | | | | | | | | In the patch shown below, two lines involving the flag PROC_UID were uncommented (enabled). However given the construct of the readeither function, it is impossible for the simple_readtask guy to be called when its TGID leader has already been ignored. So, let's disable it. [ it's only now true that the lines serve no purpose ] [ after the commit shown below tweaked readeither to ] [ access the base directory of the tgid leader. but, ] [ before that, the 2 lines should have been enabled! ] Reference(s): . two lines uncommented commit af34cc964ae7667db15d2507f24098c26ba3c664 . tweaked readeither commit a37526260917bac624ae6b75fd9f4ea7287d81ad Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: repair <pids> api boo-boo in the 'select' i/fJim Warner2021-08-093-7/+26
| | | | | | | | | | | | | | | | | | | | The patch referenced below corrected some flaws in the procps_pids_select implementation. But, there remained one flaw which this commit will now hopefully address. Rather than assume callers wished to select only tasks and not threads meant a command like 'top -H -p 10329' works differently under newlib than release 3.3.17. It fails to honor the '-H' (threads) switch under newlib. So, to fix that oops, we'll allow that select function to get threads or tasks depending on its 'which' parm. Reference(s): . Oct 2015, some flaws corrected commit bc616b361596bc3008800de839b88446508cfdd0 Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: ensure thread group leader retrieval accuracyJim Warner2021-08-091-6/+9
| | | | | | | | | | | | | | | | | | With that recent addition of the autogroup provisions, it became apparent that '/proc/<pid>/task' information is sometimes incomplete. In fact, there's no autogroup file at all in any '/proc/<pid>/task/<pid>' directory! As a result, when the top -H mode was invoked, all the processes showed a -1 for AGID, even the group leader. So, this commit will ensure that for every TGID leader its basic '/proc/<pid>' directory will always be used. The 'task' subdirectory is now only used for siblings. [ and it's time that readeither prologue was updated ] Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: add provision for displaying autogroup valuesJim Warner2021-08-094-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | In the link referenced below there's an explanation of the linux autogroup feature which has been around ever since linux-2.6.38. With that explanation there's also surprising (maybe shocking) revelations about the nice and renice commands if CONFIG_SCHED_AUTOGROUP was set. When autogroups are active, such programs are rendered mostly useless because the nice value will only affect scheduling priority relative to other processes in the same autogroup. In order to accomplish what we thought of as renice, that nice value in /proc/<pid>/autogroup must be changed. Altering any single member of a group will also affect every other member of that autogroup. So, this commit will set the stage for users of newlib to display autogroup identifiers plus their associated nice values (now that their importance is understood). Reference(s): https://github.com/nlburgin/reallynice Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: refactor all the readproc.h 'PROC_FILL' flagsJim Warner2021-08-092-30/+30
| | | | | | | | | | The 'PROC_FILL' flags, found in readproc.h, had become almost unmanageable. The hex values were scattered all over the map as new flags had been introduced. So this commit resets all of them and will help ensure any new flags don't duplicate some already existing hex value. Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: standardize 'pointer-to-thing' whitespace useJim Warner2021-07-274-32/+32
| | | | | | | | | When declaring a pointer there's usually a space after the thing-pointed-to and no space between the asterisk and the pointer-thingy itself. So this commit enforces such conventions where needed on old library elements. Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: correct sources for IO accounting, <pids> apiJim Warner2021-06-231-7/+7
| | | | | | | | | | | | | This patch just brings 'PIDS_IO' source into alignment with the names being used in that /proc/<pid>/io file. [ i had my chance to fix them in a whitespace change ] [ made in the patch referenced below, but i blew it! ] Reference(s): commit 2dcbe71f3b8e3586acab0221b2e4c55d10cf8f76 Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: add new derived smaps_rollup item, <pids> apiJim Warner2021-06-172-0/+3
| | | | | | | | | | | | | | | That recent addition of USS to the ps program prompted this change. Rather than have it (and soon top) add 2 separate items to yield the desired value, we will let our new library perform the arithmetic when necessary. Outside of a little extra storage, there is no runtime costs for such an extension. There is, however, a real benefit to having such code in the library. Now should callers choose to sort on this new field, results will be guaranteed to be what was expected (i.e. accurate). Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: rename/reposition two enumerators, <pids> apiJim Warner2021-05-023-7/+7
| | | | | | | | | | The two special hugetlbfs items were misnamed. The TBL reference (table) should be TLB (transaction lookaside buffer). Besides, I never liked their position anyway! [ and one macro argument tweak is being snuck in too ] Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: add support for smaps_rollup file, <pids> apiJim Warner2021-04-294-5/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A couple of people have suggested that smaps_rollup be added to the ps program and/or top program. This patch is intended to set the stage for just such extensions. There are currently 20 displayable items in the rollup file. And newlib sometimes uses sscanf when populating the target, sometimes hsearch and one customized gperf approach. None of these fit well with the smaps items. Thus, an approach using a simple table lookup was used and, by disabling 1 code line, it could be made immune from changes to the items order (unlike a sscanf call) and doesn't carry the greater cost of a hsearch/gperf. Note: The next patch will allow top to display some of these new fields. Then, it'll be possible to determine the colossal costs of accessing the smaps_rollup file. Here is a small preview of just what you will discover when using the command 'time top/top -d0 -n1000' while configured with just two fields: PID + 1 memory field. ------------------------------------ as a regular user with only PID + RES (statm) real 0m2.605s user 0m1.060s sys 0m1.377s with only PID + RSS (smaps) real 0m26.397s 10x more costly user 0m1.253s sys 0m24.915s ----------------- as a root (thus smaps for all tasks) with only PID + RES (statm) real 0m2.651s user 0m1.177s sys 0m1.286s with only PID + RSS (smaps) real 0m33.040s 12x more costly user 0m1.256s sys 0m31.533s Reference(s): . ps: expose shared/private memory separately https://gitlab.com/procps-ng/procps/-/issues/201 . top/ps: add support for PSS reporting https://gitlab.com/procps-ng/procps/-/issues/112 Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: some miscellaneous tweaks before smaps_rollupJim Warner2021-04-292-14/+17
| | | | | | | | | This commit is strictly cosmetic. It was an attempt to normalize/standardize/alphabetize those #define/#undef statements. Some missing #undef's were added plus some comments regarding sources corrected/standardized too. Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: fix alignment with new 'io' types, <pids> apiJim Warner2021-04-271-7/+7
| | | | | | | | | | | The commit referenced below was well done but needed a small whitespace tweak to preserve existing alignment. Reference(s): . io accounting added commit a7afe06e6f1b397b7404fbee724a51f88cc8a59c Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: adding IO accountingCraig Small2021-04-244-5/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a modification of MR !122 by @renit1609 to fit the new library. Problem statement: The procps library has no PROC_FILLIO flag to fetch the proc field "/proc/[pid]/io" data process-wise. IO Accounting is not included as part of procps. Requirement: We have a requirement to fetch process wise IO utilization which can be used for monitoring. When looking through the procps library, I see that IO Accounting (/proc/[pid]/io) is not being included as part of procps. There is no such flag like PROC_FILLIO being included in readproc.h . Solution: While looking at the implementation done for other proc fields, I used the spare bits in app code. I renamed PROC_SPARE_1 as PROC_FILLIO, the spare bit from PROC_SPARE_* and used it for fetching /proc/[pid]/io data as part of the procps library similar to other fields. I moved the PROC_SPARE_* bits each by 1 bit to retain the spare bits. Meanwhile added the IO fields in proc_t structure. References: procps-ng/procps!122 procps-ng/procps#184
* escape.c: Fix missing nl_langinfo on certain configsIssam E. Maghni2021-04-241-1/+1
| | | | | | | | | | | | | nl_langinfo and CODESET are undefined in a musl system. Instead of uncondionally including langinfo.h, this change includes include/nls.h which has the tests and work-arounds for systems that don't have these features. This is similar to how other programs within procps include langinfo.h via nls.h References: procps-ng/procps!130 Signed-off-by: Craig Small <csmall@dropbear.xyz>
* library: fix an insidious bug affecting TICS_ALL_DELTAJim Warner2021-04-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | This simple two line code change fixes an intermittent bug whereby %CPU for parent(s) with collapsed children could be vastly understated from those displayed under the current 3.3.17 publicly available top & libprocps. If one started several top instances in the background using very a small delay interval (zero?), then if the shell under which they were running was collapsed, you would see similar %CPU results for both the libraries. However, when running a demanding 'make' like a kernel compile (especially if backed by fast processors and a SSD), then newlib would generally show only 1/3 to 1/2 of the collapsed %CPU values that appeared for 3.3.17. Of course, now that the bug has been swatted with this commit the disparities between those results is easily explained. Since newly created tasks never contributed tics during the interval where they were created, only with many short lived tasks would differences surface. Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: lower addr resolution cost for TICS_ALL_DELTAJim Warner2021-04-241-9/+8
| | | | | | | | | | | | | Rather than run risks of more expensive and repetitive address resolution, we will establish this local index for a one time cost and avoid any potential gcc bloat. [ this commit was made in pursuit of a bug involving ] [ the distortion of elapsed task tics. but, it turns ] [ out these changes had nothing to do with that bug. ] [ however, the patch is being retained as desirable. ] Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: lessen chance of distortion on TICS_ALL_DELTAJim Warner2021-04-242-3/+3
| | | | | | | | | | | | | That old library defined this field as 'unsigned int'. However, here it was known as a 'signed int'. Thus for consistency we'll now also treat it as 'unsigned int'. [ this commit was made in pursuit of a bug involving ] [ the distortion of elapsed task tics. but, it turns ] [ out these changes had nothing to do with that bug. ] [ however, the patch is being retained as desirable. ] Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: fix a few source/origin notations, <pids> apiJim Warner2021-03-112-33/+33
| | | | | | | | | | | | | After removing brackets from those 'derived' notations I was surprised to discover that several origin/source comments were wrong. So this patch fixes those errors. [ along the way a couple enumerators were renamed to ] [ better (i hope) reflect what they're representing. ] [ that, in turn, also required a little rearranging. ] Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: clean 'derived' origins in header, <pids> apiJim Warner2021-03-111-25/+25
| | | | | | | | | None of the other four new api headers use brackets on derived items. With this patch we normalize the fifth. [ it makes for a cleaner, less confusing, appearance ] Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: tweaked key used in hash table, <meminfo> apiJim Warner2021-02-281-3/+3
| | | | | | | | | | | | | | | | | | | | | This small change was a result of some experimentation trading our current 'hsearch' hash scheme for 'gperf'. I discovered that when the ':' character was a part of each 'gperf' key, that generated search logic was more complicated and thus slower. But without a ':', it was a little cleaner/leaner and therefore slightly faster. Assuming that the same trailing ':' *might* affect the current 'hsearch' logic, to be safe we will remove it. [ while the 'gperf' version will slightly outperform ] [ an 'hsearch', too many ugly implementation details ] [ were exposed which complicates future maintenance. ] [ thus, we'll retain our current 'hsearch' approach. ] Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: normalized the 'read_failed' guys across APIsJim Warner2021-02-282-15/+9
| | | | | | | | | | | | | This patch will condense some logic in those functions associated with the file input operations. The changes will not, for the most part, alter any generated code. More significantly (though not very) was the change to two 'strtoul' calls. Since the returned 'endptr' value isn't exploited, when that parm is set to NULL, we can save one instruction on each side of such calls (wow). Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: eliminate a useless conditional in readproc.hJim Warner2021-02-231-4/+0
| | | | | | | | | | | | | | | | | | When #define QUICK_THREADS was introduced, for copying some task data for a child thread, one proc_t pad byte was used to mark, then later identify, those children. Later the QUICK_THREADS was recycled as FALSE_THREADS, and used for a different purpose, but a conditional in the header file erroneously remained. Now, it is gone! Reference(s): . Jul, 2016 - QUICK_THREADS become FALSE_THREADS commit c546d9dd4409ee11cd466c99a820a3b5dadfe3f4 . Aug, 2011 - QUICK_THREADS intruduced commit bb4f08ba297a67a043f7547670aa8623b54c2e67 Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: Rename to libproc-2Craig Small2021-02-202-3/+3
| | | | | | | | | | | | | | | | | | | | | | What to call the new library? Keep using libprocps wouldn't do, its a very different library from the programs' point of view. It would also mean we could have some clashes around the packages (two package names, same library name). The ancient procps used libproc or libproc-a.b.c where a.b.c was the package version. Kept the revision numbers down (it was always 0.0.0) but the name of the library changed. So if we use libproc-2 is there a clash with an ancient procps? procps v 2.0.0 was around in 1999 so it was 22 years ago, also the name of the library would have been libproc-2.0.0.so not libproc-2.so so we're fine with that. libproc-2 seems to fit, our second major re-work of the procps library. Signed-off-by: Craig Small <csmall@dropbear.xyz>
* library: tweak logic for /proc not mounted, <pids> apiJim Warner2021-02-181-3/+4
| | | | | | | | | | | Since 'procps_uptime' will access the /proc filesystem the <pids> 'new' guy should should protect against the possibility /proc isn't mounted when 'boot_seconds' is established. A zero is better than the negative value. [ the only distortion would be to PIDS_TIME_ELAPSED. ] Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: normalized 'extents_free_all' use across APIsJim Warner2021-02-182-4/+2
| | | | | | | | With the way those 'extents_free_all' guys were coded, there's no real need to check for a NULL this->extents before calling 'em. That's how <stat> already does it. Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: update those source files for copyright datesJim Warner2021-02-0912-23/+32
| | | | | | | | | | | | | In addition to copyright date, the initial descriptive line was changed from a generic statement to one which reflects the specific portion of the proc/ filesystem. [ such descriptions alternate between 'declarations' ] [ (h files) & corresponding 'definitions' (c files). ] Also, a few missing copyright attributions were added. Signed-off-by: Jim Warner <james.warner@comcast.net>
* library: tweak 'other' user/group names for efficiencyJim Warner2021-02-093-41/+35
| | | | | | | | | | | | | | | | | | | | | | | | | This commit just ensures that the relatively expensive ID to name conversions aren't performed unless they're explicitly requested. It also internalizes those flags that required the PROC_FILLSTATUS flag to also be set. [ requiring a caller, in our case pids.c, to provide ] [ two flags when a single field was the objective is ] [ wrong & represents a future potential toe-stubber. ] [ moreover, what's worse is that those two flags are ] [ seemingly unrelated. but, without both, a SEGV can ] [ can be expected when a result.str pointer is NULL. ] [ by contrast, in the master branch those fields are ] [ arrays which, when set to zeroes, produce an empty ] [ string. So, there is no abend (but no name either) ] [ when one of those two required flags were omitted. ] [ and worth noting, in that branch it's not just one ] [ caller required to observe a two flag requirement. ] Signed-off-by: Jim Warner <james.warner@comcast.net>
* misc: Update Craig's emailCraig Small2021-01-2113-13/+13
|