Commit Graph

597 Commits

Author SHA1 Message Date
Axel Dörfler
c598298047 * Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34363 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 08:31:31 +00:00
Axel Dörfler
a4faebeb11 * Replace the FD used for fopendir() instead of closing the old one - according
to the specs, the application may still use the FD without changing its state,
  and only closedir() should finally close it.
* This fixes bug #5055.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34362 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 08:29:12 +00:00
Ingo Weinhold
ea77094b24 Replaced the hown-grown recursive lock implementation by a shared lazy
recursive lock. I haven't investigated it closer, but the previous
implementation was even broken -- "strace /bin/true" showed two
release_sem() calls, but no acquire_sem().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34342 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-29 11:17:53 +00:00
Ingo Weinhold
8bef23107e Added a lazy_recursive_lock implementation -- identical to recursive_lock,
just using a lazy_mutex instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34341 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-29 11:14:50 +00:00
Ingo Weinhold
6e06922908 Replace semaphores/benaphores in the env, fork, and user/group code by lazy
mutexes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34340 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-29 10:47:01 +00:00
Ingo Weinhold
937b23cb21 Added locking primitive lazy_mutex, which has essentially the same behaviour
as a mutex, but allocates its semaphore lazily. This comes at the cost of an
additional atomic_add() when the semaphore has actually to be acquired, but
saves the semaphore creation completely in single-threaded programs and in
any program when there's no lock contention.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-29 10:44:07 +00:00
Ingo Weinhold
93b9f21335 Added recursive lock implementation (an adapted kernel version).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34337 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-29 09:54:58 +00:00
Ingo Weinhold
d78ffde5d1 * Some minor cleanup and improved comments.
* Fixed check in hoardSbrk(): resize_area() was invoked, even if the area was
  already large enough.
* Increased the initial heap size to 64 pages. Apparently the hoard
  implementation is rather generous and the first malloc() (caused by
  __init_heap()) already required enlarging the area.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34336 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-29 09:20:58 +00:00
Axel Dörfler
f4ab5d73ce * This fixes the remaining warnings in exit.c
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34294 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 17:00:09 +00:00
Axel Dörfler
52d6f78a9a * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34292 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 16:58:36 +00:00
Axel Dörfler
d82802841c * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34290 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 16:33:03 +00:00
Axel Dörfler
486fffdaaf * Forgot to add linkat(), this really closes #4928 now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34289 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 16:30:16 +00:00
Axel Dörfler
fb2500da15 * Added missing AT_EACCESS.
* Implemented renameat(), faccessat(), fchownat(), fchmodat(), and mkfifoat().
* Added stub for mknodat().
* The kernel backend for faccessat() does not yet differentiate between
  effective and real user/group IDs, though.
* Removed B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT, as we now support everything
  (more or less). This also closes ticket #4928.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34288 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 16:17:17 +00:00
Stephan Aßmus
f89fd840a0 bonefish+stippi:
PThreads didn't have their array for the TLS values initialized.
From what we can tell, this would have been a problem for any program using
pthreads, but since all threads are pthreads now, it was much more likely to
be encountered. Like in Beam as reported in #4949 (which via libbind seems
to use some pthread stuff).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34161 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-20 18:08:56 +00:00
Ingo Weinhold
6c00aabc9e Implemented POSIX.1-2008 functions unlinkat(), symlinkat(), mkdirat(),
utimensat(), and futimens().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34010 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-12 19:14:42 +00:00
Ingo Weinhold
db2b554fa3 Moved the POSIX *at() functions and AT_* macros out of the default namespace
as long as the full set hasn't been implemented. They are guarded by the
B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT macro until then. Fixes the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33990 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 17:12:03 +00:00
Ingo Weinhold
a6147679a3 Added AT_SYMLINK_[NO]FOLLOW constants and fstatat(). Fixes the findutils
gnulib build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33987 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 14:51:25 +00:00
Axel Dörfler
492dd892ce * Removed /system/etc directory.
* /etc now points to /boot/common/etc/, and the remaining contents of the former
  "etc" are put there now, as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33986 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 14:26:42 +00:00
Axel Dörfler
0491552bc3 * Moved the "fonts" directory into the "data" directory.
* Moved fonts to where they belong.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33981 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 12:30:06 +00:00
Ingo Weinhold
b189a2014e Added readlinkat().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33978 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 11:24:46 +00:00
Ingo Weinhold
098906f1d4 * src/system/libroot/posix: Moved open.c and fcntl.c out of the unistd
directory, where they were misplaced, and joined them to fcntl.cpp.
* Added openat().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33976 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 11:15:35 +00:00
Ingo Weinhold
9e81ddee87 * Fixed fdopendir(): We have to explicitly (re-)open the directory, because FDs
returned by open() aren't suitable for directory iteration and because checks
  have to be performed (like whether this is a directory at all and whether the
  user has read permission).
* Added __create_dir_struct() for the attribute, index, and query open
  functions to use instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 10:55:43 +00:00
Axel Dörfler
ecf6b86c92 * The pthread_thread structure is now allocated for all threads.
* Therefore, all pthread functions should now work fine on all threads.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33967 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-09 21:33:35 +00:00
Axel Dörfler
bde1f75946 * Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-07 10:58:18 +00:00
Ingo Weinhold
9c7b2520c2 Added get_pthread_thread_id() function returning the Haiku thread_id of a
pthread.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33927 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-07 08:19:24 +00:00
Jérôme Duval
15f18c0947 added missing posix functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33867 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-03 20:04:10 +00:00
Oliver Tappe
7e0d60f5b7 adding POSIX-functions llround*(), which Maxime reported missing
* copied implementations for llround(), llroundf() and llroundl() from
  glibc-2.3.2
* added corresponding declarations to math.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33863 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-02 19:13:15 +00:00
Axel Dörfler
954da749a5 * Added SCHED_SPORADIC, and sorted the constants the way it's done in the specs.
* Also changed their numbering.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33788 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-27 13:10:17 +00:00
Axel Dörfler
d88b4037b0 * Reduce maximum priority to B_URGENT_DISPLAY_PRIORITY; real time threads isn't
really something to play with without knowing the outcome.
* Fixed indentation/coding style violations introduced with r33783. Please take
  more care when accepting patches!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33787 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-27 12:34:27 +00:00
Jérôme Duval
f386c5910b Patch from Michael Franz (ticket #4696): sched.h and pthreads to allow setting of the thread priority
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-26 22:56:43 +00:00
Jérôme Duval
91844cc151 Patch from Olivier Coursiere (ticket #4064): cond_wait always return EAGAIN with an unitialized pthread_cond_t
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33779 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-26 19:28:14 +00:00
Axel Dörfler
ebcd4e1ada * Applied patch by "v" with minor changes; this allows the posixtestsuite's
pthread_create 2-1 interface conformance test to pass.
* Also fixed return values to be in the POSIX error range in case we ever switch
  them by default.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33775 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-26 17:11:02 +00:00
Axel Dörfler
b716ef33bf * pthread_create() will now check if attr is initialized, thus fixing bug #4827.
* pthread_kill() no longer sets errno.
* Use POSIX error codes in POSIX code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33774 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-26 16:49:11 +00:00
Michael Lotz
ee7ec20503 Account for single page allocations. They aren't used anywhere right now because
the bin sizes ensure that when hitting this case it always allocates multiple
pages. This makes it more flexible for other use cases though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33726 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-22 13:06:15 +00:00
Michael Lotz
6bb413270b The allocation size wasn't updated on an area based realloc that would still
fit into the existing area. In that case further reallocs could then assume the
wrong previous size and then not copy enough from the original buffer, leading
to lost bytes at the end of the new buffer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33724 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-22 12:05:50 +00:00
Michael Lotz
432cc51cc7 Add small but very important missing detail. Before blocking it didn't set the
wait status and therefore would return directly without actually blocking.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-20 19:05:35 +00:00
Oliver Tappe
571d840abf * dropped svn:keywords property from all files that carried it
to avoid recurring problems during migration of subversion checkouts
  (restored binary files that were garbled by subversions during checkout)
* added appropriate svn:mime-type property for problematic (binary) files
* removed a single (mistyped) svn:mimetype property 
* dropped svn:eol-style property for cleanup (they all contained 'native')



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33670 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-19 22:42:52 +00:00
Michael Lotz
b501a0387d anevilyak+korli+mmlr:
* Check for overflows in memory allocation. If someone happened to (erroneously)
  try to allocate a negative amount of memory we could overflow and crash
  because of the sizes getting messed up.
* Review and update the alignment logic which was a bit broken for the huge
  allocation case (reaching the area threshold). Also assert the results so
  next time this will be easier to spot.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33638 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-18 12:35:49 +00:00
Axel Dörfler
ec2719329c * Fixed timezones directory path.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33607 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-16 08:26:56 +00:00
Michael Lotz
3bb69a8235 * Use mutex and rw_lock and the proper AutoLockers as in the kernel version, as
these interfaces are now available.
* Don't be quite so paranoid by default, the checks that are on by default
  should be enough to detect most memory corruptions.

This makes the debug heap way more usable, so much that you can even use it as
your normal everyday heap without noticing much performance impact (it has quite 
a bit of additional memory overhead though).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33544 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-12 11:29:25 +00:00
Michael Lotz
93b63126e1 Adding mutex and rw_lock with the same interface as the kernel versions to
libroot. The mutex is a simple benaphore, the rw_lock is pretty much the same
as the one from libkernelland_emu but uses a mutex per lock instead of emulating
a global thread lock. Also added MutexLocking and RWLock{Read|Write}Locking and
AutoLockers based on them. It's cased with __cplusplus so the locks are also
usable from C. Everything's currently exposed in shared/private/locks.h but I
think we should make these locking primitves public.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33543 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-12 11:19:33 +00:00
François Revol
858a20cab8 Patch by Vincent Duvert:
Remove the 4 cores limit at boot, and fix the allocator to handle 8 cores.
There are still performance problems, but this allows booting with 8 cores.
WARNING: since this changes x86 platform kernel args, you really don't want to update haiku_loader and kernel_x86 separately!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33349 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-29 13:07:10 +00:00
Oliver Tappe
425cb3d716 * revert r32999 and adjusted each filesystem to return B_NOT_A_DIRECTORY in
its open_dir() implementation instead (as suggested by Ingo).
-alphabranch (it's only a cleanup)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33025 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-09 13:45:12 +00:00
Oliver Tappe
be628a94e2 * opendir() is supposed to return ENOTDIR if the given path is not
a directory, we returned EINVAL instead, which caused Perl's internal
  glob() implementation to fail prematurely
+alphabranch (will do that myself in a minute)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-08 15:59:51 +00:00
Michael Lotz
aad5c04223 Add valloc() and posix_memalign() to malloc debug heap.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32954 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-06 05:13:01 +00:00
Michael Lotz
a712373138 Apply fix of r32951 to malloc debug heap as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-06 05:11:48 +00:00
Michael Lotz
185fd1c5d2 Ported over the kernel heap to libroot to make use of it's validation
capabilities to aid in debugging memory corruption issues.

It does:
* Initialize memory to 0xcc to help turn up use of uninitialized memory
* Set freed memory to 0xdeadbeef to help find accesses of freed memory
* Use the paranoid heap validation to turn up many cases of memory corruption
* Use a simplistic wall check to turn up memory overwrites past allocations
* Take extra steps to validate freed addresses to turn up misaligned frees

It has an interface to en-/disable paranoid validation and to start/stop regular
wall checking. Both are currently just enabled. At a later stage a debug version
of libroot could be used by an application and the checks enabled at will. Note
that due to the paranoid validation and the suboptimal locking this allocator
will perform horribly. Still to find memory corruption issues in the system or
also in your applications it can be helpful to build your installation with it
turned on. To enable it you currently need to edit the Jamfile to sub-include
the malloc_debug instead of the malloc directory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32894 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-01 18:15:30 +00:00
Ingo Weinhold
adbf8b25f8 * Added fdopendir() (POSIX).
* Got rid of <dirent_private.h> -- the __DIR structure is private to dirent.c,
  now. The attribute directory, index directory, and query functions use the
  the public POSIX API, so does the kernel module code. Those components were
  not initializing the structure correctly anymore since the introduction of
  telldir()/seekdir().

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32819 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-29 20:25:24 +00:00
Axel Dörfler
6a9eee5845 * We support the timespec stat times, so why not allowing the user to set
the times with higher resolution as well?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32814 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-29 15:53:15 +00:00
Axel Dörfler
e09d819b6c * Since the Media/Translation Kit errors are now in Errors.h as well, we don't
need to include those two anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32781 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-28 13:01:33 +00:00
Stefano Ceccherini
11dbc6cf7a Reverted r28531 since we have working wcrtomb() and mbrtowc().
Seems like we didn't remember to change it back, even
with the #warning. :-)
I tested ftp and it works fine. This also closes ticket #4176.
+alphabranch 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32766 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-27 20:33:18 +00:00
Ingo Weinhold
2fb48fb46b Added missing ENOATTR text.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-26 01:01:43 +00:00
Ingo Weinhold
b02c147c05 Implemented seekdir() and telldir(). They were declared in <dirent.h> already.
So either +alphabranch or remove the declarations from <dirent.h>.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32679 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-25 22:16:40 +00:00
Jonas Sundström
9fbc65a94d Modified *jmp stubs for arch mipsel. Removed PowerPC asm.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-23 03:17:13 +00:00
Jonas Sundström
fe3763173c Add jamfile to build generic memcpy and memset for arch mipsel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32497 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-18 15:34:23 +00:00
Jonas Sundström
ac5f5cdf01 Define IEEE-endianness for arch mipsel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32464 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-17 14:59:19 +00:00
Jonas Sundström
31a36e3021 mipsel wip
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32462 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-17 14:49:04 +00:00
François Revol
33a3c23a00 [GSoC] [ARM] Patch by Johannes Wischert.
- cleanup,
- implement atomic_set() for PXA and other pre-arm6.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 14:22:53 +00:00
François Revol
f4e0ad68b3 [ARM]
- fixed copyright,
- added a naive armv5 implementation for __swap_int{16,32}.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32294 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 04:32:05 +00:00
François Revol
43da1b4f11 [ARM]
Condition the exclusive ops to >= armv6 instead of specific version.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32277 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-12 14:17:05 +00:00
François Revol
166983b771 [ARM]
Stub out swap funcs for pre armv6 which lack REV/REV16. WRITEME.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32240 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-11 03:24:22 +00:00
François Revol
541e58f98f Seems r31815 got MIA due to r31919+r31925...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32196 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-08 00:18:59 +00:00
Oliver Tappe
a50f9555a8 * re-added the broken bsd-version of strtod.c, as our kernel depends on strtod,
too, and I do not dare to add a glibc-based source to our kernel.
  This means that our kernel will have to live with strod() yielding
  inaccurate results, but since the only use I have found was for fs-queries,
  I think we can cope for now.
* added a comment to the top of strtod.c that explains the current state.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31925 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 17:07:00 +00:00
Oliver Tappe
8c359d8eb4 * small cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31920 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 16:22:00 +00:00
Oliver Tappe
4f86db4973 * replaced broken bsd-inherited implementation of strtod() with the glibc
version that lives in our repo, too, and actually works as intended
* removed the broken strtod() implementation from the repo
This fixes all floating-point test regressions reported in #3308.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31919 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 16:03:14 +00:00
Oliver Tappe
c11fb6fd9f * removed a TODO that no longer applies
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31914 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 15:45:14 +00:00
Axel Dörfler
8ae594ffd4 * Introduced dedicated syscalls for the deprecated BeOS fs_attr API. Before,
each attribute access needed 3 syscalls, now only one as it should.
* Renamed the new Haiku call fs_open_attr() to fs_fopen_attr(), and added a new
  function fs_open_attr() that takes a path (same semantics as the
  fs_[f]open_attr_dir() functions already present in BeOS).
* Merged former _kern_open_attr(), and _kern_create_attr() into one syscall.
* Cleaned up vfs.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 00:34:44 +00:00
François Revol
6f14ecb425 [GSoC] [ARM] Patch by Johannes Wischert.
Misc. Assembler functions (atomic ops, byte swapping, longjmp and libc).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31822 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-27 16:27:13 +00:00
François Revol
95337b50b0 [GSoC] [ARM] Patch by Johannes Wischert.
Include ARM in the endian test.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31815 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-27 16:08:32 +00:00
Axel Dörfler
a9b9937a3d * Fixed remove(): it should behave like rmdir() for directories.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31500 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-10 13:31:02 +00:00
Axel Dörfler
3f7eb638dc * Ah, well. Now it's really replaced.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31499 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-10 13:04:13 +00:00
Axel Dörfler
6de41102e5 * Replaced the broken BSD realpath() that is neither thread-safe nor POSIX
compliant with one that is both, and magnitudes faster at that, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31498 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-10 12:27:05 +00:00
Oliver Tappe
16d5c24e53 * merged 32bit-wchar_t branches of buildtools and haiku back into
the respective trunk

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31443 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-07 10:30:09 +00:00
Axel Dörfler
7af3465eb5 * Made set_timezone() argument const - it's not supposed to mess with it.
* Renamed time.c to time.cpp.
* set_timezone() now uses localtime_r() instead of localtime(), and will also
  no longer fail in case there was no timezone symlink before.
* Cleaned up OS.h header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31371 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-02 14:07:46 +00:00
Axel Dörfler
d1084ff757 * Renamed fs_attr.c to fs_attr.cpp and cleaned it up a bit.
* Always use _kern_create_attr() in fs_write_attr(), or otherwise it might not
  be created when it should.
* Stippi special: fixed typo "in another words" -> "in other words" ("a" is
  singular, not plural).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31312 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-29 09:56:22 +00:00
Stephan Aßmus
181593ba0b * Properly document why fs_write_attr() does what it does.
* As even the author of fs_attr.c was trying to use fs_write_attr() in an
  unsupported way in the cp copy_attributes() implementation, try to be
  more forgiving and support writing attributes at an offset. The method is
  required to behave inconsistent in that replacing bytes at offset 0 is
  not supported as replacing bytes at any other offset. Writing at offset 0
  will clobber the existing attribute to stay compatible with BeOS.

NOTE: BFS itself still does not support writing attributes at an offset which
are withing the "small data section". To work around this problem, programs
which copy attributes in a loop must make sure that their buffer is large
enough that such "small data section" attributes require only one loop
iteration.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31309 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-29 09:08:43 +00:00
Axel Dörfler
3609af391d * Renamed _kern_reserve_heap_address_range() to _kern_reserve_address_range(),
and added a _kern_unreserve_address_range() as well.
* The runtime loader now reserves the space needed for all its areas first
  to make sure there is enough space left for all areas of a single image.
* This also fixes the final part of bug #4008.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31115 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-19 11:09:21 +00:00
Axel Dörfler
82db8a9e15 * Added an "unmapAddressRange" argument to the file mapping syscall. This is
the first part of making the runtime loader behave itself; it should already
  make Clockwerk run okay with any number of translators (even if not all of
  them will work yet).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31113 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-19 08:23:11 +00:00
Axel Dörfler
160f2d1081 * Added private header defining __gUmask which is now used everywhere where
needed.
* Some cleanup in Directory.cpp, and File.cpp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31086 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-17 14:09:40 +00:00
Ingo Weinhold
58e784dfe6 Don't build compatibility.c for non-gcc2 anymore.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31043 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-14 11:10:36 +00:00
Jérôme Duval
59d67522ea added lrint and llrint functions to math.h
added generic implementations for ppc and m68k


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30945 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-02 20:24:18 +00:00
Oliver Tappe
78176019e6 * squashed a TODO in parsedate() about missing timezones - now both textual
(3-letter) and numerical timezones (e.g. -0700) are supported
This means that the workaround in mail_util.cpp of the mail kit could be
removed, but since I do not know if that should still support other versions
of BeOS, I have chosen to leave it alone.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-26 15:11:05 +00:00
Ingo Weinhold
bcfe344c53 * Made our struct stat POSIX compliant again -- the time_t fields have been
replaced by timespec fields. Via macros the structure is still source
  compatible with the old one.
* Introduced header <compat/sys/stat.h> that defines the old stat structure
  (as stat_beos) and conversion functions
* Introduced versions for [l,f]stat().
* Added symbol versions for BDirectory::GetStatFor() for sake of binary
  compatibility.
* BStatable::GetStat(): Renamed the old method, changed its parameter to
  stat_beos*, and and made it private. Added a new version (using up a
  reserved vtable slot). It remains source and binary compatible.
* BRefFilter::Filter(): Changed the struct stat* parameter to struct stat_beos*
  for sake of binary compatibility. This breaks source compatibility, though,
  which we can't help, since the class doesn't have reserved vtable slots.
* Fixed several issues with the stat structure change, mostly adjusted uses of
  BRefFilter.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30830 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-22 15:15:16 +00:00
Ingo Weinhold
544e3d2523 Commented out more unused glibc stuff. Scary...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30827 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-22 14:55:28 +00:00
Ingo Weinhold
ef3966e888 Added version scripts for the kernel, libroot, and libbe. ATM each has two
version nodes: *_BASE and *_1_ALPHA1.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30826 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-22 14:53:31 +00:00
Jonas Sundström
cb8f3e2698 More mipsel
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30621 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-03 22:41:38 +00:00
Ingo Weinhold
9073b0dccc Made _debuggerAssert()'s "message" parameter const. Fixes building with gcc4.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30502 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-30 12:21:20 +00:00
Ingo Weinhold
7be389053f Don't use exit() when compiling for the kernel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30037 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-08 16:48:32 +00:00
François Revol
80e1f0e419 Fix error reporting to conform to the POSIX ttyname_r and ttyname.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29917 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-05 07:34:37 +00:00
Philippe Houdoin
23614f0aeb Another fix after /boot/beos -> /boot/system change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29888 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-03 23:50:12 +00:00
Axel Dörfler
317bd7dda3 * Changed directory structure as suggested on the mailing list.
* Made the TimeZoneView less error prone, and also actually use Haiku code (the
  previous check didn't work since it used #if, not #ifdef).
* Also took the liberty to rename our boot loader to haiku_loader, since I had
  to update the nasm binary anyway. Updated the assembly sources to nasm 2.0.
* I haven't found where the synth location in the MIDI code is specified,
  though.
* Also, NetBootArchive, and FloppyBootImage haven't been updated yet. Will do
  so next.
* Some optional packages still put their license to beos/etc/licenses. I didn't
  update them yet, as we'll probably do so anyway at some point. Also, I think
  we might want to introduce a common/data/licenses instead for those.
* If you encounter any problems, please tell!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29876 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-03 09:02:44 +00:00
Ingo Weinhold
39d58e2f49 Experimental approach to tackle the problem with Be's negative error codes and
ported software:
* If the macro B_USE_POSITIVE_POSIX_ERRORS is defined the POSIX error code
  constants (ENOMEM, EINTR,...) will have positive values.
* Introduced the macros B_TO_{POSITIVE,NEGATIVE}_ERROR() which do convert a
  given error code to a positive/negative value.
* Added static library libposix_error_mapper.a that overrides all POSIX
  functions (save the ones I forgot to add :-)) directly meddling with error
  codes (having them as parameter or returning them) dealing with the
  positive<->negative error code conversions. The functions have hidden
  visibility, so they affect only the shared object they are linked into.
* So ideally all one has to do is to build a ported software with
  -DB_USE_POSITIVE_POSIX_ERRORS and -lposix_error_mapper and be good with
  respect to error code problems.
* Potential issues:
  - When mixing ported and Haiku native code, i.e. using Haiku native code in
    a ported software or using a ported library in a Haiku native application
    care must be taken to convert error codes where the two interface. That's
    what the B_TO_{POSITIVE,NEGATIVE}_ERROR() macros are supposed to be used
    for.
  - A ported static library can obviously not be linked directly against
    -lposix_error_mapper. The shared object linking a against the ported static
    library has to do that. The previous point applies when that causes mixing
    with Haiku native code.
  - When dependent ported libraries are used probably all of them should use
    the error mapping.

Comments welcome.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29653 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-22 15:43:03 +00:00
Ingo Weinhold
4c35c6b5e1 * _user_unblock_thread[s]() also set the user thread's wait_status, now. This
makes them more convenient to use, since the caller doesn't need to know the
  target threads' user thread structure.
* Adjusted the pthread rwlock implementation accordingly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29578 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-18 01:53:06 +00:00
Michael Lotz
3e37362327 At least if we hit the boot volume override the hardcoded check for BFS. This
makes the Desktop work when booted from an iso only CD, but I agree with the
TODO to move those into the filesystem API.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29518 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-14 15:29:49 +00:00
Ingo Weinhold
80ece78534 Added private get_image_symbol_etc() that can recursively search for a symbol
(similar to how dlsym() works).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29356 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-02-28 18:50:40 +00:00
Jérôme Duval
e06359547c activated wfileops.c instead of wfilestubs.c, commented out mmap stuff (as in fileops.c)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29153 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-02-07 20:05:39 +00:00
Jérôme Duval
d5a6891975 * Patch from Olivier Coursiere: restore sFreeHeapSize in case of resize_area failure
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29013 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-25 18:13:49 +00:00
Stefano Ceccherini
6dcca60207 fix the build. Sorry for the trouble
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-23 21:54:34 +00:00
Stefano Ceccherini
4a7ad412f6 revert r28970, since they cause crashes. Still looking into it
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28997 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-23 14:05:12 +00:00
Axel Dörfler
78e1849576 * atomic_test_and_set() did actually not test if the lock was lost, and
would therefore not always work correctly.
* Minor cleanup, added return register for completeness.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28977 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-21 11:28:50 +00:00