Commit Graph

2066 Commits

Author SHA1 Message Date
Ingo Weinhold
dff3f62071 pthread_exit() cannot return, but the "noreturn" attribute is really a compiler
feature (which we haven't set yet). So return some dummy value.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36068 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-07 18:27:34 +00:00
Ingo Weinhold
814f5ae159 SEM_VALUE_MAX is not POSIX. Use sysconf(_SC_SEM_VALUE_MAX) instead.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36067 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-07 18:24:13 +00:00
Ingo Weinhold
8e69b283a4 PTHREAD_ONCE_INIT only needs to be a valid initializer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36066 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-07 18:18:11 +00:00
Ingo Weinhold
72d74075da Prevent unused variable errors in case CLOCK_REALTIME is not defined.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36065 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-07 18:16:12 +00:00
Ingo Weinhold
a06cec2fdf <features.h> is not POSIX.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36064 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-07 18:14:34 +00:00
Ingo Weinhold
b22623ba6a Prevent clashes with non-POSIX macros that are (or were?) still part of some
standard and are defined in our headers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36063 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-07 18:13:49 +00:00
Ingo Weinhold
d888ea5d13 Fixed out of bounds array access.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36051 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-06 18:44:58 +00:00
Ingo Weinhold
2b76954997 Removed tests that tested undefined behavior:
* Calling pthread_{join,detach}() on non-joinable threads.
* Calling mutexattr_setpshared() on uninitialized object.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36050 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-06 18:44:18 +00:00
Ingo Weinhold
3b589a0fb7 Enable the mapping to positive POSIX error codes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36043 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-05 19:21:50 +00:00
Ingo Weinhold
4142e99f09 Copied Open POSIX Test Suite 1.5.2 to the trunk.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36040 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-05 13:10:28 +00:00
Ingo Weinhold
93de3bca5f Removed partial (unknown version) Open POSIX Test Suite from the build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36039 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-05 13:09:20 +00:00
François Revol
f3abd9ad73 Fix build.
Add test for ioctl(FIONREAD). Doesn't work much yet though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35990 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-28 19:17:30 +00:00
Stefano Ceccherini
96d7f22d56 Reverting this, since BMessage doesn't crash anymore.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35912 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-19 12:26:14 +00:00
Stefano Ceccherini
05525b50d0 Commented out BMessage::PrintToStream() calls which crash (worked before).
The tests shows that Drawing shapes within BPicture is broken.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35909 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-19 07:53:30 +00:00
Stephan Aßmus
76ab3f88df Basically, this changeset implements BShape::ArcTo(). In more detail:
* Added BShape::ArcTo() and BShapeIterator::IterateArcTo(), using a previously
   unused virtual slot. (Added the symbols for binary compatibility for GCC2
   and GCC4.)
 * Added operator=(), operator==() and operator!=() to BShape.
 * Added BShape::BezierTo() version taking three points, which is sometimes
   more convenient.
 * Added the four new shape data ops OP_LARGE_ARC_TO_CW, OP_LARGE_ARC_TO_CCW,
   OP_SMALL_ARC_TO_CW and OP_SMALL_ARC_TO_CCW. For a single arc, provided the
   radius is large enough, there are four possibilities to draw the arc, these
   are controlled by the two boolean flags to ArcTo() and mapped to the new
   commands accordingly.
 * Some style cleanup in Shape.cpp (sorry for mixing it up, but it gets
   worse below...)
 * Added ShapeTest to src/tests/servers/app.
 * Changed the way BShapes are transformed from view to screen space in the
   app_server. For arcs, it would be nontrivial to apply a proper transformation,
   it's much easier to let AGG take care of it. This affects ServerPicture as
   well.
 * Wrapped iterating the BShape into try/catch blocks in ShapeIterator. But
   I really don't understand the purpose of the class in the first place.
   Maybe it can now be dropped, since coordinates don't have to be transformed
   in place anymore.
 * Refactored copy&paste shape iteration code in Painter. The transformation
   to screen space happens there.
 * Since RemoteDrawingEngine needed to be adopted anyway, I also updated
   it for the new DrawString() with offsets version. But the client still needs
   to be adapted.
 * Style cleanup in Painter.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35905 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-18 16:58:19 +00:00
Philippe Houdoin
24957bd499 Fixed last places where resolv.conf was still expected under /etc, UserGuide included. Fixed authentication misspelling
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35898 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-18 08:48:13 +00:00
Stephan Aßmus
a9daf3d911 Improved the DrawString() method that takes offsets per glyph by making the
client provide the array size. Added version that doesn't take a string length
for convenience.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35866 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-15 15:08:07 +00:00
Stephan Aßmus
77e5acc0d9 * Extended the BView drawing API by a DrawString() version that takes an array
of locations, one for each glyph.
 * Added a test for the new functionality.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35865 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-15 13:59:14 +00:00
Ingo Weinhold
5cf6995685 The usual cleanup after Axel. ;-) Define vm_page_num_pages() which is now
used by the block cache.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35745 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-03 21:02:34 +00:00
Ingo Weinhold
27f78bf522 Fixed build after signature change in r35601.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35607 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-24 18:54:59 +00:00
Axel Dörfler
75e7a5adae * Added simple test application to be able to see node monitoring messages
in order to reproduce bug #5405.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35526 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-19 21:35:46 +00:00
Adrien Destugues
33eead339b * Improve the test for TimeFormat (style and error checking)
* Fix the TimeFormat API, there was a double free. Make it work as expected : you send it a number of seconds and it will format it properly in days, hours, minutes, seconds with proper plural.
 * Cleanup other parts of the Format API from useless things. They may get reintroduced later if we feel the need to do so.
 * AboutSystem now use TimeFormat to display the uptime in properly localized way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35506 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-17 15:35:28 +00:00
Adrien Destugues
b2c385c072 -Added new TimeFormat API for formatting and localizing a time (uptime, copy duration, ...)
-Added a very simple test that shows the API is corrupting memory and ends up crashing
-Fixed build of other locale tests


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-17 00:02:50 +00:00
Axel Dörfler
15fd71bfff * Fixed artwork directory.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35462 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-14 22:29:29 +00:00
Michael Lotz
b07ef504a0 Add a memalign test that checks for valid alignments and fills/verifies
allocated buffers to validate that the full allocated size is actually usable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35425 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-07 02:11:31 +00:00
Michael Lotz
e33d4e74c2 Update the test to cover a wider width range now that truncating doesn't crash
anymore. Also make that test string a bit more complicated.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35386 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-01 22:03:11 +00:00
Michael Lotz
8806dfd057 Adding test that shows that B_TRUNCATE_BEGINNING mode is essentially broken.
Worse yet for a small enough length it actually crashes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35379 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-01 13:39:06 +00:00
Michael Lotz
82471975d5 Adding a simple test app for the utf-8 aware BString functions. I didn't feel
like writing a full blown unittest though, sorry...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35372 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-01 04:26:05 +00:00
Ingo Weinhold
b6620ccc71 Make the {memalign,free}_etc() available in the kernel emulation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35321 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-27 19:04:46 +00:00
Ingo Weinhold
86c794e5c1 slab allocator:
* Implemented a more elaborated raw memory allocation backend (MemoryManager).
  We allocate 8 MB areas whose pages we allocate and map when needed. An area is
  divided into equally-sized chunks which form the basic units of allocation. We
  have areas with three possible chunk sizes (small, medium, large), which is
  basically what the ObjectCache implementations were using anyway.
* Added "uint32 flags" parameter to several of the slab allocator's object
  cache and object depot functions. E.g. object_depot_store() potentially wants
  to allocate memory for a magazine. But also in pure freeing functions it
  might eventually become useful to have those flags, since they could end up
  deleting an area, which might not be allowable in all situations. We should
  introduce specific flags to indicate that.
* Reworked the block allocator. Since the MemoryManager allocates block-aligned
  areas, maintains a hash table for lookup, and maps chunks to object caches,
  we can quickly find out which object cache a to be freed allocation belongs
  to and thus don't need the boundary tags anymore.
* Reworked the slab boot strap process. We allocate from the initial area only
  when really necessary, i.e. when the object cache for the respective
  allocation size has not been created yet. A single page is thus sufficient.

other:
* vm_allocate_early(): Added boolean "blockAlign" parameter. If true, the
  semantics is the same as for B_ANY_KERNEL_BLOCK_ADDRESS.
* Use an object cache for page mappings. This significantly reduces the
  contention on the heap bin locks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35232 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-21 23:10:52 +00:00
Ingo Weinhold
70742459f5 Fixed build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35176 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-19 19:38:09 +00:00
Axel Dörfler
29ddbdbb53 * Moved the "var" directory to /boot/common/.
* Moved the "tmp" directory out of /var, and to /boot/common/cache/.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35104 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-16 17:17:07 +00:00
Stephan Aßmus
9563f44bfd Patch by Humdinger:
Changed strings to sentence case in various places. This is the
case-misc.diff part of ticket #5169.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35043 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-13 10:49:58 +00:00
Stephan Aßmus
ecc1234fbe Apparently some GCC 4 fixes...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35027 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-12 20:18:50 +00:00
Oliver Tappe
15c0996174 * added small test program done by Axel (and slightly changed by myself) that
exposes a problem in our UDP-connect implementation: the local address is 
  not set as a side-effect of connecting to a specific destination.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34987 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-10 15:03:12 +00:00
Michael Lotz
14429e896e Reverted the part of r31520 that made devfs_unpublish_partition() take a raw
device path + child partition name. When a "raw" device is unpublished the node
removal notification triggers the partition and child partitions to be
unpublished/removed. Since in that case the "raw" node is already unpublished
trying to resolve it in devfs_unpublish_partition() again to unpublish the child
partitions would fail, leaving the child partition nodes behind. When a new raw
device would then become available publishing its partitions would fail because
of these left behind nodes, causing bug #4587. Seeing that this code is more
compact and straight forward anyway I don't quite see why it was changed in the
first place.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34967 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-09 03:55:38 +00:00
Ingo Weinhold
c4f9831292 Added new mutex_switch_from_read_lock() for unlocking a read lock and
starting to lock a mutex in an atomic operation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34935 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 15:31:29 +00:00
Ingo Weinhold
2ea2527fe4 R/W lock implementation:
* Changed the rw_lock_{read,write}_unlock() return values to void. They
  returned a value != B_OK only in case of user error and no-one checked them
  anyway.
* Optimized rw_lock_read_[un]lock(). They are inline now and as long as
  there's no contending write locker, they will only perform an atomic_add().
* Changed the semantics of nested locking after acquiring a write lock: Read
  and write locks are counted separately, so read locks no longer implicitly
  become write locks. This does e.g. make degrading a write lock to a read
  lock by way of read_lock + write_unlock (as used in the VM) actually work.

These changes speed up the -j8 Haiku image build on my machine by a few
percent, but more interestingly they reduce the total kernel time by 25 %.
Apparently we get more contention on other locks, now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34830 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-31 17:03:41 +00:00
Ingo Weinhold
4ccd636dcb * Removed return value checks for rw_lock_{read,write}_unlock(). The return
values are not really useful, since they should only be != B_OK in case of
  user error, and will be changed to void.
* Added tests for write lock to read lock degrading.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34829 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-31 16:42:30 +00:00
Ingo Weinhold
933764d70e * Added a framework for unit tests in the kernel. The beast is implemented as
a driver which publishes a device as "/dev/kernel_unit_tests". Commands
  can be issued by writing to the device (e.g.
  "echo help > /dev/kernel_unit_tests"), output is written to serial port/
  syslog.
* Added a few tests for rw_lock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34827 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-30 19:38:41 +00:00
Axel Dörfler
dbf4cd6df1 * Added test application written by Krzysztof Ćwiertnia for the BPushGameSound
that shows that something is obviously broken right now (I fixed some coding
  style violations, though).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34689 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-17 16:06:31 +00:00
Axel Dörfler
7d592ec4d2 * Fixed the bug that led to #5119. There was a race condition in the read path
as soon as a second thread got into the game: if a thread was notified that
  a message is ready, another thread could call read_port() and steal it before
  the previous thread could claim it. The "Extensions" menu still doesn't seem
  to work, but I would guess that is unrelated.
* The threads of the test app never exited, as read_port() returns the number
  of bytes it read, not just a status.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-16 12:51:26 +00:00
Axel Dörfler
697255873e * Added test that has multiple readers on a single port, and that drops into the
same panic as #5119.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34680 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-16 11:45:45 +00:00
Axel Dörfler
c6b85a0a7a * The transfer_area() test was not updated to its newer semantics, works again
now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34553 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-08 14:15:58 +00:00
Axel Dörfler
74e2b87511 * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34534 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 14:01:33 +00:00
Axel Dörfler
7228af3083 * Added BeBook example quoted in bug #4920 as a test application into the
repository.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34469 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-03 17:57:13 +00:00
Axel Dörfler
625990fbb9 * Fixed the build of the boot loader's heap test.
* Added realloc() test that actually succeeds.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 15:40:34 +00:00
Axel Dörfler
beef46972c * Removed obsolete disk_scanner test app.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34380 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 15:42:21 +00:00
Axel Dörfler
805b96da98 * Wrote test application for partitioning systems. Not yet 100% complete, as it
only allows top level partitions right now - support for child partitions
  would require replacing read/write/seek/etc.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34379 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 15:36:58 +00:00
Axel Dörfler
ad7bfb2e88 * Adjusted default userland module paths to today's build paths.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34378 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 15:33:22 +00:00