libc - Use fixed block size for db hash and btree method* Use a fixed block size for newly created hash and btree DB files instead of querying the filesystem for st_blksize. st_blksize has litt
libc - Use fixed block size for db hash and btree method* Use a fixed block size for newly created hash and btree DB files instead of querying the filesystem for st_blksize. st_blksize has little to do with what an efficient blocksize for I/O would be on a modern system.
show more ...
world - Makme shm_open() more compatible with expectations* Create a tmpfs mount in /var/run/shm and also create /var/run/shm/tmp under it, both modes 1777, to support shm_open(). No longer base
world - Makme shm_open() more compatible with expectations* Create a tmpfs mount in /var/run/shm and also create /var/run/shm/tmp under it, both modes 1777, to support shm_open(). No longer base shm_open() at the root directory.* shm_open() and shm_unlink() now access files relative to /var/run/shm. This fixes numerous ports and removes the need for numerous port patches.* Rejigger libraries using namespace.h/un-namespace.h to add _unlink() and _unlinkat() into the mix.
libc/db: Add an include guard.joerg had added one back in 2005 in 871020e7804af32d9a544b48cd250fa4but it was overwritten 8 years later in another sync with FreeBSD inabd448c3b2d3508465e48d9cfdb16
libc/db: Add an include guard.joerg had added one back in 2005 in 871020e7804af32d9a544b48cd250fa4but it was overwritten 8 years later in another sync with FreeBSD inabd448c3b2d3508465e48d9cfdb163ef88fc242e.This fixes a number of -Wredundant-decls which we'll hopefully enableby default in the future.
build - prepare for higher optimization levels* Add NO_STRICT_ALIASING, NO_STRICT_OVERFLOW, and NO_WARRAY_BOUNDS make variables as-needed.
libc - Fix numerous fork/exec*() leaks, also add mkostemp() and mkostemps().* Use O_CLOEXEC in many places to prevent temporary descriptors from leaking into fork/exec'd code (e.g. in multi-threa
libc - Fix numerous fork/exec*() leaks, also add mkostemp() and mkostemps().* Use O_CLOEXEC in many places to prevent temporary descriptors from leaking into fork/exec'd code (e.g. in multi-threaded situations).* Note that the popen code will close any other popen()'d descriptors in the child process that it forks just prior to exec. However, there was a descriptor leak where another thread issuing popen() at the same time could leak the descriptors into their exec. Use O_CLOEXEC to close this hole.* popen() now accepts the 'e' flag (i.e. "re") to retain O_CLOEXEC in the returned descriptor. Normal "r" (etc) will clear O_CLOEXEC in the returned descriptor. Note that normal "r" modes are still fine for most use cases since popen properly closes other popen()d descriptors in the fork(). BUT!! If the threaded program calls exec*() in other ways, such descriptors may unintentionally be passed onto sub-processes. So consider using "re".* Add mkostemp() and mkostemps() to allow O_CLOEXEC to be passed in, closing a thread race that would otherwise leak the temporary descriptor into other fork/exec()s.Taken-from: Mostly taken from FreeBSD
Use roundup2() from <sys/param.h> in a number of places.
libc/db: Sync with FreeBSD- libc/db/hash: cap auto-tuned block size with a value that actually works- Consider flag == 0 as the same of flag == R_NEXT- Minor changes from Berkeley DB 1.86 and f
libc/db: Sync with FreeBSD- libc/db/hash: cap auto-tuned block size with a value that actually works- Consider flag == 0 as the same of flag == R_NEXT- Minor changes from Berkeley DB 1.86 and further improvements from OpenBSD- Allow O_SYNC and O_NOFOLLOW flags in dbopen()- Plug memory leaks and a potential NULL dereference- Simplify the logic when determining whether to zero out a db file to after open().- When deleting a big key, the offset of an empty page should be bsize, not bsize-1- Avoid overwriting the cursor page when the cursor page becomes the LRU page.- Fix for sequential retrieval failure when using large key/data pairs.- Fix a crash when iterating over a hash and removing its elements.- Only squeeze a short key/value pair onto a page with other complete key/value pairs- Return meaningful errno in overflow case- Save errno before calling _close(), which may clear it- Explicitly specify bit width for on-disk data structure.Obtained-from: FreeBSD
libc - fix handling of temporary file used by hash(3)This fixes applications using DB_HASH, such as tsort, to unexpectedlytry to open a temporary file in the current directory and fail if ithas n
libc - fix handling of temporary file used by hash(3)This fixes applications using DB_HASH, such as tsort, to unexpectedlytry to open a temporary file in the current directory and fail if ithas no write permission there.Obtained from FreeBSD, r190485, by delphij: db/btree/bt_open.c: check return value of snprintf() and return value if the result is truncated. db/hash/hash_page.c: use the same way to create temporary file as bt_open.c; check snprintf() return value. Obtained from: OpenBSD
Apply FreeBSD-SA-09:07.libc - fix information leak in db(3)Obtained-from: FreeBSD
Fix format strings and a spelling errors.Obtained-from: FreeBSD
Fix a sizeof error in __bt_put.memmove() was used on pointers to size_ts, but onlysizeof(u_int32_t) bytes where copied.Obtained-from: FreeBSD
Whitespace cleanup.
- Fix several compilation warnings.- Put individual function parameter comments into a general comment to make the definition look better.Submitted-by: Alexey Slynko <slynko@tronet.ru>
Cleanup:- Ansify function definitions.- Remove (void) casts for discarded return values.
Get rid of the third clause.Add DragonFly where appropriate.
Explicitly initialize e. The code flow looks safe, but havingtwo interwoven goto flows mixed makes it a bit hard to be sure.
Include guard.
s/index/idx. Add an explicit default case to teach GCC that idx isused correctly.
Fix some warnings.
idx is always used, shut GCC up by initialising it to 0.
Rename local variables and arguments "index" to "idx".
Remove _THREAD_SAFE depenendancies. Create weakly associated stubs forposix threading calls used by libc and weak associations for procedures thata threading library would otherwise have to overri
Remove _THREAD_SAFE depenendancies. Create weakly associated stubs forposix threading calls used by libc and weak associations for procedures thata threading library would otherwise have to override. This allows a programto be linked with libc, or linked with libc + a threading library. libc_rwill be deprecated over time.Traditionally libc_r had to be linked against a threading library rather thenlibc. Linux, FreeBSD, and other UNIXes have moved either t oa thread-safelibc or a thread-capable libc. The threading capability is accomplished bymaking the appropriate thread locking calls and providing weakly referenceddummy stub functions for the case where a threading library is not linked in.Certain third party software, namely XFree/XOrg, also assume threadingstubs in libc.This is precursor work to a port of David Xu's 1:1 threading library and isalso intended as a basis to allow DragonFly to support multiple threadinglibraries.Ported-by: David Rhodus <sdrhodus@gmail.com>Primarily-ported-from: FreeBSDTesting and bug fixes by David Xu and Matt Dillon
Remove register keyword usage.Add missing $DragonFly$ keyword to the following files:src/lib/libc/db/btree/bt_utils.csrc/lib/libc/db/hash/hash_log2.csrc/lib/libc/net/getproto.csrc/lib/libc/net/
Remove register keyword usage.Add missing $DragonFly$ keyword to the following files:src/lib/libc/db/btree/bt_utils.csrc/lib/libc/db/hash/hash_log2.csrc/lib/libc/net/getproto.csrc/lib/libc/net/getprotoent.csrc/lib/libc/net/getprotoname.csrc/lib/libc/net/getservbyname.csrc/lib/libc/net/getservbyport.csrc/lib/libc/net/iso_addr.csrc/lib/libc/net/linkaddr.csrc/lib/libc/net/ns_ntoa.csrc/lib/libc/quad/muldi3.csrc/lib/libc/quad/qdivrem.csrc/lib/libc/rpc/authdes_prot.csrc/lib/libc/rpc/key_prot_xdr.csrc/lib/libcompat/4.3/insque.csrc/lib/libcompat/4.3/lsearch.csrc/lib/libcompat/4.3/remque.csrc/lib/libcompat/4.4/cuserid.csrc/lib/libcompat/regexp/regexp.csrc/lib/libcompat/regexp/regsub.csrc/lib/libcr/db/btree/bt_utils.csrc/lib/libcr/db/hash/hash_log2.csrc/lib/libcr/net/getproto.csrc/lib/libcr/net/getprotoent.csrc/lib/libcr/net/getprotoname.csrc/lib/libcr/net/getservbyname.csrc/lib/libcr/net/getservbyport.csrc/lib/libcr/net/iso_addr.csrc/lib/libcr/net/linkaddr.csrc/lib/libcr/net/ns_ntoa.csrc/lib/libcr/quad/muldi3.csrc/lib/libcr/quad/qdivrem.csrc/lib/libcr/rpc/authdes_prot.csrc/lib/libcr/rpc/key_prot_xdr.csrc/lib/libedit/common.csrc/lib/libedit/emacs.csrc/lib/libipx/ipx_ntoa.csrc/lib/libm/common_source/fmod.csrc/lib/libstand/ether.csrc/lib/libstand/fstat.csrc/lib/libstand/gets.csrc/lib/libstand/ioctl.csrc/lib/libstand/netif.csrc/lib/libstand/rarp.csrc/lib/libstand/rpc.csrc/lib/libstand/strcasecmp.csrc/lib/libstand/strtol.csrc/lib/libstand/write.c
From NetBSD 1.11:Fix a condition where the hole would be inserted in the wrong place during asplit.Inspired by FreeBSD commit, which did the same.Submitted by: Simon 'corecode' Schubert.
* Removed the __P macros from lib/ * Small fixups by me in lib/libcr, there was some stale ')' after the __P( was removed from the line above.Submitted-by: Craig Dooley <craig@xlnx-x.net>
12