Commit Graph

140 Commits

Author SHA1 Message Date
pooka
c303bcbe4c Bit-un-rot the proplib portability layer. 2012-07-27 09:10:59 +00:00
njoly
d0e00679ff Use Lk macro when dealing with URLs. While here update or remove some
dead URL links. Another part of PR/29238.
2012-03-15 22:35:02 +00:00
wiz
276389fea6 Add missing Nd. 2011-10-17 09:24:54 +00:00
jym
afca4e3b49 Fix an implementation inconsistency with the prop_*_send_syscall() and
prop_*_recv_syscall() functions from proplib(3). They now share the
same logic as the one from prop_*_send_ioctl() functions:
- returns an int
- 0 indicates "no error", otherwise returns the error number (and
set errno)

Many consumers of the prop_*_{ioctl, syscall} expect errno to be set
on error and use err() to display the error message. As such, ensures that
errno gets set before returning from these functions.

prop_*_send_syscall() functions returned a boolean, and now return an int.
Fix all call sites to use the new paradigm (only quota2 is affected in src).

As the prop_*_{send,recv}_syscall() API appeared in -current and is only
used by the recent quota2 code, I am not bumping the lib. The API change
only affects the prop_*_send_syscall() function (recv_syscall()s were
already used correctly), so ensure you are not mixing "old" -current
quota binaries with a new proplib(3) (or the other way around). This
change will be announced via a HEADS-UP and UPDATING.

Does not affect the kernel part of proplib.

Document the correct API in prop_array(3) and prop_dictionary(3).

Thanks to Francois Tigeot for noticing the API inconsistency and
reporting it on tech-kern@.

ok bouyer@.
2011-09-30 22:08:18 +00:00
jym
7d85b0074d Indicate type of return variable for prop_dictionary_sendrecv_ioctl. 2011-09-27 11:12:49 +00:00
jmcneill
2cfa4ad9b3 prop_dictionary_get_dict: last argument is prop_dictionary_t *, not bool * 2011-08-07 11:33:03 +00:00
pgoyette
77494f64c2 Correct the example. 2011-06-19 08:53:02 +00:00
martin
235708f88f Update also the non-void pointers to the current test objects.
Finaly fixes PR lib/43964.
2011-04-20 20:00:07 +00:00
martin
e40530ec28 Fix "address of a void*" vs. void* confusion.
Part of fixing PR lib/43964.
2011-04-20 19:40:00 +00:00
wiz
d6a06aa7e9 Fix a typo and a punctuation nit. 2011-03-27 22:44:47 +00:00
bouyer
d9210c2405 Add a new libquota library, which contains some blocks to build and/or
parse quota plists; as well as a getfsquota() function to retrieve quotas
for a single id from a single filesystem (whatever filesystem this is:
a local quota-enabled fs or NFS). This is build on functions getufsquota()
(for local filesystems with UFS-like quotas) and getnfsquota();
which are also available to userland programs.
move functions from quota2_subr.c to libquota or libprop as appropriate,
and ajust in-tree quota tools.
move some declarations from kernel headers to either sys/quota.h or
quota/quota.h as appropriate. ufs/ufs/quota.h still installed because
it's needed by other installed ufs headers.
ufs/ufs/quota1.h still installed as a quick&dirty way to get a code
using the old quotactl() to compile (just include ufs/ufs/quota1.h instead of
ufs/ufs/quota.h - old code won't compile without this change and this is
on purpose).
Discussed on tech-kern@ and tech-net@ (long thread, but not much about
libquota itself ...)
2011-03-24 17:05:39 +00:00
wiz
35124272d3 Remove duplicate "the". From Henning Petersen in PR 44640. 2011-02-26 12:56:35 +00:00
njoly
236d2fbff6 Fix section for umask xrefs. 2011-02-21 13:42:57 +00:00
plunky
340f952206 prop_dictionary_internalize_from_file_returns_a_dictionary_not_an_array 2011-02-02 16:37:27 +00:00
bouyer
dc31d933b9 prop_*_copyout takes an object as second parameter, not a pointer to object. 2011-01-20 11:17:58 +00:00
wiz
3421828c26 Typos, wording. 2011-01-20 10:48:37 +00:00
wiz
7663d370d2 Add commas in enumerations. 2011-01-20 10:47:33 +00:00
wiz
bf94acf9f2 Sort sections. 2011-01-20 10:45:10 +00:00
wiz
22207ca7ad New sentence, new line. Use Dq. 2011-01-20 10:44:42 +00:00
wiz
75b38350f7 Remove trailing whitespace. 2011-01-20 10:42:19 +00:00
bouyer
07247bb748 - Implement prop_{array,dictionary}_copyout(), based on
prop_{array,dictionary}_copyout_ioctl().
- Implement prop_{array,dictionary}_recv_syscall(), which
  takes as parameter the pref we got from kernel and internalize it,
  and unmaps the buffer prop_{array,dictionary}_copyout() mapped for us.
- add a prop_{array,dictionary}_send_syscall() for symetry, which is
  an alias to prop_{array,dictionary}_externalize_to_pref()

Discussed on tech-kern@ and tech-userlevel@
2011-01-19 20:34:23 +00:00
pooka
57ec646236 Use a consistent approach for rump kernel calls made by libs.
Should investigate a dynamic approach in the future.
2010-12-14 08:04:14 +00:00
matt
19e6c76b2d Rename rb.h to rbtree.h, as it is more appropriate (c.f. ptree.h). Also
helps find code that hasn't been updated to use the new rbtree API.
2010-09-25 01:42:38 +00:00
rmind
879d5dfb5e Fixes/improvements to RB-tree implementation:
1. Fix inverted node order, so that negative value from comparison operator
   would represent lower (left) node, and positive - higher (right) node.
2. Add an argument (i.e. "context"), passed to comparison operators.
3. Change rb_tree_insert_node() to return a node - either inserted one or
   already existing one.
4. Amend the interface to manipulate the actual object, instead of the
   rb_node (in a similar way as Patricia-tree interface does).
5. Update all RB-tree users accordingly.

XXX: Perhaps rename rb.h to rbtree.h, since cleaning-up..

1-3 address the PR/43488 by Jeremy Huddleston.

Passes RB-tree regression tests.
Reviewed by: matt@, christos@
2010-09-24 22:51:50 +00:00
wiz
8f657e21de Fix typo (specifed -> specified). 2010-02-18 14:00:39 +00:00
dholland
5934d74fc2 Add two missing functions to the SYNOPSIS. From Silas Silva in PR 42415. 2009-12-14 06:06:22 +00:00
dholland
d3b64ea665 Fix some ordering inconsistencies, noted by Silas Silva in PR 42415. 2009-12-14 06:03:23 +00:00
dholland
f57683f0c7 Minor wording fix/clarification (sending -> copying) from Silas Silva
in PR 42414.
2009-12-14 05:47:30 +00:00
wiz
a7624277d5 Fix prop_dictionary_ensure_capacity signature, bump date.
From Silas Silva in PR 42413.
2009-12-05 10:17:17 +00:00
bad
83bbd9b65d Back out previous. Builds for me and on autobuild cluster. 2009-10-11 12:13:45 +00:00
wiz
8b77bca163 Sort sections. New sentence, new line. 2009-10-11 01:55:28 +00:00
christos
44443bc42e make this compile again. 2009-10-10 21:27:46 +00:00
bad
6947118ad3 Implement prop_array_externalize_to_pref(), prop_array_copyin(),
prop_dictionary_externalize_to_pref() and prop_dictionary_copyin()
as discussed in the thread:
http://mail-index.netbsd.org/tech-kern/2009/07/29/msg005594.html

Bump libprop shlib minor.
2009-10-10 18:06:53 +00:00
pooka
fbd53556dc Wipe out the last vestiges of POOL_INIT with one swift stroke. In
most cases, use a proper constructor.  For proplib, give a local
equivalent of POOL_INIT for the kernel object implementation.  This
way the code structure can be preserved, and a local link set is
not hazardous anyway (unless proplib is split to several modules,
but that'll be the day).

tested by booting a kernel in qemu and compile-testing i386/ALL
2009-09-13 18:45:10 +00:00
wiz
e923b399de New sentence, new line. 2009-05-13 22:31:59 +00:00
haad
8a85d2e387 Check if pd is not NULL before we try to lock rw lock associated with it.
This fixes proplib crash when NULL is passed to prop_dictionary_get as a
dictionary.
2009-04-14 02:53:41 +00:00
joerg
1491f958e9 Improve markup. 2009-04-09 01:18:17 +00:00
haad
0c9b734826 Fix crash where user was able to crash proplib with trying to internalize
bad xml file with non-existing data type e.g. <number>.

Problem is that poi is not NULL even in case that we haven't find any match
in data type name. We need to check if poi->poi_tag is not NULL before
calling poi->poi_intern function which is non existing case NULL and will
cause crash.
2009-03-30 07:42:51 +00:00
cegger
ebceae53e5 ansify function definitions 2009-03-15 22:20:09 +00:00
lukem
114b3fb343 sign-compare fix 2009-01-25 14:22:52 +00:00
cyber
23dc01f7e9 Properly handle empty data nodes (such as generated by Apple's
plist editor). They are in the form of <data></data>, whereas the
original code path only checked for empty being <data/>.

This causes an assert to be triggered when trying to access the node's
content.

Patch reviewed by thorpej.
2009-01-25 06:59:35 +00:00
pooka
b6e6025d0d Get rid of locks with static initializers using once and atomic ops.
This makes proplib simplelock-free.
2009-01-03 18:31:33 +00:00
haad
e51aea320a Fix two race conditions in proplib library. In prop_dictionary and prop_number
there was small window in which was entry left in rb tree with reference
count 0 which lead to rb tree coruption when another thread picked this up
before it was released.
Add 2 new members to the prop_object_t which are used for locking/unlocking
rb tree guard mutex.

Ok by joerg@, core@, thorpej@
2008-11-30 00:17:07 +00:00
haad
185aec71fe Add prop_array_add_int* and prop_array_add_uint* functions. These functions
can be used to append specified type to the end of prop_array_t.

Ok'ed by @joerg.
2008-09-11 13:15:13 +00:00
christos
ecd6bc7086 typo in comment and white-space fixes mostly from Stathis Kamperis 2008-08-11 05:54:21 +00:00
thorpej
4ce0dc3a15 Fix an issue introduced with the prop_stack change: It's not a good idea to
return a 3-value enum from a function declared to return bool.  This broke
the recurse case for prop_object_equals().  Instead, declare the object type
equals routine to return a _prop_object_equals_rv_t.

Give the same treatment to the object type free routines: declare them to
return a _prop_object_free_rv_t, and consistently check those return values
againt the enum type.

Tidy up some whitespace while we're here.
2008-08-03 04:00:12 +00:00
thorpej
1d49730690 Fix a typo. 2008-08-03 03:11:28 +00:00
matt
5a4f0c6b2b Change tree op members/typedefs to rbto_compare_* from rb_compare_* 2008-06-30 20:14:09 +00:00
thorpej
e0e4b153c9 _prop_rb_tree_insert_node() now returns true/false to indicate if the
insertion succeeded.  Update existing usage that arranges for insertions
to always succeed to assert that they do.
2008-06-17 21:29:47 +00:00
wiz
46c5658a32 Sort SEE ALSO. 2008-06-04 07:46:48 +00:00