Commit Graph

149 Commits

Author SHA1 Message Date
Axel Dörfler
26a9fcd6ab * set_alarm() now correctly returns the time left for the currently active
alarm, or 0 if there isn't any.
* setitimer() now also sets the previous timer values correctly, so that
  alarm() and ualarm() now return the correct values as well - this fixes
  the test fork_9-1 failing at alarm().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18545 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-20 22:44:53 +00:00
Stefano Ceccherini
152808170e Reverted the previous change
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18536 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-18 10:18:10 +00:00
Stefano Ceccherini
08c1246909 In case of error, errno should be set to a positive value. Yeah, I know,
it's sick.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18534 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-18 09:40:12 +00:00
Axel Dörfler
d024bdc9e6 kill() is supposed to return ESRCH instead of B_BAD_THREAD_ID.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18527 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-17 19:59:44 +00:00
Axel Dörfler
0240ccffa0 Don't use <new.h> - there is <new> for you.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18492 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-11 20:08:51 +00:00
Axel Dörfler
36788b7119 * Added strptime() to the build again,
* also defined STD_INSPIRED again, which lets localtime.c add some non-POSIX
  behaviour for now (needed by strptime()) - we should find a better solution
  to this, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18435 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-07 16:45:33 +00:00
Axel Dörfler
21470984c8 Added utimes() implementation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18330 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-01 11:02:32 +00:00
Axel Dörfler
05c0dde554 Uh, the reason why ping did only work once, was because set_alarm() did not call
the existing syscall...
The second ping now ends in a kernel panic, though 8-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18277 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-07-26 13:19:52 +00:00
Bruno G. Albuquerque
bcf475ec65 Made our version of is_computer_on_fire() behave like the BeOS one.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18259 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-07-25 00:26:03 +00:00
Axel Dörfler
89ae57ba77 Removed sysctl(), there is no need for this BSD-ish call.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17954 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-29 09:37:06 +00:00
Jérôme Duval
577bebe552 pthread_exit has to be called on thread exit, it doesn't return, thus we don't care about the routine return code
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17906 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-22 10:00:17 +00:00
Jérôme Duval
954f408f50 * PTHREAD_MUTEX_INITIALIZER inits to NULL, pthread_mutex_lock now call pthread_mutex_init to support this PTHREAD_MUTEX_INITIALIZER
* pthread_key_create and pthread_key_delete now manages correctly a list of key/destructor
* pthread_create now uses a private thread function to add a "on_exit_thread" call for destructors
* pthread_join now returns B_OK in every case, and, as a joinable thread could already be gone, wait_for_thread would not find it


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17895 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-21 14:07:34 +00:00
Axel Dörfler
7b3d36e5aa * BEntry::GetStat() and BNode::GetStat() used sizeof(struct stat) for the kernel
syscall, but they could not know if R5 code called them (in which case the stat
  size has a different size). We now always only return the R5 stat structure here.
  This fixes bug #420. We might want to find a different solution to this problem,
  though.
* Be got SYMLINK_MAX wrong - it's not the maximum number of links (that's SYMLOOP_MAX),
  but the maximum size of a symlink buffer. Added missing SYMLOOP_MAX and SYMLINK_MAX
  constants to limits.h.
* Fixes MAXSYMLINKS to use SYMLOOP_MAX, instead of SYMLINKS_MAX (which doesn't exist
  in POSIX specs, but we (intentionally) break source compatibility here).
* Reenabled the Haiku versions of stat(), fstat(), and lstat() when build for Haiku.
* Removed OpenBeOS namespace stuff from the files I touched.
* Removed superfluous StorageDefs.Private.h, whyever that ended up in a public header
  is beyond me.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17894 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-21 13:49:16 +00:00
Jérôme Duval
c345b8eb08 fix error return codes for posix compatibility
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17885 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-20 22:14:54 +00:00
Jérôme Duval
1f11178f97 added posix thread specific data functions
added a pthread_detach skeleton


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17880 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-20 12:27:46 +00:00
Jérôme Duval
a23efdfa79 added some pthread_* and pthread_attr_* naive functions
I mapped pthread_t to thread_id for simplicity


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17879 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-20 11:05:58 +00:00
Axel Dörfler
9f53e3dccf Fixed build for non-Haiku targets.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17858 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-16 14:32:05 +00:00
Axel Dörfler
2da9a41214 When calling debugger(), it will now (temporarily) dump a message to serial output
as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17760 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-07 15:11:39 +00:00
Axel Dörfler
0cd4c8ae6c Enabled sbrk() again, but only for actual increments.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-25 20:05:28 +00:00
Axel Dörfler
506c8fbbbf Disabled sbrk() since it doesn't seem to work yet (makes GDB crash).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-25 18:17:55 +00:00
François Revol
c2be814ab5 added an Haiku-specific RLIMIT (NumOpenVnodeMONitors) (UNIMPLEMENTED yet) (we might want to renumber it),
and used that one and NOFILE to implement R5 private calls _kset_[fd|mon]_limit_()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17545 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-22 19:37:40 +00:00
François Revol
3ad603ace4 implement sbrk() by calling hoard's version, through sbrk_hook (fct pointer was named this way in R5).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17540 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-22 18:04:20 +00:00
Axel Dörfler
8abee6571a libroot.so now builds on PPC again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17514 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-19 13:11:34 +00:00
Axel Dörfler
e2793c5db4 Fixed warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17512 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-19 13:05:56 +00:00
Axel Dörfler
d7b5138a70 Some more GCC 4.1.0 fixes, more to come (tomorrow).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17501 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-17 21:40:29 +00:00
Jérôme Duval
2a562c4223 raise now calls kill to have errno set correctly
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17493 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-17 15:46:47 +00:00
Jérôme Duval
a2762cadac hopefully handles bug #587
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17476 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-16 12:11:26 +00:00
Jérôme Duval
ad34885a2b actually set timezone in the kernel, and in the settings
should help on bug #583, and even fix it
minor change in localtime


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17441 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-13 15:52:32 +00:00
Jérôme Duval
c0acc2a55e fixed typo
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17403 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-09 19:56:29 +00:00
Axel Dörfler
d13fd67ac0 Imported lround() and lroundf() from glibc.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-09 18:12:35 +00:00
Marcus Overhagen
bba1e5c831 Added media kit error descriptions.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17369 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-08 18:35:08 +00:00
Axel Dörfler
2bbc6df8dc * The kernel now remembers the signal that killed a thread (if it was killed).
* As suggested by Korli, the signal is now encoded in the "reason" field of
  wait_for_child().
* waitpid() now sets the status passed in so that the signal can be read out
  (but it still doesn't do it's full job).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17338 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-05 15:33:34 +00:00
Jérôme Duval
ac3b691a1d enabled legacy re_comp re_exec
this fixes bug 563


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17337 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-05 14:28:46 +00:00
Jérôme Duval
b7b5cda158 updated gamma and gammaf
copied y0 y1 yn BeOS behaviour (even if the spec accepts both)
added ilogb ilogbf significand significandf (x86 and generic)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17248 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-27 19:04:30 +00:00
Axel Dörfler
d59df8688e fclose() should now accept a NULL parameter (doesn't clobber errno, though, as, at
least in theory, that should still contain the error from an earlier operation).
This might fix bug #500.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17228 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-24 23:18:14 +00:00
Jérôme Duval
966bf92369 removed excess NULL element
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17183 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-21 09:45:35 +00:00
Axel Dörfler
b2debb3777 Activated sigprocmask() (and really call the kernel syscall instead of itself...).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17176 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-20 12:24:39 +00:00
Axel Dörfler
1b2d6b4f2c initstate() and setstate() were disabled for some reason - they no longer are.
This fixes bug #289.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17025 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-06 07:06:04 +00:00
Axel Dörfler
805cb76ed8 * Added several R4.5 compatibility exports - they are now only compiled when GCC
2.95 is used.
* Added empty _klock_node_() syscall for compatibility - all R5 syscalls are now
  also only compiled with GCC 2.95.
* This should fix bug #403.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-05 10:48:47 +00:00
Axel Dörfler
99d94ad2e0 Added fegetround() and fesetround(), disabled special SSE support for the latter, though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16835 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-18 20:32:17 +00:00
Axel Dörfler
66b7a0f477 Renamed the _kern_init_heap_address_range() syscall to _kern_reserve_heap_address_range()
and made it more powerful.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16825 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-18 12:52:01 +00:00
Axel Dörfler
70e8c1e7e2 Kernel still needs this.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-16 20:29:24 +00:00
Jérôme Duval
3b74cca68e replaced strlen with glibc optimized version i586 and powerpc32
if build fails, simply delete the object file posix_build.o manually


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16819 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-16 16:37:05 +00:00
Jérôme Duval
cc87b419b8 added posix_gnu_string
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16814 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-16 11:10:20 +00:00
Jérôme Duval
a34963f388 added posix_gnu_string
added more posix definitions


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16813 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-16 11:09:43 +00:00
Axel Dörfler
579c74ceb5 * Implemented a simple version of the private function mstats() (BeIDE needs it).
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16800 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-14 23:15:57 +00:00
Axel Dörfler
821d63fe0a * gettimeofday() now also fills in a passed in struct timezone, if any,
using the new _kern_get_timezone() syscall.
* Added an implementation of ftime() based on the above function, this
  may fix bug #308.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16786 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-14 14:36:46 +00:00
Axel Dörfler
3a8f1f31bd Implemented a very simplistic and slow leak checker as compile time option
(defaults to turned off).
To make any use of this, you have to call the __dump_allocated() function
at the point you want to check the leaks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16765 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-13 16:10:32 +00:00
Jérôme Duval
f357360c0e added more multibyte glibc functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16728 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-12 11:49:00 +00:00
Axel Dörfler
5370f52b15 setlocale() now returns "C" in case the locale is set to NULL.
This allows current VLC to run without the need of exporting one of the
LC_ALL/LC_CTYPE/LANG environment variables (it used to crash without this).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16571 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-02 18:34:13 +00:00