Commit Graph

13122 Commits

Author SHA1 Message Date
Warner Losh
9b3e440b20 Make this conform to the other top-level Makefile subdir listings with
one file per line.

Suggested by: bde
2010-03-13 03:06:48 +00:00
Juli Mallett
ebe2e5dca3 Fix spelling of noreorder. 2010-03-13 02:10:20 +00:00
Xin LI
87c88b2632 Correct bugs fixed but not merged from my own tree.
Pointy hat to:	delphij
MFC after:	1 month
2010-03-13 00:15:06 +00:00
Xin LI
51e48ff21b Follow up commit to reindent the code.
MFC after:	1 month
2010-03-12 21:15:35 +00:00
Xin LI
dabae22639 Two optimizations to MI strlen(3) inspired by David S. Miller's
blog posting [1].

 - Use word-sized test for unaligned pointer before working
   the hard way.

   Memory page boundary is always integral multiple of a word
   alignment boundary.  Therefore, if we can access memory
   referenced by pointer p, then (p & ~word mask) must be also
   accessible.

 - Better utilization of multi-issue processor's ability of
   concurrency.

   The previous implementation utilized a formular that must be
   executed sequentially.  However, the ~, & and - operations can
   actually be caculated at the same time when the operand were
   different and unrelated.

   The original Hacker's Delight formular also offered consistent
   performance regardless whether the input would contain
   characters with their highest-bit set, as it catches real
   nul characters only.

These two optimizations has shown further improvements over the
previous implementation on microbenchmarks on i386 and amd64 CPU
including Pentium 4, Core Duo 2 and i7.

[1] http://vger.kernel.org/~davem/cgi-bin/blog.cgi/2010/03/08#strlen_1

MFC after:	1 month
2010-03-12 21:14:56 +00:00
Ulrich Spörlein
63d46d1d5e Fix several typos in macros or macro misusage.
Found by:	make manlint
Reviewed by:	ru
Approved by:	philip (mentor)
2010-03-12 10:01:06 +00:00
John Baldwin
1b0181df2f - Use an initializer macro to initialize fields in 'fake' FILE objects used
by *sprintf(), etc.
- Explicitly initialize _fl_mutex to PTHREAD_MUTEX_INITIALIZER for all FILE
  objects.  This is currently a nop on FreeBSD, but is import for other
  platforms (or in the future) where PTHREAD_MUTEX_INITIALIZER is not simply
  zero.

PR:		threads/141198
Reported by:	Jeremy Huddleston @ Apple
MFC after:	2 weeks
2010-03-11 17:03:32 +00:00
John Baldwin
f458b72661 Fix a bug in the previous change: remove function-local definition of
tcp_key and udp_key that shadows the global definition.

PR:		threads/144558
Submitted by:	Sam Robb
2010-03-11 16:58:15 +00:00
Marius Strobl
7e0e1004f3 Fix a typo in r204974 so that FTYPE_LNG matches the initialisers of
the opmask array.

Pointed out by:	Peter Jeremy
2010-03-11 07:46:17 +00:00
Marius Strobl
ff2f66ea79 - The OPSZ macro actually only does the right thing for int32 and int64
operands but not for double and extended double ones. Instead of trying
  to fix the macro just nuke it and unroll the loops in the correct way
  though as extended double operands turn out to be the only special case.
- For FxTO{s,d,q} the source operand is int64 so rs2 has to be re-decoded
  after setting type accordingly as it's generally decoded using the low
  2 bits as the type, which are 0 for these three instructions.
- Similarly, in case of F{s,d,q}TOx the target is int64 so rd has to be
  re-decoded using not only the operand mask appropriate for int64 but
  also the correct register number encoding.
- Use const where appropriate.
- Wrap long lines.

Submitted by:	Peter Jeremy (partly)
MFC after:	3 days
2010-03-10 19:55:48 +00:00
John Baldwin
6f88d2a870 Use thr_once() with once_t controls to initialize various thread_key_t
objects used to provide per-thread storage in the RPC code.  Almost all
of these used double-checking with a dedicated mutex (tsd_lock) to do this
before.  However, that is not always safe with more relaxed memory orders.
There were also other bugs, such as one in __rpc_createrr() that caused a
new key to be allocated each time __rpc_createrr() was invoked.

PR:		threads/144558
Reported by:	Sam Robb  samrobb of averesystems com (key leak)
MFC after:	1 week
2010-03-10 13:23:25 +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
Dag-Erling Smørgrav
b15c83408c Upgrade to OpenSSH 5.4p1.
MFC after:	1 month
2010-03-09 19:16:43 +00:00
Joel Dahl
a303eae7c8 Switch to our preferred license text.
Approved by:	jedgar
2010-03-07 07:59:05 +00:00
Ulrich Spörlein
03dab16e1d Use default WARNS setting (of 6) for lib/csu.
PR:		bin/140089
Reviewed by:	jmallett
Approved by:	ed (co-mentor)
2010-03-05 13:29:05 +00:00
Ulrich Spörlein
98b77738b8 Properly declare non-extern functions in crt1
Also move the declarations after __progname consistently to
make the distinction clearer.

Reviewed by:	jmallett
Approved by:	ed (co-mentor)
2010-03-05 13:28:05 +00:00
Warner Losh
eae951c920 Remove stale references to libkrb5.
Rejigger the SUBDIR setting a smidge: we now set all the libraries that depend
on something else, and then SUBDIR+= the rest.

A separate commit will fix the SUBDIR style to be the same as the rest
of the tree.
2010-03-04 22:01:11 +00:00
Joel Dahl
a4481a8745 Use our standard license text. No more voices in the authors head. :-)
Approved by:	trasz
2010-03-04 19:38:24 +00:00
Dag-Erling Smørgrav
1a0fda2b54 IFH@204581 2010-03-04 13:35:57 +00:00
Gregory Neil Shapiro
f37de12bbb Enable the use of nanosleep() instead of using pause() and signals.
This Makefile change can be removed when the next version of sendmail
is imported as it will have this built in to the FreeBSD conf.h section.

Submitted by:	John Marshall
MFC after:	3 days
2010-03-04 05:53:06 +00:00
Warner Losh
75b2bd679b Use ABI neutral macrosa
Submitted by:	jmallet
2010-03-03 21:59:23 +00:00
Warner Losh
800b5ba27d __main and __gccmain are no longer required, so eliminate them.
Submitted by:	jmallet@
2010-03-03 21:54:49 +00:00
Joel Dahl
2598954edc The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-03 17:07:02 +00:00
Jaakko Heinonen
967e82cae0 In reallocf(3), free the memory only when size != 0. Otherwise, when the
System V compatibility option (malloc "V" flag) is in effect a zero sized
reallocf() could cause a double free.

PR:		bin/141753
Submitted by:	Dan Lukes
2010-03-03 15:43:26 +00:00
George V. Neville-Neil
660df75e8b Add support for hwpmc(4) on the MIPS 24K, 32 bit, embedded processor.
Add macros for properly accessing coprocessor 0 registers that
support performance counters.

Reviewed by:	jkoshy rpaulo fabien imp
MFC after:	1 month
2010-03-03 15:05:58 +00:00
Doug Barton
eda14e83f2 Upgrade to version 9.6.2. This version includes all previously released
security patches to the 9.6.1 version, as well as many other bug fixes.

This version also incorporates a different fix for the problem we had
patched in contrib/bind9/bin/dig/dighost.c, so that file is now back
to being the same as the vendor version.

Due to the fact that the DNSSEC algorithm that will be used to sign the
root zone is only included in this version and in 9.7.x those who wish
to do validation MUST upgrade to one of these prior to July 2010.
2010-03-03 05:45:24 +00:00
Joel Dahl
d940309d80 The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-02 22:16:40 +00:00
Joel Dahl
edb8858bd1 The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-02 22:11:14 +00:00
Doug Barton
841024d54f Vendor import of BIND 9.6.2 2010-03-02 19:49:55 +00:00
Ulrich Spörlein
7729e3ba40 Remove redundant WARNS?=6 overrides and inherit the WARNS setting from
the toplevel directory.

This does not change any WARNS level and survives a make universe.

Approved by:        ed (co-mentor)
2010-03-02 18:44:08 +00:00
Joel Dahl
e1c6ef6aa4 The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-02 17:20:04 +00:00
Joel Dahl
f20b6c8575 The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-02 17:06:40 +00:00
Ulrich Spörlein
47e1a877c5 Always assign WARNS using ?=
- fix some nearby style bugs
- include Makefile.inc where it makes sense and reduces duplication

Approved by:	ed (co-mentor)
2010-03-02 16:58:04 +00:00
Joel Dahl
f32419adfb The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-02 07:25:20 +00:00
Robert Watson
57a6239f94 Not all programs including kvm.h include the necessary headers to use
u_int, so prefer unsigned int.

MFC after:	6 days
Pointed out by:	bz, kib, Mr Tinderbox
2010-03-01 09:46:27 +00:00
Robert Watson
ccd8bad0bb A first cut at teaching libkvm how to deal with dynamic per-CPU storage
(DPCPU):

A new API, kvm_dpcpu_setcpu(3), selects the active CPU for the purposes
of DPCPU.  Calls to kvm_nlist(3) will automatically translate DPCPU
symbols and return a pointer to the current CPU's version of the data.
Consumers needing to read the same symbol on several CPUs will invoke a
series of setcpu/nlist calls, one per CPU of interest.

This addition makes it possible for tools like netstat(1) to query the
values of DPCPU variables during crashdump analysis, and is based on
similar code handling virtualized global variables.

MFC after:	1 week
Sponsored by:	Juniper Networks, Inc.
2010-03-01 00:27:55 +00:00
Jason Evans
15f8d49756 Rewrite red-black trees to do lazy balance fixup. This improves
insert/remove speed by ~30%.
2010-02-28 22:57:13 +00:00
Jaakko Heinonen
6ca7812a19 In _gettemp(), check that the length of the path doesn't exceed
MAXPATHLEN. Otherwise the path name (or part of it) may not fit to
carrybuf causing a buffer overflow.

PR:		bin/140228
Suggested by:	jilles
2010-02-28 13:31:29 +00:00
Robert Watson
f0506e896f Fix typo in comment.
MFC after:	3 days
2010-02-27 21:58:55 +00:00
Edwin Groothuis
dcfeda6122 Split the contributed code from libc/stdtime from lib/libc/stdtime
to contrib/tzcode/stdtime.
2010-02-26 06:44:00 +00:00
Ruslan Ermilov
13c89dbfa7 Removed redundant -I. from CFLAGS and "yes" from WITHOUT_MAN. 2010-02-25 22:16:30 +00:00
Ruslan Ermilov
bee10047c0 Fixed dependencies (make checkdpadd). 2010-02-25 20:24:19 +00:00
Konstantin Belousov
4d44fc9c59 Make pause(3) implementation not depended on the legacy sigcompat.c
interfaces. Do not block rt signals during and after pause(3) calls.
Use private libc namespace to call proper methods.

MFC after:	1 week
2010-02-25 13:51:11 +00:00
Xin LI
6bca913248 Flattern zlib vendor tree. 2010-02-23 01:04:29 +00:00
Ed Schouten
3878829eeb While there, trim some trailing whitespace. 2010-02-21 14:58:01 +00:00
Ed Schouten
62399df2c9 Add proper const keywords to sysctl(3) parameters.
The `name' and `newp' arguments can be marked const, because the buffers
they refer to are never changed. While there, perform some other
cleanups:

- Remove K&R from sysctl.c.
- Implement sysctlbyname() using sysctlnametomib() to prevent
  duplication of an undocumented kernel interface.
- Fix some whitespace nits.

It seems the prototypes are now in sync with NetBSD as well.
2010-02-21 13:57:02 +00:00
Ulrich Spörlein
8fa03d08ca Fix common misspelling of hierarchy
Pointed out by:		bf1783 at gmail
Approved by:		np (cxgb), kientzle (tar, etc.), philip (mentor)
2010-02-20 10:19:19 +00:00
Gabor Kovesdan
29c271590e - More style(9) fixups
Approved by:	delphij (mentor)
2010-02-20 08:19:19 +00:00
Ruslan Ermilov
f2ee2e68d2 realloc() with a proper amount of memory.
MFC after:	3 days
2010-02-17 16:45:03 +00:00
Poul-Henning Kamp
82c59e57f3 Mention EISDIR as a possible errno. 2010-02-17 09:11:21 +00:00
Marcel Moolenaar
a6c79196a7 Define TLS_MODEL for PowerPC as well. Since PowerPC uses variant I,
like ia64, leave it empty (default model).
2010-02-16 20:46:22 +00:00
Ruslan Ermilov
e363756c8f %U was macroized in mdoc(7), escape. 2010-02-16 12:29:02 +00:00
Ulrich Spörlein
54673381cd Add missing newline in last line of file.
Uncovered via:	fromcvs vs. svn
Approved by:	ed (co-mentor)
2010-02-16 09:10:21 +00:00
Marcel Moolenaar
066d438476 Unbreak ia64: tls_model("initial-exec") is invalid, because it assumes
the static TLS model, which is fundamentally different from the dynamic
TLS model. The consequence was data corruption. Limit the attribute to
i386 and amd64.
2010-02-16 06:47:00 +00:00
Marcel Moolenaar
9436852167 The static TLS size as given by tls_static_space includes TLS_TCB_SIZE
bytes of TCB in variant I.
2010-02-16 02:22:59 +00:00
Ruslan Ermilov
96aad9c013 Though these libraries are disconnected from the build and don't
currently build, they should be kept.  [1]

Unbreak their makefiles by removing the support for the long gone
DEFAULT_THREAD_LIB knob.  (Allows the tools/make_libdeps.sh script
to succeed.)

According to:	davidxu and deischen [1]
MFC after:	3 days
2010-02-15 14:14:13 +00:00
Wojciech A. Koszek
f3cba95c5b Resort includes to match style(9) a bit more. No functional change
is expected after this commit.

Tested by:	make buildworld
Reviewed by:	hps (patch without .h changes)
2010-02-13 09:45:50 +00:00
Tom Rhodes
e5bc56aeae s/APIS/APIs - not part of the original submission. 2010-02-11 19:20:06 +00:00
Marcel Moolenaar
162110273c o Add support for COMPAT_IA32.
o  Incorporate review comments:
   -  Properly reference and lock the map
   -  Take into account that the VM map can change inbetween requests
   -  Add the fileid and fsid attributes

Credits: kib@
Reviewed by: kib@
2010-02-11 18:00:53 +00:00
Warner Losh
f634c39527 i doesn't need to be signed here, make it unsigned. 2010-02-11 17:30:30 +00:00
Tom Rhodes
0fe71aba5c Correct two typoes.
Submitted by:	Matthew Seaman <m.seaman@infracaninophile.co.uk>
2010-02-11 14:45:00 +00:00
Wojciech A. Koszek
d426c025be Remove redundand headers and use more standard ones where necessary.
Reviewed by:	hps@
2010-02-11 08:34:41 +00:00
Wojciech A. Koszek
ac840bfcf1 Use more standard way for setting nonblocking flag for a filedescriptor.
This makes libusb porting a bit easier.

There shouldn't by any negative change in behaviour after this commit.

Remove redundant headers.

Reviewed by:	hps@
2010-02-11 08:30:43 +00:00
Wojciech A. Koszek
9c7e1de8c3 Within libusb 0.1 API, bus number is always faked to 0. Device numbers,
however, are possitive and seem to be reverse sorted in the list.

Conform device numbering and bring a result that is consistent with the
libusb 0.1 API.  It is now possible to distinguish a device based on its
(bus, dev) numbers.

There shouldn't be any negative change in behavior after this commit.

Tested with:    scanimage (sane)
		http://freebsd.czest.pl/~wkoszek/qemu/l.c
Reviewed by:    hps@
2010-02-11 08:24:35 +00:00
Warner Losh
3d28af0246 Back to WARNS=3. The breakage wasn't what I thought it was :( 2010-02-11 07:09:04 +00:00
Kirk McKusick
390985729b Keep Tinderbox happy. 2010-02-11 06:22:38 +00:00
Warner Losh
178a1e6959 Increased warnings weren't tested on ARM. Bump warnings back down to
0 until it can be properly tested by those raising the warnings.
Remember: make universe is required when changing the WARNS level.
2010-02-11 04:45:08 +00:00
Martin Cracauer
3a921aa75d Fix PR
http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/143350
Empty string test gone wrong.

Testing this requires that you have a locale that has the sign string
unset but has int_n_sign_posn set (the default locale falls through to
use "()" around negative numbers which is probably another bug).

I created that setup by hand and indeed without this fix negative
numbers are put out as positive numbers (doesn't fall through to use
"-" as default indicator).

Unfixed example in nl_NL.ISO8859-1 with lc->negative_sign set to empty
string:
  strfmon(buf, sizeof(buf), "%-8i", -42.0);
==>
example2: 'EUR  42,00' 'Eu 42,00'

Fixed:
example2: 'EUR  42,00-' 'Eu 42,00-'

This file and suggested fix are identical in at least freebsd-8.
Backport might be appropriate but some expert on locales should
probably have a look at us defaulting to negative numbers in
parenthesis when LC_* is default.  That doesn't look right and is not
what other OSes are doing.

PR:		143350
Submitted by:	Corinna Vinschen
Reviewed by:	bug reporter submitted, tested by me
2010-02-10 00:02:09 +00:00
Gabor Kovesdan
fe0aca73ed - Deal with some special cases [1]
- style(9) nits

Pointed out by:	jilles [1]
Approved by:	delphij (mentor)
2010-02-09 19:37:12 +00:00
Marcel Moolenaar
14a3afd9ab Various fixes like spelling, style and syntax.
Submitted by:	ru (thanks!)
2010-02-09 18:43:20 +00:00
Marcel Moolenaar
90b4621a5f Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process can
obtain the memory map of the traced process. PT_VM_TIMESTAMP can be
used to check if the memory map changed since the last time to avoid
iterating over all the VM entries unnecesarily.

MFC after:	1 month
2010-02-09 05:52:35 +00:00
Ruslan Ermilov
2eeaf93408 Mark up "unsigned char". 2010-02-04 11:23:28 +00:00
Neel Natu
2f9f616df9 Reinstate the ptrace patch to restore the 'gp' register after calling
a function. I made a mistake in assuming that the .cprestore directive
will cause the assembler to automatically restore 'gp' after the 'jalr'.

The .cprestore directive does its magic only after 'jal' and 'bal'
instructions - not the 'jalr'.

Pointed out by: c.jayachandran@gmail.com
2010-02-04 05:49:59 +00:00
Randall Stewart
1df3671344 -White space cleanup (missing spaces in new line)
-Remove extra tab.
-Took out the duplicate code that cprestore does.
All suggested by Neel.
2010-02-03 20:54:04 +00:00
Konstantin Belousov
60d818ef9c Placate new binutils, by using 16-bit %ax instead of 32-bit %eax as an
argument for fnstsw. Explicitely specify sizes for the XMM control and
status word and X87 control and status words.

Reviewed by:	das
Tested by:	avg
MFC after:	2 weeks
2010-02-03 20:23:47 +00:00
Ed Schouten
1e7a08440a Also add a cross-reference to NetBSD updlastlogx(). 2010-02-03 19:31:02 +00:00
Randall Stewart
1de48bf3a3 This fixes a bug found and fixed by JC. Basically
no save was being done of the ra and gp pointers
before we call the __error function.

Obtained from:	JC (c.jayachandran@gmail.com)
2010-02-03 12:59:44 +00:00
Gavin Atkinson
9ba42503a5 Bump .Dd, forgotten in r203393
Approved by:	ed (mentor, implicit)
MFC after:	1 week
2010-02-02 19:44:51 +00:00
Gavin Atkinson
028a9a13eb The multiplicand a = 0x5deece66d = 25214903917, not 0xfdeece66d.
This bug in the man page has gone unnoticed for over 15 years!

PR:		docs/143461
Submitted by:	Jeremy Huddleston  jeremyhu apple.com
Approved by:	ed (mentor, implicit)
MFC after:	1 week
2010-02-02 19:28:01 +00:00
Ed Schouten
61d38d61e2 Implement strndup(3) using strnlen(3).
This makes the implementation a bit more consistent with strdup(3),
which uses strlen(3).
2010-02-02 19:02:08 +00:00
Dag-Erling Smørgrav
cc5c81f89d Respect passwordtime from login.conf if set.
PR:		bin/93473
Submitted by:	Björn König <bkoenig@cs.tu-berlin.de>
MFC after:	1 week
2010-02-02 13:47:18 +00:00
Joerg Wunsch
ca5f71b814 Finally, document libgpib.
MFC after:	3 days
2010-02-01 20:53:55 +00:00
Jason Evans
d227440524 Fix bugs:
* Fix a race in chunk_dealloc_dss().

  * Check for allocation failure before zeroing memory in base_calloc().

Merge enhancements from a divergent version of jemalloc:

  * Convert thread-specific caching from magazines to an algorithm that is
    more tunable, and implement incremental GC.

  * Add support for medium size classes, [4KiB..32KiB], 2KiB apart by
    default.

  * Add dirty page tracking for pages within active small/medium object
    runs.  This allows malloc to track precisely which pages are in active
    use, which makes dirty page purging more effective.

  * Base maximum dirty page count on proportion of active memory.

  * Use optional zeroing in arena_chunk_alloc() to avoid needless zeroing
    of chunks.  This is useful in the context of DSS allocation, since a
    long-lived application may commonly recycle chunks.

  * Increase the default chunk size from 1MiB to 4MiB.

Remove feature:

  * Remove the dynamic rebalancing code, since thread caching reduces its
    utility.
2010-01-31 23:16:10 +00:00
Rebecca Cran
ecf4b67af3 Remove extra semicolon.
Approved by:	rrs (mentor)
2010-01-31 21:47:39 +00:00
Rebecca Cran
0add3200d1 Fix typo of ENOTCONN.
Add missing RETURN VALUES section in sctp_opt_info(3).

Approved by:	rrs (mentor)
2010-01-31 21:45:14 +00:00
Marcel Moolenaar
ddc98913a2 The EFI vendor UUID for FreeBSD variables is called EFI_FREEBSD_VARIABLE
and not EFI_FREEBSD_VENDOR (cf. EFI_GLOBAL_VARIABLE).
2010-01-31 19:47:38 +00:00
Ed Schouten
49e5c8f314 Perform some cleanups to devname(3).
- Make sure the mode argument is either a character or a block device.
- Use S_IS*() instead of checking S_IF*-flags by hand.
- Don't use kern.devname when the argument is already NODEV.
- Always call snprintf with the proper amount of arguments corresponding
  with the format.
- Perform some whitespace fixes. Tabs instead of 4 spaces, missing space
  for return statement.
- Remove unneeded includes.
2010-01-31 14:51:04 +00:00
Marcel Moolenaar
eb0a7e4130 Introduce libefi -- a library around EFI runtime services and protocols.
This first commit brings 3 functions for enumerating, retrieving,
adding, removing and modifying EFI variables. The immediate use of these
include the insertion of a new boot option as part of the installation
process.

This library uses ioctl(2) requests implemented by io(4) to pass the
requests down through the kernel to EFI. These ioctl requests are only
implemented on ia64, so libefi is currently only enabled on ia64. The
interface is generic and io(4) on mad64/i386 can easily be taught to
handle these once EFI support has been added to the kernel there.
2010-01-30 04:24:03 +00:00
Gabor Kovesdan
336831f034 - Fix some style(9) bugs
Pointed out by:	bde
2010-01-29 18:33:59 +00:00
Robert Watson
992a6ccc1f You must include fcntl.h (in practice) to be able to do anything useful
with shm_open(2), as otherwise the O_ flags are undefined.

MFC after:	3 days
2010-01-29 10:32:01 +00:00
Andrew Thompson
e50ac68b3d Add a function to check if the usb devices is still connected.
Submitted by:	Hans Petter Selasky
2010-01-29 02:44:06 +00:00
Jens Schweikhardt
12613c1ae5 Correct a bunch of typos. 2010-01-27 21:01:21 +00:00
Ed Maste
648050dfd0 Add missing return, in a rare case where we can't allocate memory in
deallocate.

Submitted by:	Ryan Stone (rysto32 at gmail dot com)
Approved by:	jasone
2010-01-27 16:47:02 +00:00
Ed Schouten
bcc7f0f408 Remove pseudo-terminals from ttys(5).
When we had utmp(5), we had to list all the psuedo-terminals in ttys(5)
to make ttyslot(3) function properly. Now that pututxline(3) deals with
slot allocation internally (not based on TTY names), we don't need to
list all the TTYs on the system in ttys(5) to make user accounting work
properly.

This patch removes all the entries from the /etc/ttys files, but also
the pts(4) entries that were appended implicitly, which was added in
r154838.
2010-01-27 11:54:42 +00:00
Edward Tomasz Napierala
a4d3a13010 Add information about when nmount(2) was introduced. 2010-01-26 17:21:25 +00:00
Dag-Erling Smørgrav
78122aac3d Document HTTP digest authentication support.
Mention some prominent past contributors: Hajimu Umemoto (ipv6), Henry
Whincup (https), Jukka Ukkonen (if-modified-since) and Jean-François
Dockes (digest auth)
2010-01-26 15:06:22 +00:00
Gavin Atkinson
d76ba3efa9 Correct the HISTORY section of these man pages to show when the function,
not the "manual page example" was introduced.

Approved by:	ed (mentor, implicit)
MFC after:	1 week
2010-01-26 15:03:33 +00:00
Gavin Atkinson
621d0bd3e2 Bump .Dd, forgotten in r203025
Approved by:	ed (mentor, implicit)
MFC after:	1 week
2010-01-26 14:57:57 +00:00
Gavin Atkinson
ffae047b53 Correct the HISTORY section of these man pages to show when the function,
not the "manual page example" was introduced.

Approved by:	ed (mentor, implicit)
MFC after:	1 week
2010-01-26 14:51:54 +00:00
Gabor Kovesdan
fe1ee31bc8 - style(9)
Approved by:	delphij
2010-01-25 23:44:00 +00:00
Gabor Kovesdan
f978ef9381 Cache failing and opened catalogs in catopen() and related functions.
Continuous catopen() calls cause 4 failig stat(2) each, which means a lot
of overhead.  It is also a good idea to keep the opened catalogs in the memory
to speed up further catopen() calls to the same catalog since these catalogs
are not big at all.  In this case, we count references and only free() the
allocated space when the reference count reaches 0.  The reads and writes to
the cache are syncronized with an rwlock when these functions are called from
a threaded program.

Requested by:	kib
Approved by:	delphij
2010-01-25 23:37:49 +00:00
Pyun YongHyeon
69618fcf1f Connect smbfs related libraries and tool on sparc64.
Reviewed by:	marius
2010-01-25 18:52:47 +00:00
Doug Barton
b25d11ad65 Commit copyright-only changes to generated files as part of the
9.6.1-P3 update
2010-01-25 04:42:54 +00:00
Doug Barton
51917575cf Vendor import of BIND 9.6.1-P3 2010-01-25 04:22:19 +00:00
Ed Schouten
89c3567d32 Improve the ttyname(3) manual page.
- Remove unrelated references to tty(5).
- Remove unneeded relation with FILE *.
- Add better cross references.
2010-01-24 14:44:05 +00:00
Hajimu UMEMOTO
4f86602c03 Make strsignal(3) thread-safe.
MFC after:	2 weeks
2010-01-24 10:35:26 +00:00
Ed Schouten
9d98195dc3 EMPTY records don't have a timestamp. 2010-01-23 17:58:40 +00:00
Antoine Brodin
dd554467bb Reapply r201145 to lib/libc/gen/sem.c 2010-01-23 12:48:46 +00:00
Ed Schouten
a7607816bf Just ignore the timestamps given to pututxline().
I've noticed many applications do a bad job at timekeeping, for several
reasons:

- Applications like screen(1) don't update time records when restoring
  the old user login record.
- Many applications only set ut_tv.tv_sec, not ut_tv.tv_usec.

This causes many problems for tools such as ac(8), which require the
timestamps to be properly ordered. This is why I've decided to let the
utmpx code obtain valid timestamps itself.
2010-01-23 08:43:21 +00:00
Tim Kientzle
e066c90bb2 Don't try to hardlink block or character device nodes that come out
of cpio archives.
2010-01-23 07:57:17 +00:00
Tim Kientzle
54d2369731 Use a simpler memory-management strategy for the file objects.
Instead of trying to reference-count them and free them as soon
as they are no longer needed, we now just keep them around and free
them all when we release the archive object.  This fixes a number
of minor memory leaks, especially when reading damaged archives.
2010-01-23 07:55:53 +00:00
Tim Kientzle
58efb33976 If we can't stat a file, return the correct ARCHIVE_FAILED (this entry can't
be processed any further) and a suitable error string.
In particular, this improves the error-reporting when cpio -o is
given a nonexistent filename.
2010-01-23 07:54:15 +00:00
Tim Kientzle
8b0eda3700 Initialize the allocated 'struct zip'. 2010-01-23 07:52:44 +00:00
Tim Kientzle
68c43d86d1 Fix a memory leak when a filter fails to initialize. 2010-01-23 07:52:13 +00:00
Ed Schouten
f5ec5ddec2 English nitpicking.
Submitted by:	jmallett
2010-01-22 05:19:51 +00:00
Ed Schouten
5b2e6b2a90 Describe why pututxline() doesn't entirely conform to standards. 2010-01-22 05:09:10 +00:00
Ed Schouten
d17ad825d6 Remove comments about breaking the specification.
I've discussed this issue with the Austin Group and it will be fixed in
future revisions of the specification. The issue was that ut_line fields
weren't supposed to be valid for LOGIN_PROCESS entries, while
getutxline() would try to match these records anyway.

They also agreed on our way of implementing pututxline() without
getutxid() (which other operating systems also do), but unfortunately
they disagreed with our way of replacing DEAD_PROCESS entries, which is
a pity. The current specification allows the utmpx database to become
infinitely big over time.

See also:	http://austingroupbugs.net/view.php?id=213#c378
2010-01-22 04:53:08 +00:00
Ed Schouten
0806dd9238 Remove stale references to utmp(5) and its corresponding filenames.
I removed utmp and its manpage, but not other manpages referring to it.
2010-01-21 17:25:12 +00:00
Ed Schouten
84bee0d7fb Remove libulog from the bootstrap again.
libulog now only provides functions that are used by various packages
from the ports tree, namely the libutempter ones. There is no reason to
link it into the crunch/fixit binaries anymore.
2010-01-21 16:56:27 +00:00
Ed Maste
bc7622b746 Correct comment typo. 2010-01-21 15:01:09 +00:00
Gabor Kovesdan
124493a1de - Update Galician catalog 2010-01-21 11:36:40 +00:00
Pawel Jakub Dawidek
bb30676c15 The waitpid(2) function needs neither sys/time.h nor sys/resource.h. 2010-01-20 22:26:36 +00:00
Andrey A. Chernov
5fc5e42a2e Style: reword comment.
Submitted by:   bde
2010-01-20 11:59:46 +00:00
Andrey A. Chernov
e5732e1803 For alphasort() add reference to strcoll(3) 2010-01-20 11:55:14 +00:00
Andrey A. Chernov
e5c9c8533d Style: rename internal function to opendir_compar()
Pointed by:     bde
2010-01-20 07:36:29 +00:00
Andrey A. Chernov
888ee87295 Style: remove extra empty line in the comment.
Pointed by:     bde
2010-01-20 07:27:56 +00:00
Ed Schouten
26f87cc6ff Revert r202447 by re-exposing the old uname(3) function.
It makes hardly any sense to expose a symbol which should only be
provided for binary compatibility, but it seems we don't have a lot of
choice here. There are many autoconf scripts out there that try to
create a binary that links against the old symbol to see whether
uname(3) is present. These scripts fail to detect uname(3) now.

It should be noted that the behaviour we implement is not against the
standards:

| The following shall be declared as a function and may also be defined
| as a macro:
|
| int uname(struct utsname *);
2010-01-19 23:07:12 +00:00
Dag-Erling Smørgrav
66c82e578c Add missing DPADD and fix whitespace.
Submitted by:	ru
2010-01-19 13:31:57 +00:00
Dag-Erling Smørgrav
79ad329d0c Add HTTP digest authentication.
Submitted by:	Jean-Francois Dockes <jf@dockes.org>
Forgotten by:	des (repeatedly)
2010-01-19 10:19:55 +00:00
Andriy Gapon
9e515b1d82 fix a comment typo
MFC after:	3 days
2010-01-18 19:10:14 +00:00
Andrey A. Chernov
b9a74f2ad5 Double checking my commit I found that comment saying that
POSIX 2008 and XSI 7require strcoll() for opendir() is not true.
I can't find such requirement in POSIX 2008 and XSI 7.

So, back out that part of my commit, returning old strcmp(), and remove
this misleading comment.
2010-01-18 13:44:44 +00:00
Ed Schouten
d1b8647f1c Let pam_lastlog use random ut_id's.
By using random values for ut_id, not based on the TTY name, it is
possible to run for example login(1) multiple times on the same TTY,
without overwriting any previous records.

The output of w(1) will then be as follows:

| 12:26PM  up 2 days,  2:31, 5 users, load averages: 0.01, 0.03, 0.03
| USER       TTY      FROM                      LOGIN@  IDLE WHAT
| ed         pts/2    mekker.80386.nl          12:26PM     - w
| root       pts/2    -                        12:26PM     - w
| root       pts/2    -                        12:26PM     - w
| root       pts/2    -                        12:26PM     - w

Approved by:	des
2010-01-18 11:29:51 +00:00
David Xu
4c1c132bf4 preserve errno when processing error cases. 2010-01-18 10:29:04 +00:00
Andrey A. Chernov
dcdafd0e92 a) Use strcoll() in opendir() and alphasort() as POSIX 2008 requires.
It also matches now how our 'ls' works for years.

b) Remove comment expressed 2 fears:
 1) One just simple describe how strcoll() works in _any_ context,
 not for directories only. Are we plan to remove strcoll() from everything
 just because it is little more complex than strcmp()? I doubt, and
 directories give nothing different here. Moreover, strcoll() used
 in 'ls' for years and nobody complaints yet.

 2) Plain wrong statement about undefined strcoll() behaviour. strcoll()
 always gives predictable results, falling back to strcmp() on any
 trouble, see strcoll(3).

No objections from -current list discussion.
2010-01-18 10:17:51 +00:00
Ed Schouten
98c63a48e9 Perform several small cleanups to the utmpx code.
- Massively reduce BSS usage. Let futx_to_utx() dynamically allocate the
  structure. There is only a very small amount of applications out there
  that needs to use the utmpx database. Wasting 1 KB on unused
  structures makes little sense.

- Just let getutxid() search for matching ut_id's for any *PROCESS-type.
  This makes the code a bit more future-proof.

- Fix a POSIX-mistake: when reading POSIX and the OpenSolaris
  implementation, getutxline() must return USER_PROCESS and
  LOGIN_PROCESS records whose ut_lines match. When reading POSIX, it
  seems LOGIN_PROCESS should not use ut_line at the first place. I have
  reported this issue.
2010-01-17 21:40:05 +00:00
Ed Schouten
e35a88d3a6 Add forgotten break; keyword to getutxid().
We should not fall through to the ut_id comparison. Only ut_type should
be compared when using OLD_TIME, NEW_TIME, BOOT_TIME or SHUTDOWN_TIME.
2010-01-17 21:00:29 +00:00
Marcel Moolenaar
d3e5c802a9 Unbreak builds with _FREEFALL_CONFIG=yes, by forcing a lower WARNS
level in that case.
2010-01-17 19:47:42 +00:00
Ed Schouten
2c8d07a874 Fix a regression that was introduced in r191882.
I changed login_tty() to only work when the application is not a session
leader yet. This works fine for applications in the base system, but it
turns out various applications call this function after daemonizing,
which means they already use their own session.

If setsid() fails, just call tcsetsid() on the current session.
tcsetsid() will already perform proper security checks.

Reported by:	Oliver Lehmann
MFC after:	1 week
2010-01-17 17:52:35 +00:00
Ed Schouten
79a7dbf111 Simplify ttyslot(3).
After comparing how other systems deal with utmp/utmpx, I noticed many
systems don't even care about ttyslot(3) anymore, since utmpx doesn't
use TTY slots anyway. We don't provide any tools to access old utmp
files anymore, so there is no use in letting applications write to a
proper offset within the utmp file.

Just let ttyslot(3) always return 0, which seems to be the default
behaviour on operating systems like Linux as well.
2010-01-17 15:43:14 +00:00
Xin LI
1750e4f8d7 Correct a typo (when we talk about offset, it should
be offset, not size).

Submitted by:	pluknet at gmail com
2010-01-17 08:12:28 +00:00
Xin LI
35daa28f30 Expose stripe offset and stripe size through libgeom and geom(8) userland
utilities.

Reviewed by:	pjd, mav (earlier version)
2010-01-17 06:20:30 +00:00
Ed Schouten
023b02dea7 Unexpose the old uname(3) function.
Nowadays uname(3) is an inline function around __xuname(3). Prevent
linkage of new binaries against this compatibility function, similar to
what I did with ttyslot(3).
2010-01-16 17:05:27 +00:00
David Xu
764ce7ce7d Also call sem_module_init in sem_close to initialize mutex
with some attributes.
2010-01-15 01:19:58 +00:00
Ed Schouten
5ab7f1fc40 Add wtmpcvt(1).
This utility allows users to convert their wtmp databases to the new
format. It makes no sense for users to keep their wtmp log files if they
are unable to view them.

It basically copies ut_line into ut_id as well. This makes it possible
for last(1) and ac(8) to match login records with their corresponding
logout record.
2010-01-14 20:58:45 +00:00
Ed Schouten
c068466245 Remove ttyslot from Symbol.map anyway.
Requested by:	kan
2010-01-14 15:20:46 +00:00
Ed Schouten
6386f4da2a Unbreak pututxline() on 32-bit architectures.
I forgot to cast the size_t's back to off_t before negating them,
causing all sorts of artifacts where the log files would grow to 2^32 -
197 bytes.

Reported by:	ume
2010-01-14 15:20:09 +00:00
Ed Schouten
d496b9d0d4 Revert the change to Symbol.map, made in r202274.
Even though we use __sym_compat(), we should list the symbol in
Symbol.map.

ttyslot() is now listed as follows, which seems to do the right thing:

| Symbol table '.dynsym' contains 2755 entries:
|    Num:    Value          Size Type    Bind   Vis      Ndx Name
|    613: 00000000000477b0   121 FUNC    GLOBAL DEFAULT   10 ttyslot@FBSD_1.0

Reported by:	kib
2010-01-14 10:00:01 +00:00
Ed Schouten
7bc9f25fd0 Don't use fseeko() to obtain the file offset.
I was a bit confused with lseek(), which returns the new offset. We
should ftello() to obtain it using stdio.
2010-01-14 08:08:55 +00:00
Ed Schouten
9457bcdc60 Add two changes that should have gone into commit r202274.
Phase out ttyslot(3).

  The ttyslot() function was originally part for SUSv1, marked LEGACY in
  SUSv2 and removed later on. This function only makes sense when using
  utmp(5), because it was used to determine the offset of the record for
  the controlling TTY. It makes little sense to keep it here, because the
  new utmpx file format doesn't index based on TTY slots.
2010-01-14 05:37:43 +00:00
Ed Schouten
88b69f52ee Phase out ttyslot(3).
The ttyslot() function was originally part for SUSv1, marked LEGACY in
SUSv2 and removed later on. This function only makes sense when using
utmp(5), because it was used to determine the offset of the record for
the controlling TTY. It makes little sense to keep it here, because the
new utmpx file format doesn't index based on TTY slots.
2010-01-14 05:35:32 +00:00