Commit Graph

11774 Commits

Author SHA1 Message Date
davidxu
fc58e99cef Remove libc_r's remnant code. 2008-05-06 07:27:11 +00:00
deischen
c2c95e2752 Add a comment stating not to bump the FBSDprivate version.
Don't inherit the public namespace from the private namespace.
2008-05-06 01:41:55 +00:00
jhb
08bec89ccb Revert back to accessing FILE internals directly.
(Sorry, forgot to commit this earlier.)
2008-05-05 19:38:25 +00:00
jhb
3597d738f6 Retire the __fgetcookie(), __fgetpendout(), and __fsetfileno() accessors
as we aren't hiding FILE's internals anymore.
2008-05-05 16:14:02 +00:00
jhb
d878a4042e Expose FILE's internals to the world again in all their glory. Restore
all the previous inline optimizations as well.  FILE is back to using
__mbstate_t, struct pthread *, and struct pthread_mutex *.
2008-05-05 16:03:52 +00:00
kib
c697e6f360 Do not read away the target directory entry when encountering deleted
files after a seekdir().

The seekdir shall set the position for the next readdir operation.
When the _readdir_unlocked() encounters deleted entry, dd_loc is
already advanced. Continuing the loop leads to premature read of
the target entry.

Submitted by:	Marc Balmer <mbalmer at openbsd org>
Obtained from:	OpenBSD
MFC after:	2 weeks
2008-05-05 14:05:23 +00:00
gonzo
40ba3f0b05 Add MIPS support to libdisk
Approved by:	cognet (mentor)
2008-05-04 22:24:40 +00:00
marcel
7eb9e47c82 Add __fgetcookie(), __fgetpendout() and __fsetfileno() to the private
name space.
2008-05-04 04:11:01 +00:00
marcel
0e04be0196 Unbreak build: gnu sort has been configured to grope inside struct
__sFILE. It's opaque now, so add a function that returns the pending
output bytes.

Pointy hat: jhb
2008-05-03 23:36:00 +00:00
gonzo
1f093a69bb Symbol.map is handled by cpp, so use C-style comments
Approved by:	cognet (mentor)
2008-05-03 21:16:08 +00:00
marcel
86d85f532d Unbreak build: libftpio gropes inside struct __sFILE. Implement
accessor functions for its benefit now thaat FILE is opaque.
I'm sure there's a better way. I leave that for people to work
on in a src tree that isn't broken.

Pointy hat: jhb
2008-05-03 20:09:44 +00:00
jasone
d859583ec5 Fix a comment. 2008-05-03 17:49:16 +00:00
gonzo
d0811445ef Bring C runtime bits for FreeBSD/mips from p4 mips2-jnpr branch.
Approved by:	cognet (mentor)
2008-05-03 11:16:32 +00:00
jhb
809ddff4fd Next round of stdio changes: Remove all inlining of stdio operations and
move the definition of the type backing FILE (struct __sFILE) into an
internal header.
- Remove macros to inline certain operations from stdio.h.  Applications
  will now always call the functions instead.
- Move the various foo_unlocked() functions from unlocked.c into foo.c.
  This lets some of the inlining macros (e.g. __sfeof()) move into
  foo.c.
- Update a few comments.
- struct __sFILE can now go back to using mbstate_t, pthread_t, and
  pthread_mutex_t instead of knowing about their private, backing types.

MFC after:	1 month
Reviewed by:	kan
2008-05-02 15:25:07 +00:00
jhb
c57ec28c3f Include libc_private.h for the declaration of __isthreaded instead of
relying on namespace pollution in stdio.h.

MFC after:	3 days
2008-05-02 14:51:22 +00:00
jasone
8482ff3aff Add a separate tree to track arena chunks that contain dirty pages.
This substantially improves worst case allocation performance, since
O(lg n) tree search can be used instead of O(n) tree iteration.

Use rb_wrap() instead of directly calling rb_*() macros.
2008-05-01 17:25:55 +00:00
jasone
57d95000d8 Add rb_wrap(), which creates C function wrappers for most rb_*()
macros.

Add rb_foreach_next() and rb_foreach_reverse_prev(), which make it
possible to re-synchronize tree iteration after the tree has been
modified.

Rename rb_tree_new() to rb_new().
2008-05-01 17:24:37 +00:00
dfr
0831b4437b When receiving delegated credentials, initialise our cred's linked list.
Add a bit more sanity checking for GSS-API mechanisms that claim to have
delegated creds but don't actually return a cred handle.

MFC after: 2 weeks
2008-04-30 11:29:22 +00:00
dfr
ef9dc86e55 Use global implementation of _gss_oid_equal.
MFC after: 2 weeks
2008-04-30 11:27:15 +00:00
dfr
ae8d310620 Allow null oids in _gss_oid_equal().
MFC after: 2 weeks
2008-04-30 11:25:34 +00:00
gonzo
89a95d6d44 o Add MIPS to the list of architectures with defined TLS_TCB_ALIGN
o Stick with TLS Variant II for MIPS for the moment.

  Approved by:	imp
2008-04-29 23:15:23 +00:00
gonzo
1a49460b16 Set QUANTUM_2POW_MIN and SIZEOF_PTR_2POW parameters for MIPS
Approved by: imp
2008-04-29 22:56:05 +00:00
ru
6cd344813f _setjmp.o was missing a dependency on "machine". 2008-04-29 17:42:42 +00:00
ru
8ee970a831 Don't forget to clean the "machine" symlink on amd64, otherwise bad
things may happen.

Reported by:	phk
MFC after:	3 days
2008-04-29 17:37:01 +00:00
davidxu
0e9d39ae8f Use UMTX_OP_WAIT_UINT_PRIVATE and UMTX_OP_WAKE_PRIVATE to save
time in kernel(avoid VM lookup).
2008-04-29 03:58:18 +00:00
jasone
138e8f0fdc Check for integer overflow before calling sbrk(2), since it uses a
signed increment argument, but the size is an unsigned integer.
2008-04-29 01:32:42 +00:00
rwatson
6e7532b386 Correct minor typos in SCTP man pages.
MFC after:	3 days
2008-04-28 16:57:56 +00:00
marcel
2b21ea16b3 Add support files for compiling with soft-float. This has been
copied from ARM and modified to warrant the duplication. Oh,
and to make it work for PowerPC :-)
2008-04-27 18:34:34 +00:00
kris
4a87c82b19 Increase the default MUTEX_ADAPTIVE_SPINS to 2000, after further
testing it turns out 200 was too short to give good adaptive
performance.

Reviewed by:   jeff
MFC after:     1 week
2008-04-26 13:19:07 +00:00
imp
9623d72c05 Add mips support to libm, from mips2-jnpr perforce branch. 2008-04-26 12:20:29 +00:00
imp
92f18b23d5 Bring in mips threads support from perforce mips2-jnpr branch. 2008-04-26 12:17:57 +00:00
imp
87785b8e3a Add mips support libc from the mips2-jnpr branch of perforce. 2008-04-26 12:08:02 +00:00
scf
23f167db94 Have the man page catch up with the namespace pollution cleanup that
occurred between 2001-2003.  Thanks to bde for the history lesson[1]
concerning sys/types.h and the many system calls that at one time
(pre-2001) were required by POSIX to include it.

1. http://lists.freebsd.org/pipermail/freebsd-arch/2008-April/008126.html

MFC after:	3 days
2008-04-26 02:33:53 +00:00
ru
c17c108c2a Stricter check for integer overflow. 2008-04-24 07:49:00 +00:00
marcel
38f942a4e1 Add support for gpart:
o  Correct for gpart's 1-based index, versus 0-based index used by
   legacy slicers.
o  Parse and understand the xs and xt parameters.
2008-04-24 00:11:15 +00:00
delphij
6b7d752076 Avoid various shadowed variables. libthr is now almost WARNS=4 clean except
for some const dequalifiers that needs more careful investigation.

Ok'ed by:	davidxu
2008-04-23 21:06:51 +00:00
jasone
14c9906df5 Implement red-black trees without using parent pointers, and store the
color bit in the least significant bit of the right child pointer, in
order to reduce red-black tree linkage overhead by ~2X as compared to
sys/tree.h.

Use the new red-black tree implementation in malloc, which drops
memory usage by ~0.5 or ~1%, for 32- and 64-bit systems, respectively.
2008-04-23 16:09:18 +00:00
marcel
ed972f84a3 Correct an off-by-1 for GPART. The literal partition type (i.e.
the actual UUID) is prefixed by '!' to distinguish them from
well-known aliases.

MFC after: 3 days
2008-04-23 03:00:26 +00:00
scf
cab3742f10 Add four utility functions related to struct grp processing modeled in-part
after similar calls related to struct pwd in libutil/pw_util.c:
  - gr_equal()
    Perform a deep comparison of two struct grp's.  It does a thorough, yet
    unoptimized comparison of all the members regardless of order.

  - gr_make()
    Create a string (see group(5)) from a struct grp.

  - gr_dup()
    Duplicate a struct grp.  Returns a value that is a single contiguous
    block of memory.

  - gr_scan()
    Create a struct grp from a string (as produced by gr_make()).

MFC after:	3 weeks
2008-04-23 00:49:13 +00:00
jhb
a3eb935764 Fix a leak in the recent fixes for file descriptors > SHRT_MAX. In the
case of a file descriptor we can't handle, clear the FILE structure's flags
so it can be reused.

MFC after:	1 week
Reported by:	otto @ OpenBSD
2008-04-22 17:03:32 +00:00
davidxu
b794176bc5 Use native rwlock. 2008-04-22 06:44:11 +00:00
antoine
8d9408ec26 Document that you must include <sys/param.h> before <sys/cpuset.h>.
Approved by:	rwatson (mentor)
2008-04-20 15:51:56 +00:00
ru
27e53e835a Don't forget to free() currency_symbol and asciivalue when multiple
conversion specifiers for them are present.

Submitted by:	Maxim Dounin <mdounin@mdounin.ru>
Obtained from:	NetBSD (partially)
MFC after:	3 days
2008-04-19 07:22:58 +00:00
ru
b15775c48a Better strfmon(3) conversion specifiers sanity checking.
There were no checks for left and right precisions at all, and
a check for field width had integer overflow bug.

Reported by:	Maksymilian Arciemowicz
Security:	http://securityreason.com/achievement_securityalert/53
Submitted by:	Maxim Dounin <mdounin@mdounin.ru>
MFC after:	3 days
2008-04-19 07:18:22 +00:00
jhb
ab875ea726 Next stage of stdio cleanup: Retire __sFILEX and merge the fields back into
__sFILE.  This was supposed to be done in 6.0.  Some notes:
- Where possible I restored the various lines to their pre-__sFILEX state.
- Retire INITEXTRA() and just initialize the wchar bits (orientation and
  mbstate) explicitly instead.  The various places that used INITEXTRA
  didn't need the locking fields or _up initialized.  (Some places needed
  _up to exist and not be off the end of a NULL or garbage pointer, but
  they didn't require it to be initialized to a specific value.)
- For now, stdio.h "knows" that pthread_t is a 'struct pthread *' to
  avoid namespace pollution of including all the pthread types in stdio.h.
  Once we remove all the inlines and make __sFILE private it can go back
  to using pthread_t, etc.
- This does not remove any of the inlines currently and does not change
  any of the public ABI of 'FILE'.

MFC after:	1 month
Reviewed by:	peter
2008-04-17 22:17:54 +00:00
delphij
6de397fa88 Implement fdopendir(3) by splitting __opendir2() into two parts, the upper part
deals with the usual __opendir2() calls, and the rest part with an interface
translator to expose fdopendir(3) functionality.  Manual page was obtained from
kib@'s work for *at(2) system calls.
2008-04-16 18:59:36 +00:00
delphij
71f117505a Style fixes to opendir.c:
- Use /*- for copyright block;
 - ANSIfy.
2008-04-16 18:40:52 +00:00
ru
994093cd25 Sort MAN and MLINKS. 2008-04-16 14:57:40 +00:00
ru
59a8ac0c77 Connect newly added manpages to the build.
Submitted by:	kib
2008-04-16 14:44:43 +00:00
kib
2e4b86adc7 Man pages for the openat(2), fexecve(2) and related syscalls.
Reviewed by:	ru
2008-04-16 13:03:12 +00:00