Commit graph

116 commits

Author SHA1 Message Date
Piotr Pawel Stefaniak 12bae251fb libcompat: silence -Wdeprecated-non-prototype
by removing unnecessary re-declarations and converting K&R-style
function definitions.

Differential Revision:	https://reviews.freebsd.org/D43723
Reviewed by:	imp, emaste
2024-02-06 20:32:46 +01:00
Warner Losh a2f733abcf lib: 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:23:59 -07:00
Warner Losh dc36d6f9bb lib: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:28 -07:00
Warner Losh b2c76c41be Remove $FreeBSD$: one-line nroff pattern
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:15 -06: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 33b5b3ef75 ftime appeared in 7th Edition Unix to replace gtime.
Note that the timezone and dst entries are always returned as 0.
2018-10-28 02:58:15 +00:00
John Baldwin 6387091e9a Use __SCSSID() for SCCS IDs.
While here, fix $FreeBSD$ ID in ftime.c to use __FBSDID instead of a static
array.
2018-06-10 02:34:41 +00:00
Pedro F. Giffuni 0ed20b78b7 libcompat: Use %hu for unsigned shorts.
Obtained from:	DragonFlyBSD (git  82e1476a)
2018-02-10 14:45:29 +00:00
Pedro F. Giffuni 5e53a4f90f lib: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified 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.
2017-11-26 02:00:33 +00:00
Pedro F. Giffuni 8a16b7a18f General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

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.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2017-11-20 19:49:47 +00:00
Warner Losh fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Enji Cooper 85626903d5 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon
2017-01-20 04:52:00 +00:00
Don Lewis d7807d5167 Fix Coverity CID 978183 Resource leak in rexec().
Close the socket if connect() fails to avoid leaking it.

Reported by:	Coverity
CID:		978183
MFC after:	1 week
2016-05-25 07:26:22 +00:00
Pedro F. Giffuni 50a7cc95da rexec(3): use NULL instead of zero for pointers. 2016-04-18 14:37:26 +00:00
Glen Barber a70cba9582 First pass through library packaging.
Sponsored by:	The FreeBSD Foundation
2016-02-04 21:16:35 +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 98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Pedro F. Giffuni 46bf2f5317 rexec(3): prevent uninitialized access to "port" variable.
CID:	1018716 (and clang static checker)
2015-02-16 21:35:29 +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
Ed Schouten 83dd4eeb78 Small style(9) fix: use tabs instead of spaces. 2010-08-08 08:19:23 +00:00
Ed Schouten 29b63864a2 Remove unneeded functions from libcompat.
Erwin fired up a ports build a couple of weeks ago and it seems the
following functions are not used by any of the 20k ports we have, which
makes me believe they don't have any purpose. Just remove them.
2010-08-06 20:13:36 +00:00
Ulrich Spörlein aa12cea2cc mdoc: order prologue macros consistently by Dd/Dt/Os
Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.

Reviewed by:	ru
Approved by:	philip, ed (mentors)
2010-04-14 19:08:06 +00:00
Ed Schouten 763ed73371 Trim down libcompat by removing <regexp.h>.
Erwin ran an exp-run with libcompat and <regexp.h> removed. It turns out
the regexp library is almost entirely unused. In fact, it looks like it
is sometimes used by accident. Because these function names clash with
libc's <regex.h>, some application use both <regex.h> and libcompat,
which means they link against the wrong regex library.

This commit removes the regexp library and reimplements re_comp() and
re_exec() using <regex.h>. It seems the grammar of the regular
expressions accepted by these functions is similar to POSIX EREs.

After this commit, 1 low-profile port will be broken, but the maintainer
already has a patch for it sitting in his mailbox.
2010-03-14 10:18:58 +00:00
Ed Schouten ff0f9d8c07 Small style(9) cleanups. 2010-03-13 18:06:17 +00:00
Ed Schouten a6c03411f2 Add warnings to <regexp.h> and <sys/timeb.h>.
These header files only provide functionality that can be used in
combination with libcompat. In order to prevent people from including
them without any actual use (which happens a lot with <sys/timeb.h>),
put a warning here to make people more aware.

This means we have to lower WARNS for libcompat, which is no big deal.
2010-03-09 21:01:12 +00:00
Ed Schouten daaf575910 Build lib/ with WARNS=6 by default.
Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and
lower it when needed.

I'm setting WARNS?=0 for secure/. It seems secure/ includes the
Makefile.inc provided by lib/. I'm not going to touch that directory.
Most of the code there is contributed anyway.
2010-01-02 09:58:07 +00:00
Xin LI ece41d22fe K&R -> ANSI 2009-06-23 23:20:09 +00:00
Roman Divacky b9c4b6b4df Add a missing parameter to ruserpass(). According to C99 6.9.1p7
K&R function is not a prototype but this is a bad style. GCC accepts
this other compilers warn or reject this.

Approved by:	kib (mentor)
2009-02-26 17:46:54 +00:00
Ed Schouten 45792eb9b8 Turn sgtty into a binary-only compatibility interface.
sgtty was the original interface to configure terminal attributes on my
UNIX-like operating systems. It has been deprecated by the POSIX termios
interface, which is implemented in almost any modern system.

An advantage of turning this into a binary compatibility interface, is
that we can now eventually remove the COMPAT_43TTY switch from kernel
configurations. This removes many ioctl()'s from the TTY layer.

While there, increase the __FreeBSD_version, which may be useful for the
people working on the Ports tree.

Reviewed by:	kib
Approved by:	philip (mentor)
2008-06-14 10:42:18 +00:00
Warner Losh ee7093a640 Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
Ruslan Ermilov 36a142c455 Expand contractions. 2005-02-13 23:45:54 +00:00
Ruslan Ermilov ab7a294721 NODOCCOMPRESS -> NO_DOCCOMPRESS
NOINFO -> NO_INFO
NOINFOCOMPRESS -> NO_INFOCOMPRESS
NOLINT -> NO_LINT
NOPIC -> NO_PIC
NOPROFILE -> NO_PROFILE
2004-12-21 09:33:47 +00:00
Ruslan Ermilov 1a0a934547 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
Ruslan Ermilov fe08efe680 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
Ruslan Ermilov 0b3cbc5c38 Axe AINC.
Submitted by:	bde
2003-07-01 15:07:01 +00:00
Philippe Charnier 82f7b9cd41 Add section number with .Xr. .Xr -> .Vt changes. 2003-06-08 10:17:24 +00:00
Philippe Charnier 0552350ecc The .Fn function 2003-03-24 16:02:05 +00:00
Ruslan Ermilov ae82896268 Consistently mark std(in|out|err) with .Dv, because that's how they
are marked up in stdio(3), and because they are defined expressions
of type "FILE *".

Approved by:	re
2002-12-04 18:57:46 +00:00
Ruslan Ermilov 1798791d24 mdoc(7) police: formatting nits.
Approved by:	re
2002-11-29 15:57:50 +00:00
Robert Drehmel 6c84d0b1a5 - Remove the lsearch() and lfind() functions and their manpage from
the compatibility library libcompat.
 - Add new implementations of lsearch() and lfind() which conform to
   IEEE Std 1003.1-2001 to libc.  Add a new manual page for them and
   add them to the makefile.
 - Add function prototypes for lsearch() and lfind() to the search.h
   header.
2002-10-16 14:29:23 +00:00
Robert Drehmel e768c1be41 - Remove the old insque() and remque() functions and their manual
page from the compatibility library.
 - Add new implementations of insque() and remque() which conform to
   IEEE Std 1003.1-2001 to libc.  Add a new manual page for them and
   connect them to the build.
 - Add the prototypes of insque() and remque() to the search.h
   header.
2002-10-16 14:00:46 +00:00
Alfred Perlstein a82bbc730e Assume __STDC__, remove non-__STDC__ code.
Submitted by: keramida
2002-05-28 17:03:12 +00:00
Ruslan Ermilov 1e46af9095 mdoc(7) police: fixed the whatis entry. 2002-05-18 15:20:28 +00:00
David E. O'Brien be04b6d190 Remove 'register' keyword. 2002-03-21 23:39:28 +00:00
Ruslan Ermilov 32eef9aeb1 mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
Ruslan Ermilov 6575e6daae mdoc(7) police: expand plain text xrefs. 2001-08-08 11:48:28 +00:00
Ruslan Ermilov c4d9468ea0 mdoc(7) police:
Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.
2001-08-07 15:48:51 +00:00