summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix two problems with REG_ICASE that were introduced with the addition ofTim J. Robbins2004-09-051-13/+10
| | | | | | | | | | | | | | multibyte character support: - In CHadd(), avoid writing past the end of the character set bitmap when the opposite-case counterpart of wide characters with values less than NC have values greater than or equal to NC. - In CHaddtype(), fix a braino that caused alphabetic characters to be added to all character classes! (but only with REG_ICASE) PR: 71367 Notes: svn path=/head/; revision=134802
* Refactor a bunch of scheduler code to give basically the same behaviourJulian Elischer2004-09-051-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | but with slightly cleaned up interfaces. The KSE structure has become the same as the "per thread scheduler private data" structure. In order to not make the diffs too great one is #defined as the other at this time. The KSE (or td_sched) structure is now allocated per thread and has no allocation code of its own. Concurrency for a KSEGRP is now kept track of via a simple pair of counters rather than using KSE structures as tokens. Since the KSE structure is different in each scheduler, kern_switch.c is now included at the end of each scheduler. Nothing outside the scheduler knows the contents of the KSE (aka td_sched) structure. The fields in the ksegrp structure that are to do with the scheduler's queueing mechanisms are now moved to the kg_sched structure. (per ksegrp scheduler private data structure). In other words how the scheduler queues and keeps track of threads is no-one's business except the scheduler's. This should allow people to write experimental schedulers with completely different internal structuring. A scheduler call sched_set_concurrency(kg, N) has been added that notifies teh scheduler that no more than N threads from that ksegrp should be allowed to be on concurrently scheduled. This is also used to enforce 'fainess' at this time so that a ksegrp with 10000 threads can not swamp a the run queue and force out a process with 1 thread, since the current code will not set the concurrency above NCPU, and both schedulers will not allow more than that many onto the system run queue at a time. Each scheduler should eventualy develop their own methods to do this now that they are effectively separated. Rejig libthr's kernel interface to follow the same code paths as linkse for scope system threads. This has slightly hurt libthr's performance but I will work to recover as much of it as I can. Thread exit code has been cleaned up greatly. exit and exec code now transitions a process back to 'standard non-threaded mode' before taking the next step. Reviewed by: scottl, peter MFC after: 1 week Notes: svn path=/head/; revision=134791
* Some old tar archives rely on "regular-file-plus-trailing-slash" toTim Kientzle2004-09-041-12/+22
| | | | | | | | | | | | | | | | | | denote a directory. Unfortunately, in the presence of GNU or POSIX extensions, this code was checking the truncated filename stored in the regular header rather than the full filename stored in the extended attribute. As a result, long filenames with '/' in just the right position would trigger this check and be erroneously marked as directories. Move the check so it only considers the full filename. Note: the check can't simply be disabled for archives that contain these extensions because there are some very broken archivers out there. Thanks to: Will Froning MFC after: 3 days Notes: svn path=/head/; revision=134775
* Reset the seek pointer to 0 when a file is successfully opened,Ian Dowse2004-09-041-0/+2
| | | | | | | | | | | | | | | | since otherwise the initial seek offset will contain the directory offset of the filesystem block that contained its directory entry. This bug was mostly harmless because typically the directory is less than one filesystem block in size so the offset would be zero. It did however generally break loading a kernel from the (large) kernel compile directory. Also reset the seek pointer when a new inode is opened in read_inode(), though this is not actually necessary now because all callers set it afterwards. Notes: svn path=/head/; revision=134760
* Unbreak memmove(). Return the dst argument. While here, fix the ENDMarcel Moolenaar2004-09-041-7/+6
| | | | | | | macro to actually reference memmove, not memcpy. Notes: svn path=/head/; revision=134743
* Unbreak memcpy(). memcpy() is defined to return the dst argument.Marcel Moolenaar2004-09-041-6/+5
| | | | | | | | | By using r8 instead of r14 to do the swap, we put the dst argument in the return register. Since bcopy() doesn't clobber r8, we don't have to do anything else. This fixes ports/textproc/aspell. Notes: svn path=/head/; revision=134739
* Normalize the makefile.Alfred Perlstein2004-09-031-8/+3
| | | | | | | submitted by: ru Notes: svn path=/head/; revision=134715
* Hook libautofs to the build.Alfred Perlstein2004-09-031-1/+1
| | | | Notes: svn path=/head/; revision=134713
* Add a BUGS section and copy the wording from mmap(2)'s MAP_NOSYNC,Peter Pentchev2004-09-031-0/+9
| | | | | | | | | | | | documenting the obsoleteness of the msync(2) syscall and its single remaining purpose. PR: 70916 Submitted by: Radim Kolar <hsn@netmag.cz> MFC after: 3 days Notes: svn path=/head/; revision=134682
* Hook autofs to the build.Alfred Perlstein2004-09-022-4/+7
| | | | Notes: svn path=/head/; revision=134657
* Septepber -> SeptemberTim J. Robbins2004-09-011-1/+1
| | | | | | | Noticed by: ru Notes: svn path=/head/; revision=134620
* Back out the previous change. glob() still does use strcmp() to orderTim J. Robbins2004-09-011-4/+4
| | | | | | | pathnames. Notes: svn path=/head/; revision=134600
* Per Ruslan, bsd.lib.mk already has support for dynamically-generatedTim Kientzle2004-09-011-17/+11
| | | | | | | | | | | .h files. This simplifies the Makefile here a bit and makes it behave better in a couple of situations. While I'm here, clean up some comments and try to improve the organization a bit. Thanks to: Ruslan Ermilov (The Marvelous Makefile Guru) Notes: svn path=/head/; revision=134587
* Enter the autofs.Alfred Perlstein2004-08-314-0/+820
| | | | Notes: svn path=/head/; revision=134576
* Start the de-orbital burn of our previous FreeBSD version compat libsDavid E. O'Brien2004-08-291-3/+1
| | | | | | | | | living in usr/src. We need to use them from ports to record dependencies. Discussed with: re(scottl) Notes: svn path=/head/; revision=134491
* Add cross-reference to ftw(3).Tim J. Robbins2004-08-291-0/+1
| | | | Notes: svn path=/head/; revision=134473
* Remove the misleading description of the 'key' argument toPeter Pentchev2004-08-271-17/+1
| | | | | | | | | | | | mpool_open(3) - it is *not* really used for synchronization; in fact, it is not used at all. PR: 70929 Submitted by: Martin Kammerhofer <dada@sbox.tugraz.at> MFC after: 3 days Notes: svn path=/head/; revision=134381
* Cache uid-from-uname and gid-from-gname lookups during extraction.Tim Kientzle2004-08-271-17/+84
| | | | | | | | | | This should provide a big performance boost for folks using NIS or LDAP. MFC after: 3 days Thanks to: Jun Kuriyama (for reminding me that this was still on my TODO list) Notes: svn path=/head/; revision=134367
* Correct a denial-of-service vulnerability in zlib.Jacques Vidrine2004-08-262-0/+6
| | | | | | | | | | For reference, this bug was first reported at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=252253 Submitted by: "Dmitry V. Levin" <ldv@altlinux.org> Notes: svn path=/head/; revision=134354
* Don't forget to va_end() the va_list we get from va_copy().Dag-Erling Smørgrav2004-08-262-0/+2
| | | | | | | | Submitted by: Sean McNeil <sean@mcneil.com> MFC after: 3 days Notes: svn path=/head/; revision=134332
* Don't edit permissions of pre-existing directories during extract.Tim Kientzle2004-08-261-1/+1
| | | | | | | | | | | This closes a security hole. Otherwise, libarchive will happily extract into directories to which it lacks write permissions by resetting the permissions during the extract. Thanks to: Kris Kennaway Notes: svn path=/head/; revision=134328
* It is not legal to re-use a va_list variable. This causedTim Kientzle2004-08-261-1/+4
| | | | | | | | | a crash on amd64, in particular. Thanks to: Sean McNeil Notes: svn path=/head/; revision=134327
* Add missing brackets. It was committed from wrong tree.David Xu2004-08-262-2/+2
| | | | Notes: svn path=/head/; revision=134326
* gcc -O2 cleanup. tested for a long time.David Xu2004-08-254-8/+8
| | | | | | | Reviewed by: deischen Notes: svn path=/head/; revision=134319
* Make profiling actually work. The gcc compiler emits a call to theMarcel Moolenaar2004-08-252-4/+79
| | | | | | | | | | | | | | | | _mcount() stub when profiling is enabled. Emit this code sequence for assembly routines as welli (MCOUNT definition in <machine/asm.h>. We do not pass the GOT entry however as the 4th argument, because it's not used. The _mcount() stub calls __mcount(), which does the actual work. Define _MCOUNT_DECL to define __mcount. We do not have an implementation of mcount(), so we define MCOUNT as empty, but have a weak alias to _mcount() in _mcount.S. Note that the _mcount() stub in the kernel is slightly different from the stub in userland. This is because we do not have to worry about nested routines in the kernel. Notes: svn path=/head/; revision=134287
* note that it is the caller's responsibility to free any buffer passedAlfred Perlstein2004-08-241-0/+5
| | | | | | | to setvbuf(3) and friends. Notes: svn path=/head/; revision=134277
* Replace the current implementations of ftw() and nftw() with the OpenBSDTim J. Robbins2004-08-243-193/+208
| | | | | | | | implementations written by Todd C. Miller. These are cleaner, less buggy and actively maintained. Notes: svn path=/head/; revision=134244
* struct tm.tm_year is listed as 'years since 1900', and is signed. OnPeter Wemm2004-08-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | 64 bit systems, years roughly -2^31 through 2^31 can be represented in time_t without any trouble. 32 bit time_t systems only range from roughly 1902 through 2038. As a consequence, none of the date munging code for all the various calendar tweaks before then is present. There are other problems including the fact that there was no 'year zero' and so on. So rather than get excited about trying to figure out when the calendar jumped by two weeks etc, simply disallow negative (ie: prior to 1900) years. This happens to have an important side effect. If you bzero a 'struct tm', it corresponds to 'Jan 0, 1900, 00:00 GMT'. This happens to be representable (after canonification) in 64 bit time_t space. Zero tm structs are generally an error and mktime normally returns -1 for them. Interestingly, it tries to canonify the 'jan 0' to 'dec 31, 1899', ie: year -1. This conveniently trips the negative year test above, which means we can trivially detect the null 'tm' struct. This actually tripped up code at work. :-/ (Don't ask) Notes: svn path=/head/; revision=134231
* Make sure we allocate at least enough space for the TCB for variant I TLS.Doug Rabson2004-08-231-0/+2
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=134212
* Update documentation to match reality: glob() sorts its result accordingTim J. Robbins2004-08-231-4/+4
| | | | | | | | | | to the current LC_COLLATE setting, not in "ASCII order". PR: 54391 MFC after: 1 week Notes: svn path=/head/; revision=134208
* Pull debug symbols in for statically linked binary.David Xu2004-08-212-0/+8
| | | | | | | Reviewed by: desichen Notes: svn path=/head/; revision=134115
* Back out the call to _init_tls() - something is broken there and itDoug Rabson2004-08-211-2/+0
| | | | | | | prevents all static binaries from running. Notes: svn path=/head/; revision=134110
* Re-word warning about the UTF2 encoding, taking care to use the wordTim J. Robbins2004-08-211-3/+3
| | | | | | | "obsolete" instead of "deprecated". Notes: svn path=/head/; revision=134108
* Bump document date for previous.Tim J. Robbins2004-08-212-2/+2
| | | | Notes: svn path=/head/; revision=134107
* Re-word warning about the rune interface, taking care to use the wordTim J. Robbins2004-08-212-12/+10
| | | | | | | "obsolete" instead of "deprecated". Notes: svn path=/head/; revision=134106
* Change "deprecated" in link-time warnings about various rune functionsTim J. Robbins2004-08-214-8/+8
| | | | | | | to "obsolete". Notes: svn path=/head/; revision=134104
* Re-word compatibility section, taking care to use the word "obsolete" toTim J. Robbins2004-08-2114-54/+64
| | | | | | | | describe the 4.4BSD extension of accepting characters (runes) outside of the range of unsigned char. Notes: svn path=/head/; revision=134103
* Document when this function came into FreeBSD.David E. O'Brien2004-08-211-1/+3
| | | | Notes: svn path=/head/; revision=134093
* build libthr on amd64.David Xu2004-08-191-2/+1
| | | | Notes: svn path=/head/; revision=134052
* Adjust code to support AMD64, on AMD64, thread needs to set fsbase byDavid Xu2004-08-193-7/+31
| | | | | | | | itself before it can execute any other code, so new thread should be created with all signals are masked until after fsbase is set. Notes: svn path=/head/; revision=134051
* Add AMD64 support code.David Xu2004-08-192-0/+106
| | | | Notes: svn path=/head/; revision=134050
* Reword recent addition about memory moving.Alfred Perlstein2004-08-191-5/+4
| | | | | | | | | | | Requested by: keramida Bump .Dd Requested by: ru Notes: svn path=/head/; revision=134020
* Bring ia64 back from the dead. After a call one needs to restore theMarcel Moolenaar2004-08-181-1/+1
| | | | | | | | | | | | GP register, because it's clobbered for calls across load modules. The previous commit inserted the call to _init_tls() between the call to atexit() and the restoration of the GP register clobbered by it. Fix: restore GP before we call _init_tls(). Pointy hat: dfr@ Notes: svn path=/head/; revision=133989
* Clarify that realloc and reallocf may move the memory allocation.Alfred Perlstein2004-08-181-3/+7
| | | | Notes: svn path=/head/; revision=133985
* Always allocate a TLS area even if its empty - libpthread relies onDoug Rabson2004-08-181-7/+4
| | | | | | | | | having a valid %gs when it initialises. MFC after: 2 days Notes: svn path=/head/; revision=133949
* /me kicks cvs updateTom Rhodes2004-08-171-7/+1
| | | | | | | | | | Revert previous commit, tjr already fixed it and I was too stupid to notice this fact. Approved by: re (to avoid failing cvs ci) Notes: svn path=/head/; revision=133915
* Fix incorrect code in an example. The previous example would produceTom Rhodes2004-08-171-2/+8
| | | | | | | | | | | | | 19 column positions wide in the first line and 20 in the rest of the lines. This fixes the example to provide the correct output. PR: 53454 Noticed by: Kuang-che Wu <kcwu@kcwu.homeip.net> Submitted by: Marc Silver <marcs@draenor.org> Approved by: re (scottl) Notes: svn path=/head/; revision=133914
* Fix compile, s/tp_dtv/tp_tdv/g.David Xu2004-08-167-7/+7
| | | | Notes: svn path=/head/; revision=133857
* Fix alpha build and add __FBSDID.Doug Rabson2004-08-161-1/+4
| | | | | | | PR: 70518 Notes: svn path=/head/; revision=133821
* Bring PPC up to date with latest TLS changes.Peter Grehan2004-08-164-6/+6
| | | | Notes: svn path=/head/; revision=133806