Commit Graph

33 Commits

Author SHA1 Message Date
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
Brooks Davis
af6f4233fd Replace the last non-optional use of sbrk() in the tree with mmap().
All gmon want's is a region of memory without the overhead of malloc().
Just mapping some pages with mmap is an easy way to accomplish this.

Approved by:	jhb, cem, emaste
Obtained from:	CheriBSD (bf33e1e70b)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D5005
2016-01-21 18:17:19 +00:00
Craig Rodrigues
6db7b53b71 Add declaration to eliminate -Wmissing-prototypes warning 2015-09-20 03:59:27 +00:00
Craig Rodrigues
76470dd50e Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
2015-09-14 18:44:13 +00:00
Jilles Tjoelker
88d961f32e libc: Use O_CLOEXEC when writing gmon files (cc -pg). 2013-08-13 21:45:48 +00:00
Eitan Adler
be8490925a Allow users of gprof to get per run output files (using the pid)
PR:		bin/99800
Submitted by:	Peter Jeremy <peterjeremy@optushome.com.au>
Reviewed by:	jilles (code)
Reviewed by:	dwhite (doc)
Approved by:	cperciva
MFC after:	1 week
2012-04-29 22:19:58 +00:00
Nathan Whitehorn
840b91cc52 Provide 64-bit PowerPC support in libc.
Obtained from:	projects/ppc64
2010-07-10 14:45:03 +00:00
Marcel Moolenaar
af448c52e4 Simplify the calculation of s_scale by rewriting the FP expression to
use uintmax_t instead of float and thereby eliminating the need for
a non-FP version.

Tested on: amd64, ia64 & powerpc (book-E)
Suggested by:	bde
MFC after:	1 month
2010-07-01 00:48:00 +00:00
Marcel Moolenaar
c5e0ba5fe4 On powerpc, calculate s_scale using the non-FP version previously
specific to hp300. Since FreeBSD does not support hp300, hp300 has
been removed from the condition altogether.

The FP version broke profiling on powerpc due to invalid results.
Casting to double instead of float resolved the issue, but with
Book-E not having a FP unit, the non-FP version looked preferrable.
Note that even on AIM hardware the FP version yielded an invalid
value for s_scale, so the problem is most likely with the compiler
or with the expression itself.
2010-06-30 01:40:25 +00:00
Ed Schouten
2c201a9afe Fix many "function declaration isn't a prototype" warnings in libc.
I've only fixed code that seems to be written by `us'. There are still
many warnings like this present in resolv/, rpc/, stdtime/ and yp/.
2009-12-05 19:31:38 +00:00
Warner Losh
c879ae3536 Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.
2007-01-09 00:28:16 +00:00
Peter Grehan
7d65909eed The minbrk symbol is hidden the same on powerpc as other FreeBSD platforms. 2005-12-29 04:09:38 +00:00
David E. O'Brien
a9bdcd3711 Enable building with LIBC_SCCS defined.
Bug submitted by:	Andrea Campi <andrea+freebsd_current@webcom.it>
2004-10-16 06:32:43 +00:00
Jun Kuriyama
312f18518e Fix format strings to unbreak with -DDEBUG option. 2004-09-10 05:44:17 +00:00
David E. O'Brien
e683295e39 Use C99 compatible ASM statements. 2003-06-02 02:32:22 +00:00
Peter Wemm
0f055c5bd8 Add __amd64__ to the list of things that use HIDENAME() to hide minbrk 2003-04-30 19:29:02 +00:00
Peter Wemm
66422f5b7a Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports.  As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL.  It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha
2002-09-17 01:49:00 +00:00
Alfred Perlstein
e043516d4d Check for defined(__i386__) instead of just defined(i386) since the compiler
will be updated to only define(__i386__) for ANSI cleanliness.
2002-05-30 07:00:42 +00:00
Mark Murray
4cd0119367 Do not use __progname directly (except in [gs]etprogname(3)).
Also, make an internal _getprogname() that is used only inside
libc. For libc, getprogname(3) is a weak symbol in case a
function of the same name is defined in userland.
2002-03-29 22:43:43 +00:00
Bruce Evans
bdc5bab2eb Don't leave stack garbage in the reserved fields of the header. 2002-02-15 02:37:08 +00:00
Bruce Evans
2c316efdf3 Fixed style bugs in rev.1.5:
- missing whitespace
- strange version of warn() built out of warnx() + strerror().  Just use
  warn().
- conversion of just one of the two perror()'s to warn*()

Actually use _warn() instead of _warn(), to keep up with namespace-
unpollution for warn().
2002-02-15 02:28:50 +00:00
David E. O'Brien
a99d101352 * Remove __P and convert to ANSI prototypes.
* Remove 'register'.  (some functions had 7+ register functions...)
* Fix SCM ID's.
2002-02-01 01:39:09 +00:00
Jake Burkholder
024675337e We use HIDENAME(minbrk) on sparc64 too. 2001-12-29 06:35:19 +00:00
Daniel Eischen
d201fe46e3 Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions.  If the threads library is linked in, the real
pthread functions will pulled in.

Use the following convention for system calls wrapped by the
threads library:
	__sys_foo - actual system call
	_foo - weak definition to __sys_foo
	foo - weak definition to __sys_foo

Change all libc uses of system calls wrapped by the threads
library from foo to _foo.  In order to define the prototypes
for _foo(), we introduce namespace.h and un-namespace.h
(suggested by bde).  All files that need to reference these
system calls, should include namespace.h before any standard
includes, then include un-namespace.h after the standard
includes and before any local includes.  <db.h> is an exception
and shouldn't be included in between namespace.h and
un-namespace.h  namespace.h will define foo to _foo, and
un-namespace.h will undefine foo.

Try to eliminate some of the recursive calls to MT-safe
functions in libc/stdio in preparation for adding a mutex
to FILE.  We have recursive mutexes, but would like to avoid
using them if possible.

Remove uneeded includes of <errno.h> from a few files.

Add $FreeBSD$ to a few files in order to pass commitprep.

Approved by:	-arch
2001-01-24 13:01:12 +00:00
Jason Evans
9233c4d942 Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo().  In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate.  In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().

Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().

Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().

Make thread cancellation fully POSIX-compliant.

Suggested by:	deischen
2000-01-27 23:07:25 +00:00
Jason Evans
929273386f Add three-tier symbol naming in support of POSIX thread cancellation
points.  For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep().  The arrows represent weak aliases.  For
system calls, the pattern is _read() <-- _libc_read() <-- read().
2000-01-12 09:23:48 +00:00
Hidetoshi Shimokawa
daa2e8d835 Enable gmon/mcount on alpha. 1999-07-16 07:05:34 +00:00
John Birrell
683728f17d Change the profile data file name from gmon.out to progname.gmon
where progname comes from __progname in crt0 or crt1.
1998-09-05 07:56:36 +00:00
John Birrell
30ac8b16e2 These files are very specific to FreeBSD kernels, so silently compile
no code when building a library with __NETBSD_SYSCALLS defined.
1998-03-09 04:42:19 +00:00
Peter Wemm
f1703dfbaa Add support to enable libc to be compiled in ELF format. (#ifdef __ELF__)
In a nutshell, this macroizes the local/global symbol scoping rules
that are different in a.out and ELF.  It also makes the i386 assembler
stubs conform to i386 PIC calling conventions - the a.out ld.so didn't
object, but the ELF one needs it as it implements PIC jumps via PLT's as
well as calls.  The a.out rtld only worked because it was accidently
snooping the grandparent calling function's return address off the stack..

This also affects the libc_r code a little, because of cpp macro nesting.
1996-05-05 07:56:21 +00:00
Rodney W. Grimes
6c06b4e2aa Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
Rodney W. Grimes
58f0484fa2 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00