Commit graph

81 commits

Author SHA1 Message Date
Warner Losh 5e3934b15a usr.bin: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:24:01 -07:00
Warner Losh fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Andriy Voskoboinyk 558fe07149 ipcs(1): drop obsolete error checking
This code is not reached since r77551.

PR:		201728
MFC after:	5 days
2019-02-07 14:29:45 +00:00
Li-Wen Hsu ab4a4d40ae Follow r329348 in ipcs for getting rid of the requirement to include SysV IPC
headers with _KERNEL

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D14398
2018-02-16 18:07:04 +00:00
Brooks Davis 27b95863a9 Get rid of the requirement to include SysV IPC headers with _KERNEL
defined in ipcrm by introducing _WANT_SYSVxxx_INTERNALS defines.

Reviewed by:	jhb
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14271
2018-02-16 01:33:01 +00:00
Xin LI 2404b5d277 Remove unused include.
MFC after:	2 weeks
2017-11-29 09:18:24 +00:00
Pedro F. Giffuni 1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Bryan Drewery cf990407e1 Update dependencies after r291406 added libelf to libkvm.
Unfortunately filemon/meta mode tracks all indirect dependencies here
since ld(1) is reading libelf when linking in libkvm.  Churn would be
reduced if this was able to be limited to direct dependencies.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:18:48 +00:00
Simon J. Gerraty ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty 44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty 98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Eitan Adler 340bde8178 ipcs: fix builds that use gcc
gcc gets annoyed by duplicate declarations

Reported by:	sbruno
Reviewed by:	sbruno
2015-04-14 04:52:52 +00:00
Eitan Adler 11f4012fa1 ipcs: fix warnings (WARNS=1 -> WARNS=6)
- fix shadow warnings
	- change type from off_t to size_t which is more correct and avoids
	  signed/unsigned compare
	- use new initializer format to avoid "missing values" warning

Reviewed by:	jhb
2015-04-13 19:58:11 +00:00
Baptiste Daroussin 3e11bd9e2a Convert to usr.bin/ to LIBADD
Reduce overlinking
2014-11-25 14:29:10 +00:00
Simon J. Gerraty ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Baptiste Daroussin 2b7af31cf5 use .Mt to mark up email addresses consistently (part3)
PR:		191174
Submitted by:	Franco Fichtner  <franco at lastsummer.de>
2014-06-23 08:23:05 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Ulrich Spörlein 487ac9ac21 Spelling fixes for usr.bin/ 2011-12-30 11:02:40 +00:00
Bjoern A. Zeeb 1080a2c85d Remove semaphore map entry count "semmap" field and its tuning
option that is highly recommended to be adjusted in too much
documentation while doing nothing in FreeBSD since r2729 (rev 1.1).

ipcs(1) needs to be recompiled as it is accessing _KERNEL private
variables.

Reviewed by:	jhb (before comment change on linux code)
Sponsored by:	Sandvine Incorporated
2011-07-14 14:18:14 +00:00
Xin LI 8dc79f22fa Use %zu when printing size_t.
MFC after:	1 month
2011-07-11 05:50:24 +00:00
Bjoern A. Zeeb 54e57c8145 Make the char *n_name member of struct nlist 'const'.
This avoids errors or __DECONST() from places with higher WARNS levels.

Adjust a local cache variable in ipcs to const as well
to compile in the new world order.

Suggested by:	jhb
Reviewed by:	jhb, kib, brueffer (man)
2010-06-10 14:19:51 +00:00
Ed Schouten b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
John Baldwin b648d4806b Change the ABI of some of the structures used by the SYSV IPC API:
- The uid/cuid members of struct ipc_perm are now uid_t instead of unsigned
  short.
- The gid/cgid members of struct ipc_perm are now gid_t instead of unsigned
  short.
- The mode member of struct ipc_perm is now mode_t instead of unsigned short
  (this is merely a style bug).
- The rather dubious padding fields for ABI compat with SV/I386 have been
  removed from struct msqid_ds and struct semid_ds.
- The shm_segsz member of struct shmid_ds is now a size_t instead of an
  int.  This removes the need for the shm_bsegsz member in struct
  shmid_kernel and should allow for complete support of SYSV SHM regions
  >= 2GB.
- The shm_nattch member of struct shmid_ds is now an int instead of a
  short.
- The shm_internal member of struct shmid_ds is now gone.  The internal
  VM object pointer for SHM regions has been moved into struct
  shmid_kernel.
- The existing __semctl(), msgctl(), and shmctl() system call entries are
  now marked COMPAT7 and new versions of those system calls which support
  the new ABI are now present.
- The new system calls are assigned to the FBSD-1.1 version in libc.  The
  FBSD-1.0 symbols in libc now refer to the old COMPAT7 system calls.
- A simplistic framework for tagging system calls with compatibility
  symbol versions has been added to libc.  Version tags are added to
  system calls by adding an appropriate __sym_compat() entry to
  src/lib/libc/incldue/compat.h. [1]

PR:		kern/16195 kern/113218 bin/129855
Reviewed by:	arch@, rwatson
Discussed with:	kan, kib [1]
2009-06-24 21:10:52 +00:00
Konstantin Belousov 65067cc8b0 Correct types of variables used to track amount of allocated SysV shared
memory from int to size_t. Implement a workaround for current ABI not
allowing to properly save size for and report more then 2Gb sized segment
of shared memory.

This makes it possible to use > 2 Gb shared memory segments on 64bit
architectures. Please note the new BUGS section in shmctl(2) and
UPDATING note for limitations of this temporal solution.

Reviewed by:	csjp
Tested by:	Nikolay Dzham <i levsha org ua>
MFC after:	2 weeks
2009-03-02 18:53:30 +00:00
Ruslan Ermilov 49f8bb9a95 Fix printing of shared memory limits.
MFC after:	3 days
2008-12-16 09:17:05 +00:00
Edwin Groothuis 55e2cb41f2 Add the ability to clean up all shared memory segments which are
unused in one go.

From the original PR:

	I've observed that linux apps running under the linuxulator
	have a habit of leaving behind shared memory segments which
	are unused, but which eventually cause the system to run
	out of free segments and these apps will stop working.
	ipcrm(1) currently only allows removal of unused message
	queues, shared memory segments and semaphores on an individual
	basis, or those having a matching (non-zero) key. However
	it would often be convenient to just do a complete cleanup
	of everything, usually as root.

PR:		bin/118292
Submitted by:	Callum Gibson <callumgibson@optusnet.com.au>
Not reviewed by:	grog@
Approved by:	grog@
2007-12-25 00:52:24 +00:00
Edwin Groothuis fa44a2923e Stylify ipcs/ipcs.c and ipcrm/ipcrm in preparation of the upcoming
changes as proposed in bin/118292.

Feel free to mention any I have missed, there is much to learn with
regarding to style(9).

Approved by:	grog@
2007-12-18 09:39:47 +00:00
Maxim Konovalov df2e45f7c2 o Fix typo in a comment.
PR:		bin/97292
Submitted by:	clsung
MFC after:	3 days
2006-05-15 08:20:38 +00:00
Christian S.J. Peron 9baea4b4b4 Change the data type of the upper shared memory limits from a signed
integer to an unsigned long. This lifts variables like the maximum
number of pages available for shared memory from 2^31 to 2^32 on 32
bit architectures, and from 2^31 to 2^64 on 64 bit architectures.

It should be noted that this changes breaks ABI on 64 bit architectures
because the size of the shmmax, shmmin, shmmni, shmseg and shmall members
of the shminfo structure has changed.

Silence on:	current@
2005-08-06 07:20:18 +00:00
Christian S.J. Peron 701fabc74b If sysctlbyname fails for kernel related reasons, tag the errno
string to the end of the error message. I think we used errx()
there when we really wanted an err().

MFC after:	1 week
2005-05-24 23:42:09 +00:00
Giorgos Keramidas 336c393fc0 Use 12 columns for (int) values, 20 columns for (long) and align
headers properly (right justified for numbers, left justified for
everything else).

This fixes the alignment of the fields on i386, sparc64 and amd64
today but does not dynamically assign column widths or bear in mind
that some of the values may be 64-bit in the future.

Reviewed by:	alfred
2005-03-08 13:14:46 +00:00
Stefan Farfeleder 5bcb8532a8 Turn K&R functions into prototypes. 2005-02-10 09:13:20 +00:00
Ruslan Ermilov 6c7216df78 Sort sections. 2005-01-18 13:43:56 +00:00
Robert Watson 75d6abdb7e third of several commits to allow kernel System V IPC data structures
to be modified and extended without breaking the user space ABI:

Make the "ipcs" tool, which grubs around in kernel memory to report
status relating to System V IPC, use the _kernel variants on the
System V IPC data structures.

Submitted by:	Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, SPAWAR, McAfee Research
2004-11-12 13:33:55 +00:00
Ruslan Ermilov 6a3e8b0adc Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
Ruslan Ermilov f18a58b589 Added -u to the SYNOPSIS. 2004-05-18 20:40:37 +00:00
Ruslan Ermilov f0085ed625 Bump document date on behalf of the -u option. 2004-05-18 20:38:43 +00:00
Bosko Milekic 4d2e8e5fb8 Add -u option to ipcs(1) and document it in ipcs.1
It allows you to list IPC facilities owned by username/uid.

Submitted by: Christian S.J. Peron <maneo@bsdpro.com>
PR: bin/63463
2004-03-24 04:01:43 +00:00
Ruslan Ermilov 47d7e8a96f Fixed style of DPADD and LDADD assignments as per style.Makefile(5). 2004-02-05 22:44:25 +00:00
Mitsuru IWASAKI edc4d47f55 Cosmetic fix on some TIME related columns. 2003-10-30 16:52:14 +00:00
Ruslan Ermilov fa7f4291ff Markup bits.
Approved by:	re (blanket)
2003-05-21 21:07:28 +00:00