summaryrefslogtreecommitdiffstats
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* Use explicit braces to avoid ambiguous else.delphij2006-12-091-1/+2
|
* Do not exit without printing the id information if the uid of thempp2006-12-091-6/+15
| | | | user executing the command cannot be looked up in the password file.
* Change formatting to be more compliant with style(9). Doubtlessgrog2006-12-091-227/+218
| | | | others will find more things to change.
* Change copyright notice to the FreeBSD 2 clause notice.grog2006-12-091-16/+11
| | | | Approved by: John Wehle <john\@feith.com>
* Add copyright notice.grog2006-12-091-0/+23
|
* Set channel utility for Hauuapuge PVR-250 and PVR-350.grog2006-12-093-0/+368
| | | | | | | | | | This s part of an import of the PVR-250 driver. Originally it was calleed pvr250-setchannel, but it seems better to improve this program to work for any tuner card, so I'm starting with a more generic name. That shouldn't mislead anybody: currently the program only works with the (yet to be committed) cxm driver. Contributed by: John Wehle <john\@feith.com>
* - Added my entry in calendar.freebsdnivit2006-12-081-0/+1
| | | | Approved by: alexbl (mentor)
* o confstr(3) returns 0 on error. Check the return value accordingly.maxim2006-12-061-6/+10
| | | | | PR: misc/106414 MFC after: 1 week
* - Add myself to calendar.freebsdgabor2006-12-051-0/+1
| | | | | Approved by: erwin (mentor) MFC after: 3 days
* Portability fix for non-POSIX operating systems: Open files in binary mode.cperciva2006-12-052-9/+17
| | | | | PR: bin/106358 Submitted by: techtonik at php dot net
* Prevent buffer overflow when forcibly terminating an escape character.dds2006-12-031-1/+3
| | | | | | | | | | Obtained from: OpenBSD Note: In the case of a full buffer the OpenBSD implementation will leave in the format string an invalid escape sequence. This appears to be harmless with our C library, but according to C99 this can cause undefined behavior. MFC after: 2 weeks
* Correct handling of format strings with escaped % specifications.dds2006-12-031-2/+5
| | | | | | | | | | Note: It would be nice to be able to implement getformat() using fmtcheck(3), but fmtcheck does not distinguish between signed and unsigned types, a facility jot needs to perform range checks on its output. Submitted by: Per Kristian Hove MFC after: 2 weeks
* The sigconv.awk script generates a sigdesc.h header file, whichkeramida2006-12-012-55/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | contains a sigdec[] vector of structures, but the generated output is missing braces around the initializer of each struct, which triggers warnings in WARNS=3: src/usr.bin/top/sigdesc.h:10: warning: missing braces around initializer src/usr.bin/top/sigdesc.h:10: warning: (near initialization for `sigdesc[0]') * Fix the sigconv.awk script to generate a header with initializers which look better. * Add rules to usr.bin/top/Makefile that rebuilds a new sigconv.h header which matches the correct signal set from the build-time version of `${DESTDIR}/usr/include/signal.h' (so sigconv.h doesn't get stale once changes are made to the header). * Remove the old sigconv.h header, now that it is autoupdated at build time. * Various Makefile style fixes (the committed Makefile was kindly submitted by Ruslan): - Reorder .PATH, PROG, SRCS and CFLAGS to match style.Makefile(5) - Split off the generated sources (sigdesc.h top.local.h) in an SRCS+= line of their own. - Add entries to CLEANFILES near the rules that generate the respective files. - Move the explicit rule which builds top.1 after the implicit rules which generate its dependencies. Reviewed by: ru, bde Submitted by: ru (Makefile) MFC after: 2 weeks
* - Revert signedness type changes to "struct vmtotal"; by makingru2006-11-282-90/+22
| | | | | | | | | | | | | | them unsigned I made the possible overflows hard to detect, and it only saved 1 bit which isn't principal, even less now that the underlying issue with the total of virtual memory has been fixed. (For the record, it will overflow with >=2T of VM total, with 32-bit ints used to keep counters in pages.) - While here, fix printing of other "struct vmtotal" members such as t_rq, t_dw, t_pw, and t_sw as they are also signed. Reviewed by: bde MFC after: 3 days
* Back out rev. 1.17: arch-dependent WARNS level.yar2006-11-271-4/+0
| | | | | | | | The policy is that the WARNS level should characterize the quality of a piece of code irrespective of any conditions. Otherwise the code doesn't deserve the WARNS level assigned. Requested by: ru
* Consistently mark percentage scales as such.yar2006-11-273-4/+4
| | | | | PR: bin/101975 MFC after: 3 days
* Don't shadow globals.yar2006-11-273-7/+7
| | | | | Found by: WARNS=6 MFC after: 3 days
* We should return the name in cp, not printf it.yar2006-11-271-1/+3
| | | | | Found by: WARNS=6 MFC after: 3 days
* systat(1) reaches WARNS=6 on i386 and amd64. This is goodyar2006-11-271-0/+4
| | | | | | for catching general regressions in future. Unfortunately, it still displays some problems at WARNS=6 on architectures with stricter alignment requirements, e.g., ia64.
* The logic of fetchnetstat_sysctl() isn't too complex: if idx is 0,yar2006-11-271-2/+2
| | | | | | | | we set and use xtp; if idx is 1, we set and use xip; the other cases are impossible. However, GCC cannot see that xip and xtp are always initialized before use because they are initialized and used in different if/else blocks. So setting them to NULL at the very beginning won't hurt.
* + WARNS=4 reminds that nlist.n_name isn't const.yar2006-11-271-3/+5
| | | | | | + Use C99 initializers to be WARNS-clean. + The last element in a namelist should have its n_name set to NULL, not to an empty string.
* Don't discard a const qualifier from constant strings.yar2006-11-271-1/+2
|
* Remove a wrong "const" qualifier.yar2006-11-271-3/+3
| | | | Spotted by: WARNS=6
* Add the Tera scale factor, which is an easy job now.yar2006-11-272-1/+9
| | | | | More scale factors would overflow the command line where the help for "scale" were shown.
* Stop exposing things that can be private to convtbl.c.yar2006-11-272-19/+17
|
* Keep all convtbl-related constants and strings in convtbl.[ch].yar2006-11-273-50/+59
|
* Allow for large scale factors. C99 warrants thatyar2006-11-272-10/+11
| | | | | | | | | ULLONG_MAX is not less than 2^64-1; and uintmax_t cannot be more narrow than unsigned long long. This allows for scale factors up to Exa inclusively. Use plain int for the scale index to be consistent with ifcmds.c and enum.
* Return back one initializer, it is needed.yar2006-11-271-1/+1
|
* + Drop useless initializers.yar2006-11-272-17/+13
| | | | + style(9).
* Drop useless #includes.yar2006-11-272-22/+0
|
* Use C99 initializers so that we don't really have to worryyar2006-11-271-10/+9
| | | | about the order of related things at several places.
* C can enumerate things for us.yar2006-11-271-9/+11
|
* There is no reason to use __inline here because we are rather faryar2006-11-261-1/+1
| | | | from a path critical to performance.
* Don't overflow from the gigabyte scale to the bit scale if theyar2006-11-261-1/+1
| | | | | | | | number to auto-scale is >= 1024 Gb. Could be triggered on arches where ifdata counters had 64 bits. Reported by: Miroslav Slavkov on -net MFC after: 3 days
* The real contents of this file were repeated twice.yar2006-11-261-66/+0
| | | | | | | | The repetition was harmless due to a usual #ifndef _FOO_H_ wrapper. Fortunately, nobody started to hack the second copy, so just remove it from the file. MFC after: 3 days
* - When building world WITHOUT_LIBPTHREAD, link libthr to libpthread.ru2006-11-261-5/+2
| | | | | - Don't build ngctl(8) and cached(8) if threading libs aren't built. - Fix various issues in a cached(8) makefile.
* Fix and extend the -j option to pkill/pgrep WRT the jailyar2006-11-232-9/+44
| | | | | | | | | | | | | | | | | | | | | wildcard specifications. Earlier the only wildcard syntax was "-j 0" for "any jail". There were at least two shortcomings in it: First, jail ID 0 was abused; it meant "no jail" in other utils, e.g., ps(1). Second, it was impossible to match processed not in jail, which could be useful to rc.d developers. Therefore a new syntax is introduced: "-j any" means any jail while "-j none" means out of jail. The old syntax is preserved for compatibility, but now it's deprecated because it's limited and confusing. Update the respective regression tests. While I'm here, make the tests more complex but sensitive: Start several processes, some in jail and some out of jail, so we can detect that only the right processes are killed by pkill or matched by pgrep. Reviewed by: gad, pjd MFC after: 1 week
* Fix the format specifier suitable for uintmax_t.ru2006-11-231-3/+3
|
* Oops, fix the format specifier to what was intended.ru2006-11-231-2/+1
|
* Bump document date.grog2006-11-231-1/+1
| | | | | Nitpicked by: ru MFC after: 1 week
* usage: Include the - in the x flag.grog2006-11-231-3/+3
| | | | | | | main: Make -x set the hexdump; there's no obvious reason to toggle it. Nitpicked by: ru MFC after: 1 week
* Add option -x to display output values in hex in addition to decimal.grog2006-11-232-9/+24
|
* o Check that -w width is not above maximum. Use DWIDTH instead ofmaxim2006-11-221-2/+2
| | | | | | | | hardcoded constant. Reported by: Gruzicki Wlodek on BugTraq Obtained from: NetBSD, OpenBSD MFC after: 1 week
* - Fix types of "struct vmmeter" members so they are unsigned.ru2006-11-202-23/+92
| | | | | | | - Fix overflow bugs in sysctl(8), systat(1), and vmstat(8) when printing values of "struct vmmeter" in kilobytes as they don't necessarily fit into 32 bits. (Fix sysctl(8) reporting of a total virtual memory; it's in pages too.)
* In revision 1.14 I broke the -4 and -6 options of sockstat(1).keramida2006-11-121-10/+5
| | | | | | | | | | | | | | | | | Using either one of the two would result in an empty protos[] array, and no sockets were actually listed: % sockstat -4 USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS % sockstat -6 USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS % Fix this bug by tweaking appropriately the logic of handling opt_4, opt_6, opt_u and protos_defined. Submitted by: des Pointy hat: keramida
* Add support for filtering sockets by protocol type. The defaultkeramida2006-11-112-14/+127
| | | | | | | | | | | | | | | | | | | behavior of sockstat(1) will still be to show "udp", "tcp" and "divert" protocols, but we can now provide a (comma-separated) list of protocols, as in: % sockstat -P tcp to list only TCP sockets, or we can filter more than one protocol by separating the protocol names with a comma: % sockstat -P tcp,udp Protocol names are parsed with getprotobyname(3), so any protocol whose name is listed in `/etc/protocols' should work fine. Submitted by: Josh Carroll <josh.carroll@psualum.com> Approved by: des
* Try to preserve ownership and permissions when replacing an existing file.des2006-11-101-0/+2
| | | | | | PR: bin/104702 Submitted by: Kevin Day <toasty@dragondata.com> MFC after: 1 week
* Don't always print a space character in show_stat(), since a spacebde2006-11-081-12/+23
| | | | | shouldn't be printed after the last column. This restores the formatting to 79 columns.
* Add my birthdate to the calendar.laszlof2006-11-071-0/+1
| | | | Approved by: flz (mentor)
* Second stage of unbreaking thr formatting of the NICE field: decode thebde2006-11-071-15/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | priority class and use this to: - print "-" instead of a garbage value for ithreads. Print "-" instead of the unused nice value for kthreads which are (mis)classified as PRI_TIMESHARE. For such threads, the nice value can be set to nonzero by root, but it is never used (at least by the 4bsd scheduler). For ithreads, we didn't even print the unused value. - print "i<priority>" and "r<priority>" instead of a biased "<priority>" for idletime and realtime threads, Here <priority> is the priority parameter to idprio/rtprio(1). Just add the prefix and remove the bias for now. <priority> has been stored indirectly in the kernel since 2001/02/12, and even the kernel cannot recover the original value in all cases. Here we need to handle more cases than pri_to_rtp(), but actually handle fewer cases, and end up printing garbage after a thread changes its current priority while in the kernel. - for idletime and realtime threads, if they are kthreads then add a prefix of "k" to the previous string. - for idletime and realtime threads, if they in the FIFO scheduling class then add a suffix of "F" to the previous string (if it fits; the other parts of the string are sure to fit unless <priority> is garbage).
OpenPOWER on IntegriCloud