Commit Graph

572 Commits

Author SHA1 Message Date
Ingo Weinhold
fb913b19be Added POSIX functions posix_openpt(), grantpt(), ptsname(), and
unlockpt(), which provide a portable way of opening a pty.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25134 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-24 21:29:13 +00:00
Jérôme Duval
9091f4469b added pthread_sigmask based on sigprocmask()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25085 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-20 16:56:39 +00:00
Ingo Weinhold
f694f63e2b * Moved private passwd/group/shadow passwd limit constants from
<libroot_private.h> to <user_group.h>.
* Added support in the registrar for adding and modifying users.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25040 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-19 00:10:51 +00:00
Ingo Weinhold
25010b8723 Updated rand.c with a newer version from FreeBSD (version 1.17). This
also removes the advertising clause.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25023 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-18 14:24:10 +00:00
Ingo Weinhold
7727e08e5f Added experimental public API get_port_message_info_etc(). It is similar
to port_buffer_size_etc(), but returns the info through a structure,
which also identifies the sender (uid, gid, team ID) of the message.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25003 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-17 17:46:02 +00:00
Ingo Weinhold
a94ce1c912 * Reorganized the passwd and group support: A dedicated thread in the
registrar provides access to the DBs via a port message based
  protocol. The functions in libroot just ask the registrar now.
* Added Linuxish shadow passwd support. No putspent() though -- we'll
  provide private functions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25002 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-17 16:19:18 +00:00
Axel Dörfler
f127ebfd93 * Replaced the previous pthread_key implementation with a lockless one
that does not rely on the Be API TLS anymore, and is also more compliant
  with respect to the lifespan of the key specific values.
* It supports up to 256 different keys, which is equivalent of the solution
  that FreeBSD offers.
* The main thread now also gets a pthread_thread structure.
* Reenabled the POSIX suite test pthread_key_delete_2-1 as we now pass it.
* This also fixes bug #1642.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25000 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-17 13:44:39 +00:00
Axel Dörfler
ef4a3227fa * If there is no handler, we must not try to remove it from the linked list.
* This fixes bug #1644 again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-17 11:55:04 +00:00
Jérôme Duval
6112fe9a8d added memrchr and dirname
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24985 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-16 18:49:23 +00:00
Ingo Weinhold
b9f23a3497 Moved KMessage from libbe to libroot.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24984 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-16 17:55:55 +00:00
Ingo Weinhold
9b293bf653 mmap() was a little strict: The length parameter need not be page
aligned. It shall be rounded up by the implementation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24967 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-15 14:22:50 +00:00
Ingo Weinhold
3cf7ecd1e4 * Added <sys/mman.h> header. It declares only mmap() and munmap() yet
and defines the macros needed by them.
* Renamed syscall sys_vm_map_file() to _kern_map_file() and changed the
  path to an FD parameter. Changed vm_map_file() accordingly and
  adjusted the kernel ELF loader and the runtime loader.
* Added syscall _kern_unmap_memory().
* Added bool unmapAddressRange parameter to vm_create_anonymous_area()
  and map_backing_store(). If true and the address specification is
  B_EXACT_ADDRESS, all areas in the specified address range will be
  deleted (unless an area is covered only partially).
* Introduced B_SHARED_AREA flag, which is set on areas that have been
  created by {vm,_user}_map_file() with REGION_NO_PRIVATE_MAP. When
  fork()ing those areas won't be copied CoW, but rather be cloned. This
  is needed for mmap() MAP_SHARED.
* {vm,_user}_map_file() also accept an FD argument < 0, in which case an
  anonymous area is created.
* Implemented mmap() and munmap(). Currently there's the restriction
  that we can't partially unmap areas. Otherwise the functions should be
  rather compliant. We also support the non-POSIX extension
  MAP_ANONYMOUS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24964 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 22:52:11 +00:00
François Revol
ebf8c71d74 Fix warnings about missing protos.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24961 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 17:52:41 +00:00
Axel Dörfler
b9fe86d2d7 * Added pthread_setconcurrency(), and pthread_getconcurrency() functions.
* Since we use a 1:1 mapping, they don't do anything besides remembering the
  level set, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24855 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-07 10:57:01 +00:00
François Revol
038ed3d1f2 Add _SC_PAGE_SIZE sysconf().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24850 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-07 01:08:18 +00:00
Ingo Weinhold
6e36a49e62 * Added _kern_create_pipe() syscall, creating a pipe as an entryless
FIFO. Reimplemented pipe() to use it.
* pipefs is no longer mounted. Will remove the superfluous code soon.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24823 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-06 02:49:12 +00:00
Ingo Weinhold
7ffafac8d7 * Reorganized the FS interface a little:
- Moved most file_system_module_info hooks into separate structures.
    Those that operate on mounted volumes to fs_volume_ops, those
    operating on a vnode to fs_vnode_ops.
  - Got rid of the fs_volume, fs_cookie, fs_vnode typedefs. We use void*
    again.
  - Instead of a void* volume and node cookie hooks are passed a
    fs_volume and fs_vnode structure pointer, which contain the cookie
    and an ops pointer (fs_volume a few more things).
  - The VFS {new,publish,get,...}_vnode() functions take a fs_volume*
    instead of the volume ID. So does vfs_get_fs_node_from_path().
  - Added type and flags arguments to publish_vnode() and the
    get_vnode() hook and removed the type argument from lookup() hook.
    Added vnode::type using formerly unused bits to store the node type.
    Simplified a few things in the VFS due to the now always available
    node type.
  - Added fs_volume_ops::{create,delete}_sub_vnode() and
    fs_vnode_ops::get_super_vnode() hooks. They are used to support file
    system layers, e.g. allowing to extend an FS not supporting BeOS
    attribute with attribute support. Needs some more work in the VFS.
  - Added fs_vnode_ops::create_special_node() hook for creating special
    nodes (e.g. FIFOs).
* Adjusted the built-in file systems and BFS according to the interface
  changes. Removed all other FSs from the image for the time being.
  We'll see whether further API changes are necessary before porting
  them.
* Adjusted the bfs_shell accordingly.
* Implemented create_special_node() in rootfs to support special nodes.
* Added support for FIFOs:
  - Added syscall _kern_create_fifo() (used by mkfifo()), which creates
    a special node (type S_IFIFO) in the respective file system.
  - When a special node is published the VFS creates a respective sub
    node. Currently only FIFOs are supported.
  - Added a little support for FIFO subnodes by using functionality from
    the pipefs.
  - Added mkfifo to the image. It can create FIFOs in the rootfs, but
    the FIFOs aren't really usable ATM, since they still work like
    pipes, i.e. readers and writers need to have them open at the same
    time.
* Some smaller changes in the VFS:
  - Made the *_CALL macros nicer to use (vargs).
  - Refactored FS entry lookup into new function lookup_dir_entry().
  - create_vnode() no longer just calls the FS create() hook. First it
    looks up the entry and uses open_vnode(), if it already exists. This
    is necessary for two reasons: 1) The FS might not support create()
    while still allowing to open() entries. 2) When the FS has other
    layers on to of it (or the respective node) it might not be
    responsible for opening the node.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24816 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-05 23:05:16 +00:00
Stephan Aßmus
42014658ad Applied patch by James Woodcock:
* Implemented POSIX getpagesize() function in libroot.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24763 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-03 08:50:56 +00:00
Karsten Heimrich
e1a5b29760 * gcc4 build fix
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24756 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-02 19:17:59 +00:00
Ingo Weinhold
0931d2f309 Use the thread-safe getpwuid_r() instead of getpwuid().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24751 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-02 15:09:50 +00:00
Ingo Weinhold
f8cb30712e * Replaced the dummy implementations of the <grp.h> and <pwd.h>
functions by ones reading /etc/{group,passwd}.
* Added quasi-standard getpwent_r() and getgrent_r().
* Added _SC_GETGR_R_SIZE_MAX and _SC_GETPW_R_SIZE_MAX sysconf()
  constants.
* Moved initgroups() and getgrouplist() definition to grp.cpp. They use
  the same backend as the <grp.h> functions.
* Set the permissions of files created by the build system to what they
  should be on the image (executables: 755, others: 644). Otherwise only
  root could do anything under Haiku.
* Added build system variables HAIKU_ROOT_USER_NAME and
  HAIKU_ROOT_USER_REAL_NAME to customize name and real name of Haiku's
  root user.
* Added build system rules AddUserToHaikuImage and AddGroupToHaikuImage
  for adding additional users and groups (by default only root user and
  group and a "users" group are created).
* Adjusted BIND port and coreutils config.h files according to what
  features have become available.
* Fixed HAIKU_DOCUMENTATION_OBJECT_DIR definition. Untested, but it used
  a wrong variable name before.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24750 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-02 14:02:52 +00:00
Axel Dörfler
c41a74e8f3 pthread_detach() no longer fails, as we currently have all threads
detached. We would need to have a hash that contains the thread data to 
be able to comply with the specs AFAICT.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24718 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-01 12:17:02 +00:00
Axel Dörfler
10f0fc8f20 * Implemented sigwait().
* Not sure if it works as intended, as the specs are a bit vague.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-01 12:15:14 +00:00
Axel Dörfler
c80e610789 * Added start of an implementation of pthread_cancel().
* Implemented pthread_setcanceltype(), pthread_setcancelstate(), and
  pthread_testcancel().
* In the previous commit, I also made pthread_private.h self-contained.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24710 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-31 18:49:19 +00:00
Axel Dörfler
a635399b07 * Rearranged pthread thread support a bit: there is now a pthread_thread
structure that is attached (via TLS) to each pthread.
* Implemented support for pthread_cleanup_{push|pop}().
* I haven't really been able to test these changes, yet, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24704 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-31 15:10:00 +00:00
Ingo Weinhold
360be1fc45 * Implemented support for chroot:
- Added a "root" vnode to the io_context. It is used for resolving
    paths and converting nodes to paths instead of sRoot. Some more
    passing around of io_context structures was necessary.
  - Introduced a new lock sIOContextRootLock to protect
    io_context::root. The current uses of io_context::io_mutex
    (put_vnode(), remove_vnode() while holding it) looked too suspicious
    to use that mutex in vnode_path_to_vnode().
  - Added _kern_change_root() syscall and chroot() libroot function.
  - Added chroot coreutils program to the image. Funnily it seems to be
    much easier to set up a little jail than under Linux (just copy
    bash and libroot.so into respective subdirs; mount another pipefs
    if you want pipe support).
    With Haiku allowing direct access to directories via inode IDs
    jailing is obviously not very secure at the moment.
  - Added /var/empty to the image. It will be the chroot target for ssh.
* Changed vfs.cpp:get_cwd() so that the io_context::io_mutex is no
  longer held when calling dir_vnode_to_path().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24673 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-30 05:59:54 +00:00
Ingo Weinhold
290946ce80 * Implemented some basics for supplementary groups support:
- The kernel stores the group IDs in the team structure. They are
    correctly inherited on fork() and load_image_etc().
  - Implemented getgroups() for real, i.e. it retrieves the groups
    associated with the process.
  - Implemented setgroups(), initgroups() and (the BSDish)
    getgrouplist(). The latter two read the group information from the
    "group database" /etc/group (if existing).
  - Change the BIND port config, since we do have getgrouplist() now.
* The set-uid feature was broken when the path to the executable was
  relative, since we used stat(), which, in the kernel, uses the kernel
  IO context.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24669 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-30 00:08:13 +00:00
Ingo Weinhold
29674ea8cb Patch by Vasilis Kaoutsis:
* Check against maximum baud rate in cfset{i,o}speed().
* Changed some functions comments to doxygen style.
* Sorted speed macros in termios.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24647 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-29 12:52:10 +00:00
Ingo Weinhold
071f9c3aa2 Build configurations shouldn't be done in svn controlled files, so I
finally created a solution to avoid that: Header files that contain
configuration settings (and nothing else) go to build/config_headers.
To change settings, create a directory build/user_config_headers (which
is ignored by svn), copy the respective header there and modify it at
your leisure. Currently only tracing_config.h has been moved to the new
location, but more files will follow eventually. It is also recommended
to move optional macro definitions in Jamfile (as for BFS) to a config
header instead; the build system will then automatically rebuild on
changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24611 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-27 22:01:38 +00:00
Ingo Weinhold
6638711aa9 execvp() also needs to verify that an entry it found in the path is a
file. It would try to execute directories before (#1963).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24599 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-26 23:43:35 +00:00
Ingo Weinhold
070557e510 Fixed my previous execvp() endless loop fix, which would always cause
an infinite loop.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24569 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-25 04:10:14 +00:00
Ingo Weinhold
0343e0753a execvp() was looping endlessly if PATH contained empty entries.
Reorganized the loop so that this won't happen anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24568 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-25 03:46:08 +00:00
Ingo Weinhold
83c2cae69d Implemented execvp() for real.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24560 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-24 20:32:20 +00:00
Axel Dörfler
5e2ef462ec * Got rid of the duality of FS_WRITE_STAT_* vs. B_STAT_* flags (removed
the former ones).
* Removed extraneous white space.
* net_server settings are now also updated when the size of the 
  file changed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24552 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-24 12:04:47 +00:00
Ingo Weinhold
2754fa8772 bcopy() is supposed to be overlap-save.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24525 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-22 18:13:42 +00:00
Ingo Weinhold
5bf0362724 Added TODO.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24492 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-20 13:33:35 +00:00
Ingo Weinhold
8560d1885b * The runtime_loader's test_executable() no longer analyzes the
executable permissions of the file by hand. We use _kern_access()
  instead, which also handles the root case correctly.
* The user and group arguments of test_executable() aren't needed any
  longer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24483 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-20 01:45:00 +00:00
Axel Dörfler
c2383f9c82 * Replaced our string compare functions (and memcmp()) with versions
that actually work correctly (and treat the data as unsigned 
  characters).
* This fixes bug #724.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24458 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-19 08:45:08 +00:00
Ingo Weinhold
62319d069e Commented out real-time signal related stuff (SA_SIGINFO, waitid()) to
prevent "configure" scripts from thinking we do actually support it.
Having real-time signals would be nice though (cf. #1935).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24444 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-18 17:33:03 +00:00
Ingo Weinhold
1b32947d3f * Aligned the semantics of the read_symlink() FS module hook with the
readlink() function. It is no longer required to null-terminate the
  string, shall not fail, if the buffer is too small, and shall return
  the length of the string actually written into the buffer.
* Adjusted rootfs, devfs, and bfs accordingly. Also adjusted their
  read_stat() hooks to return the correct symlink length in st_size.
* Our readlink() does now comply to the standard (and BeOS).
  Additionally if the buffer is big enough it is nice to non-conforming
  apps and null-terminates it.
* BSymLink::ReadLink() explicitly null-terminates the string now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24425 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-17 21:37:40 +00:00
François Revol
e0b47058e2 Missing include... at least for gcc4.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24365 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-11 21:53:40 +00:00
Ingo Weinhold
7cee6a817b We only support real time timers. Pretending to support virtual timers
only gets the caller into trouble, since then another signal should be
sent.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24363 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-11 21:27:00 +00:00
Ingo Weinhold
4eb3560949 * Added real, effective and saved set- user and group IDs to the team
structure. They are properly inherited and updated on
  fork(), load_image(), and exec().
* Implemented the get[e]{u,g}id(), set[[r]e]{u,g}id() family for real.
* getgroups() also calls the kernel now, but only returns the effective
  group ID. Supplementary groups support is still missing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24359 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-11 17:12:02 +00:00
Ingo Weinhold
4b7baaba0f Added optional kernel tracing for the userland memory allocator.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24356 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-11 01:35:30 +00:00
Ingo Weinhold
32da50fafb Allow setting the local to "C" (i.e. not changing it at all). This makes
programs happy, that do that unconditionally (e.g. some Perl test).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24334 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-09 17:47:52 +00:00
Axel Dörfler
d401b8f030 * _rtDebugFlag is supposed to default to true (is usually only used when
DEBUG is defined, anyway). This fixes bug #1892.
* _debugPrintf() and _sPrintf() are supposed to be silent when _rtDebugFlag
  is false.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24243 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-05 19:41:05 +00:00
François Revol
84b29b5f5f Copied [efg]cvt() and *cvt_r() from glibc 2.3.2, this gets cdrecord running.
Btw, why do we have _G_config.h in 2 places ?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24192 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-01 21:24:48 +00:00
Axel Dörfler
681835d2df * Given its limitations, I should probably not leave it turned on.
* Also, a wall size of 64 byte is a bit large for every day use, too :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24163 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-28 00:29:14 +00:00
Axel Dörfler
79e518749d * Implemented a very simple wall checker for the hoard allocator to
track down bug #1862.
* It's not complete for now, as it does not support memalign() or
  posix_memalign() yet - handle with care, or feel free to complete :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24162 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-28 00:27:30 +00:00
Axel Dörfler
d863e59794 * Fixed a warning when compiled with HEAP_DEBUG turned on.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24161 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-28 00:25:16 +00:00
Stefano Ceccherini
4454eadeb4 first steps towards enabling support for wide chars in our libroot: reverted mbrtowc.c to glibc 2.2.5, added necessary iconv support to let it compile, added dl*** wrappers for needed glibc functions. Not sure it's the correct path, but let's try, at least.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24150 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-27 15:53:54 +00:00
Ingo Weinhold
7539ff87da As already commented in #1824 this is incorrect.
Running scripts with load_image() works again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24133 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-26 01:44:06 +00:00
Jérôme Duval
30cce27770 Patch from kaliber: use path of executable instead of the command. Thanks!
this fixes bug #1773 and #1824. I tested only #1773.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24131 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-26 00:03:51 +00:00
Ingo Weinhold
b097a59b43 * setpgid() is not supposed to return the group ID. It shall return 0 on
success.
* setpgrp() is not supposed to fail (could happen, if the calling
  process was a session leader).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24040 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-21 00:18:35 +00:00
Ingo Weinhold
392ad2822d axeld + bonefish:
BeOS R5's glue code incorrectly calls _thread_do_exit_notification()
when main() returns, while Haiku does that in exit(). Therefore when
terminating this way the exit hooks were called twice for executables
built under BeOS R5. This caused e.g. NetPositive or the R5 svn to
crash on exit (our network code actually uses those hooks).
Fixes bug #1742.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-17 14:12:02 +00:00
Ingo Weinhold
01335789e4 axeld + bonefish:
Removed the "config" subdirectory in the /boot/common directory
structure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23973 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-17 13:57:36 +00:00
Axel Dörfler
392eb518d5 * Added gcvt() implementation - this fixes bug #1757.
* Added gcvt(), ecvt(), and fcvt() prototypes to stdlib.h - they are all
  marked legacy, but are still part of the POSIX standard, so we might want
  to implement them if the need arises.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23896 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-06 17:11:02 +00:00
Axel Dörfler
a32a4683ff * Implemented flock() semantics to the advisory locking backend. Not tested
(must also compare to BSD; I've looked at their sources, but I might have
  missed something).
* Added sys/file.h and the flock() system call.
* common_fcntl() could forget to put back the file descriptor on some error
  conditions (I guess we should introduce and use a DescriptorGetter class).
* Cleaned up fcntl.h, moved the BSD extensions S_IREAD and S_IWRITE to
  sys/stat.h where they belong, and added the missing S_IEXEC to them.
* Added some more comments.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-03 15:37:31 +00:00
Axel Dörfler
e5bc2a9e7a Added BSD extension vsyslog() - is also found on Linux.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23835 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-03 15:31:16 +00:00
Ingo Weinhold
a54c125e37 Added experimental ktrace_[v]printf() functions to libroot. Their output
is recorded in a kernel trace entry (if tracing is enabled).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23686 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 15:10:05 +00:00
François Revol
d8fe1829e2 Add *rint*() from glibc 2.3.5.
This make app_server link \o/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23651 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 20:06:08 +00:00
Jérôme Duval
6b46058e04 needed for long double support
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23650 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 19:34:03 +00:00
Jérôme Duval
9ce320179c __m68k_get_time_base instead of __m68k_time_base
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23649 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 19:27:35 +00:00
Jérôme Duval
850456ed43 added missing m68k bits for math functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23648 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 19:26:58 +00:00
François Revol
d296c4e1f9 Fixed swapping functions.
BFS now validates the superblock and the boot menu now lists the image if I force checking for kernel_x86. \o/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23626 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 02:11:46 +00:00
François Revol
82062f804c Works much better when actually allocating the TLS entry...
Now the backend works, Login can list users.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23509 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-14 02:03:34 +00:00
Michael Lotz
3be509a228 Fix the static cleanup mechanism introduced to the runtime_loader/libroot:
* Fixed wrong start and size used in the runtime_loader
* Fixed off by one error in the matching loop of the cleanup hook
* Make sure we successfully acquire the locking sem of the exit stack

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23493 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-13 18:49:27 +00:00
Michael Lotz
8c2a9d7433 bonefish+mmlr:
As (our) gcc unfortunately uses atexit() to clean up lazily initialized static
variables inside functions we have to ensure that we do the right thing with
unloadable shared objects. In case a shared object was unloaded that installed
an atexit() hook the application would crash on exit. We now implement a
callback into libroot that is used to call all the atexit() hooks of a
component that is to be unloaded. Most prominently this fixes the media_server
crash at shutdown.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23486 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-13 12:08:34 +00:00
Jérôme Duval
15ee8ca67b system() should continue to wait when wait_for_thread returns B_INTERRUPTED
fixes bug #1707


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23439 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-12 15:51:02 +00:00
Axel Dörfler
748988ae1f mkdir() is supposed to respect the umask when creating the directory.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23438 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-12 13:17:59 +00:00
François Revol
c6b3f26049 cuserid also goes there...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23396 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 13:52:48 +00:00
François Revol
38196dea30 Move getlogin*() to its own file and fix the build.
This way it doesn't get linked to the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23395 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 13:47:45 +00:00
François Revol
cf9e598dd0 Fix the build for you mortal monousers.
Actually getlogin didn't belong to usergroup.c in the first place anyway.
And definitely not to the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23391 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 13:05:06 +00:00
François Revol
ffb64301bf Old code I wrote that implements multiuser the same way R5 did as a hidden feature...
Worked quite well in latest zeta, so it's already tested :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23385 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 11:14:02 +00:00
Ingo Weinhold
34b3b26b3b Merged branch haiku/branches/developer/bonefish/optimization revision
23139 into trunk, with roughly the following changes (for details svn
log the branch):
* The int 99 syscall handler is now fully in assembly.
* Added a sysenter/sysexit handler and use it on Pentiums that support
  it (via commpage).
* Got rid of i386_handle_trap(). A bit of functionality was moved into
  the assembly handler which now uses a jump table to call C functions
  handling the respective interrupt.
* Some optimizations to get user debugger support code out of the
  interrupt handling path.
* Introduced a thread::flags fields which allows to skip handling of
  rare events (signals, user debug enabling/disabling) on the
  common interrupt handling path.
* Got rid of the explicit iframe stack. The iframes can still be
  retrieved by iterating through the stack frames.
* Made the commpage an architecture independent feature. It's used for
  the real time data stuff (instead of creating a separate area).
* The x86 CPU modules can now provide processor optimized versions for
  common functions (currently memcpy() only). They are used in the
  kernel and are provided to the userland via commpage entries.
* Introduced build system feature allowing easy use of C structure
  member offsets in assembly code.

Changes after merging:
* Fixed merge conflict in src/system/kernel/arch/x86/arch_debug.cpp
  (caused by refactoring and introduction of "call" debugger command).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23370 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 00:36:44 +00:00
Axel Dörfler
5f23ba4ac9 If either the path or the resolved path is NULL, realpath() now returns
EINVAL. This also fixes bug #1659.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23087 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-08 21:45:40 +00:00
Jérôme Duval
d2d6724788 added pthread_once() implementation and tests
there is still a TODO on an init race condition 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23076 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-07 21:02:59 +00:00
Ingo Weinhold
c63bdde05e Correctly return errors.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23004 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-27 15:27:52 +00:00
Stefano Ceccherini
5945644720 Implemented _debuggerAssert().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22966 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-20 16:15:27 +00:00
Ingo Weinhold
f969977bc1 Patch by Vasilis Kaoutsis (modified by myself): Implemented sigset().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22947 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-18 16:39:18 +00:00
François Revol
05c6416eba Add macros for syscalls with 11 to 13 args.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22933 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-15 22:59:35 +00:00
Ryan Leavengood
0e230349da I needed nextafterf support in WebKit, so I added it here. It was already
defined in the headers. If this is not the correct way to do this, let me
know, but it seems to work (well it compiled at least.)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-11 03:23:17 +00:00
Ingo Weinhold
99ed286c94 Patch by Vasilis Kaoutsis: Implemented sigrelse().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22865 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-09 23:23:46 +00:00
Ingo Weinhold
0a1968cf8f Patch by Vasilis Kaoutsis: Implemented sighold().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22846 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-06 22:11:43 +00:00
Ingo Weinhold
a56a0c276a Patch by Vasilis Kaoutsis: Removed redundant parameter check (sigaction()
does it anyway).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22830 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-04 17:48:49 +00:00
Jérôme Duval
f87a6142a4 SYSCALL20 is needed on x64-64
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22808 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-02 19:18:01 +00:00
Jérôme Duval
7d2666b85a added a few more syscalls arguments for _kern_create_child_partition()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22793 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 19:36:34 +00:00
Ingo Weinhold
c727d6fd76 Patch by Vasilis Kaoutsis: Style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22790 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 18:05:22 +00:00
Ingo Weinhold
74fa73bac6 Patch by Vasilis Kaoutsis: Implemented sigignore(). Small changes by myself.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22789 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 18:03:36 +00:00
François Revol
1b6ddd3492 Optimized 64bit atomics:
- use movem
- fix return value: the convention is to return in d0:d1 (MSB:LSB)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 03:43:08 +00:00
François Revol
b82ae48b36 Note on use of TAS,CAS and CAS2 on Amiga.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22743 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-26 22:27:31 +00:00
François Revol
fac9743e5c s/ppc/m68k/
Lure the preprocessor to not replace #n by "123" for syscalls...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22739 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-26 17:09:08 +00:00
François Revol
dd68e9e8b4 More of the libc...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22738 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-26 17:07:23 +00:00
Ingo Weinhold
77c02b906b Patch by Vasilis Kaoutsis: Check for a valid signal number before
doing something. If the signal is not valid, set errno and return -1.
Mini style changes by myself.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22728 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-25 22:01:16 +00:00
François Revol
2bbf13b7a5 Add syscalls.
Fix CAS2 usage, only supports (An) addressing mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22727 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-25 18:45:34 +00:00
Axel Dörfler
fcfbb8aa6c libprefs.so uses the private _klock_node_() syscall, and even loops until it
returns success - since this stub always returned failure, this prevented all
apps using that library (like Gobe Productive) from running.
It now calls the Haiku equivalent _kern_lock_node(), and Gobe now runs fine!
This closes bug #562.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22724 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-25 17:04:10 +00:00
François Revol
00c8f3104c Add a warning about CAS2: 060 doesn't have it, we'll loose 64bit atomics :^)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22704 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-25 00:39:27 +00:00
François Revol
cc9ad8e824 Start of math support from glibc.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22701 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-24 22:54:33 +00:00
Ingo Weinhold
6bd2f399e8 Patch by Vasilis Kaoutsis: Implemented killpg().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-24 13:49:42 +00:00
François Revol
51238e6bd3 Missing Jamfile.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22693 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-23 23:38:34 +00:00
Ingo Weinhold
56a63c3b2a Patch by Vasilis Kaoutsis: Style and copyright header cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22671 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-22 23:51:46 +00:00
François Revol
cb44673606 Naive swap_float/double. Not sure sizeof(double) is 8 on m68k...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22664 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-22 15:50:27 +00:00
François Revol
1609107a45 - some swap asm.
- 64bit atomic ops.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22657 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-22 00:48:01 +00:00
François Revol
188b43270e m68k arch files for libroot.
Mostly ppc from r22648. Some atomic_* done.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22654 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-22 00:10:36 +00:00
Ingo Weinhold
cb93a65449 Patch by Vasilis Kaoutsis: Added and implemented lockf() using fcntl() locking.
Small change and notes on standard compliance by myself.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22628 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-20 19:51:49 +00:00
Axel Dörfler
c3d49e1317 * Fixed warning.
* Use strlcpy() to copy the confstr instead of strncpy().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22565 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 11:57:28 +00:00
Ingo Weinhold
e701d86af5 Patch by Vasilis Kaoutsis: Style cleanup, "OpenBeOS license" -> "MIT license".
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22537 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-13 17:18:34 +00:00
Jérôme Duval
87e239b9dc added some tsearch and iconv functions,
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22533 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-13 15:34:19 +00:00
Ingo Weinhold
e8cae7424e Patch by Vasilis Kaoutsis: Correctly set errno on error.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22519 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-12 16:49:56 +00:00
Ingo Weinhold
36b89f8f12 Patch by Vasilis Kaoutsis: Style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22518 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-12 16:49:19 +00:00
Ingo Weinhold
d9769e2219 Patch by Vasilis Kaoutsis: select() and pselect() set errno correctly now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22499 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-10 14:13:34 +00:00
Axel Dörfler
6030b585aa * Implemented gethostname() and sethostname().
* uname() now calls gethostname() instead of using a hard-coded value.
* This fixes bug #1250.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22492 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-09 01:36:18 +00:00
Ingo Weinhold
b510c4d236 Reverted r22484. setitimer() already sets errno, if necessary.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22487 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-08 19:58:54 +00:00
Ingo Weinhold
a16571b404 Patch by Vasilis Kaoutsis: Return error code via errno.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22484 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-08 15:32:02 +00:00
Ingo Weinhold
ede3fe6c94 POSIX functions return their error codes via errno and so does lseek().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22479 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-07 22:43:41 +00:00
Ingo Weinhold
636bfc08ae * Renamed fs/vfs_select.cpp to wait_for_objects.cpp and got rid of
vfs_select.h, respectively moved most of it into the new kernel
  private header wait_for_objects.h.
* Added new experimental API functions wait_for_objects[_etc](). They
  work pretty much like poll(), but also for semaphores, ports, and
  threads.
* Removed the "ref" parameter from notify_select_events() and the
  select_sync_pool functions as well as from fd_ops::fd_[de]select(). It
  is no longer needed. The FS interface select() hook still has it,
  though -- the VFS will always pass 0.
* de]select_fd() take a select_info* instead of a select_sync* + ref
  pair, now. Added respective functions for semaphores, ports, and
  threads.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 19:47:31 +00:00
Jérôme Duval
e4bbf18b3f added an implementation for nanosleep() based on snooze()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22311 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-25 19:18:27 +00:00
Axel Dörfler
22c5a76dee setlocale(, "") now no longer returns an error, but returns "C" now; we don't
(yet) support any locale anyway, so evaluating LC_ALL and friends doesn't make
much sense at this point.
This fixes bug #1499.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22297 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-24 22:26:03 +00:00
Axel Dörfler
a4e527db79 * Fixed build for GCC 2.95.3 - it does not support newer C syntax.
* Minor cleanup (there shall be 2 lines of space between functions).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22281 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-23 17:21:41 +00:00
Ryan Leavengood
10508d2e99 Implemented Ingo's suggestions to avoid the situation that condition variables
don't block when they should because the semaphore sometimes gets released too
much. One day I'll try to add some tests, though this seems like something you
can't exactly unit test.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22279 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-23 02:48:30 +00:00
Ryan Leavengood
550a30a0b7 I needed Pthread condition variables for WebKit, so I implemented
them. I have tested this with a simple test program I downloaded
from the internet. We get the same result as on Linux, so I think
this is good. I will test it more with WebKit later.

Our Pthreads implementation is still missing some stuff, but this
adds a good chunk.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22274 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-22 16:30:22 +00:00
Ingo Weinhold
a7ba350ff2 Missed this one: Completed waitpid().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22089 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-28 03:31:30 +00:00
Axel Dörfler
a728651f04 Some more work on the signal code:
* get_signal_stack() checked the wrong sig_action field (index is signal-1), also,
  it had an off-by-one error in the stack range check.
* factored out a restart_syscall() function to avoid code duplication
* arch_setup_signal_frame() relied on the fact that vregs and the signal stack code
  is a multiple of 4 bytes in size.
* Fixed sigaction(): it did return the error code directly instead of setting errno.
* signal() actually had a work-around for the broken sigaction()...
* Replaced the sig_func_t typedef with a sighandler_t typedef - this is non-standard
  anyway, but now we're at least compatible with the GNU world instead of introducing
  our own solution (BSD seems to use sig_t here, BTW).
* Removed now unused sigval structure from the header; it should be added again as
  soon as we start supporting it.
* SA_RESETHAND and SA_ONESHOT are the same thing; the former did not work before.
* Made the non-standard SA_* flags refer to the standard ones instead of the other
  way around.
* Added a test application for various signal features - works fine under Haiku,
  tested also under Linux and BeOS (the latter fails as it does not support SA_RESTART).
  More tests should be added, though.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-17 11:01:09 +00:00
Axel Dörfler
0b70ea5992 * Implemented sigaltstack() and set_signal_stack(), thus closing bug #1401.
* On exec() the new function thread_reset_for_exec() is called which clears the signals
  and cancels an eventually set alarm. Both things weren't done before...
* Some minor cleanups.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21989 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-16 18:01:47 +00:00
Axel Dörfler
491e46858b Shouldn't code before breakfast:
* check against sizeof(void*)-1 instead of hardcoded 3.
* return B_NO_MEMORY instead of NULL if the allocation failed...
Thanks to Marcus and Ingo for proofreading :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21976 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-16 10:49:19 +00:00
Axel Dörfler
dfd5242e7f Even though Korli beat me, I've updated the posix_memalign() function to be more standards
compliant:
* it now checks the alignment is a multiple of 4 (needs to be changed for 64 bit architectures)
* it no longer sets errno.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-16 10:04:44 +00:00
Jérôme Duval
bf7beb500c added posix_memalign()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-16 09:19:56 +00:00
Michael Lotz
ed8dc403a9 * Changed realloc() again to leave the old block intact (obviously...)
* Check for failed allocations and set errno correspondingly in malloc(), calloc(), memalign() and realloc()

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21911 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-12 16:23:55 +00:00
Michael Lotz
e72c1f9cb1 Avoid a crash in realloc() if the allocation of the new block failed. Return NULL instead.
Someone please review. Should errno be set to ENOMEM here?

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21903 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-12 10:51:56 +00:00
Ingo Weinhold
1873b4b37e Give the runtime loader a chance to reinit its semaphore after fork().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21886 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-11 00:14:26 +00:00
Jérôme Duval
e00976b95c now behaves like the BeOS version
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21840 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-06 18:03:52 +00:00
Michael Pfeiffer
1384a3a81f Make C compiler happy.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21826 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-04 17:09:46 +00:00
Michael Pfeiffer
fc069a2ace * Updated copyright header.
* Initial implementation of suggest_thread_priority. It behaves like version from BeOS R5. 
* TODO take arguments 'period', 'jitter', and 'length' into account as well . 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21825 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-04 16:35:19 +00:00
Stephan Aßmus
c68e76bc26 * if there is any app actually using suggest_thread_priority() it won't
no longer use idle priority, even if an actual implementation is still
  missing


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-04 11:19:56 +00:00
Jérôme Duval
84324de507 added an empty implementation of confstr()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21810 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-03 18:13:55 +00:00
Axel Dörfler
74c0424a43 * Added a mechanism to retrieve a BMessage with eventual error descriptions
for _kern_load_image().
* Added KMessage to the runtime_loader (a bit hacky, though) - it will use
  it to deliver the above mentioned functionality.
* load_dependencies() did return the wrong status code in case a library
  was missing; now it returns B_MISSING_LIBRARY.
* load_dependencies() will now try to load all dependencies when a report
  message is requested; therefore, all missing libraries are listed.
* Renamed uspace_program_args to user_space_program_args.
* The kernel filled in various members of the user_space_program_args structure
  unsafely, ie. was not using user_memcpy().
* Renamed some local variables in team.c to better fit our style guide (ie.
  uargs to userArgs).
* Changed Tracker to use the new _kern_load_image() variant on Haiku to retrieve
  and report all missing libraries. This fixes bug #1324.
* Adapted kernel_cpp.cpp to the runtime loader as well; the latter will now
  compile with _LOADER_MODE defined.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21715 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-07-27 02:32:19 +00:00
Marcus Overhagen
85b3a71e69 Check the pos parameter before calling into kernel.
This does prevent the unwanted side effect of reading or writing at the current 
file pointer position when the functions are called with a -1 position.
It's save to do this check in user space, because calling the _kern_* function
with -1 pos has the same effect as calling the normal read/write posix functions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21701 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-07-25 22:10:56 +00:00
Axel Dörfler
80b2c30e4f LOG_CONS is now also honoured when sending the message to the syslog daemon failed
(and not just because it doesn't run).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21547 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-07-04 14:06:20 +00:00
Jérôme Duval
583b66bf18 added trunc, truncf (and truncl on x86) from glibc
should help on bug #1260


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21350 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-06-08 18:33:02 +00:00
Axel Dörfler
88c66c0dfb * I broke create_path() with r21194; unlike strncpy(), strlcpy() needs enough space for
the terminating null byte as well. This fixes bug #1239.
* Using strlcpy() makes clearing the path buffer superfluous.
* Some more cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21239 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-25 11:06:25 +00:00
Axel Dörfler
261fd618fe * Now uses find_directory() when used inside the kernel.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21203 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-22 13:06:51 +00:00
Axel Dörfler
7be2dafba9 fs_write_attr() is supposed to remove an existing attribute value.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21202 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-22 09:24:19 +00:00
Axel Dörfler
6430c89618 * Added find_directory() to the kernel - it currently may not work as good as the
userland version, tbough.
* Small style cleanup in find_directory.c.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21194 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-21 22:28:02 +00:00
Travis Geiselbrecht
621b401de4 set the function attribute on the asm memcpy.
This should fix the loader problem some folks were seeing on beos binaries.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20732 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-17 04:19:45 +00:00
Travis Geiselbrecht
831486a2d3 Turn the assembly optimized memcpy (simple rep movsd) back on for x86. Had to hack around the make system a bit, and the result is pretty nasty, specifically due to the amount of places in the system where various targets poke their fingers into the libroot directory.
The solution is less than optimal, but should work for now.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20722 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-16 06:17:14 +00:00
Travis Geiselbrecht
806f6f1161 fix a bug in _exit() that called the _IO_cleanup routine as if it was
a function pointer, which it isn't.
The mistake was probably made because there appears to be multiple stdio implementations
in the tree (BSD and glibc) so it's easy to look at the wrong code. Perhaps
we should clean that up.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20720 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-16 03:20:42 +00:00
Jérôme Duval
9e7de14057 added the usual weak symbols to fix bug #1134
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20566 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 20:56:57 +00:00
Ingo Weinhold
3f86eca54a Removed glibc's dprintf() from libroot.so. It clashes with the dprintf()
defined by the UserlandFS server and is of no real use anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20457 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-28 22:15:11 +00:00
Ingo Weinhold
44b5d72b5a Added new functions to the debugger API:
{set,clear}_debugger_{break,watch}point(), allowing to set/clear break
and watchpoints for the calling team. When a break/watchpoint is hit,
the team enters the debugger. Handy in situations when the program in
question can't really be started in a debugger (or it would be
complicated to do so). The functions work only as long as no debugger is
installed for the team.

We clear the arch specific team and thread debug infos now, when a new
debugger is installed, thus clearing break- and watchpoints.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20396 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-20 16:20:13 +00:00
Jérôme Duval
d4d9831990 merge both commpage.h into the private header
Travis, I hope this fits your needs :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20173 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-20 00:21:45 +00:00
François Revol
c8d3c6f470 Implemented get/setrlimit(RLIMIT_NOVMON). Note the kernel calls don't set errno... but they're called by user versions. Might want to split them if needed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20165 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-19 15:48:02 +00:00
Travis Geiselbrecht
1cbf8f4b3c initial support for a commpage, which is a chunk of memory in high kernel space with user readonly permissions.
The first use is to let the kernel decide what the preferred syscall mechanism is at boot time and copy the
appropriate user space code there. Can be used for routines the kernel can decide best how to use (memcpy, some
timing routines, etc).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20161 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-19 00:32:44 +00:00
Ingo Weinhold
8d96648eab Fixed build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20134 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-15 18:59:45 +00:00
François Revol
158a9c384b Much simpler and safer ttyname() using B_GET_PATH_FOR_DEVICE. Also added ttyname_r for which we had a proto in the headers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20133 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-15 14:01:40 +00:00
Ingo Weinhold
2cddddacba Made _gHaikuRevision static and renamed it to sHaikuRevision.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20093 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-07 13:01:28 +00:00
Ingo Weinhold
a4e0c1d43d * We do now have a special "_haiku_revision" section in our libroot,
containing the Haiku SVN revision number which is used by uname(). The
  value is 0 when built, but updated by the build system before copying
  libroot to the image (new rule CopySetHaikuRevision).
* For AboutHaiku we no longer write the SVN revision number into a
  resource. Instead we use the uname() info.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20082 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-06 16:51:29 +00:00
Travis Geiselbrecht
ea4ff0f689 is_computer_on() lives again as a true syscall.
Replaced the _kern_null syscall with _kern_is_computer_on.
is_computer_on_fire is a bit harder, since it returns a float from kernelland, which
at the moment isn't supported in haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20069 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-04 21:08:35 +00:00
Jérôme Duval
bf63295e0b reverted changes from revision 7340, it seems to not be useful anymore.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20063 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-04 11:48:08 +00:00
Axel Dörfler
a83c8bbffa Moved libroot/posix/kerrno.c to kernel/lib/ where it belongs, and renamed it to kernel_errno.c.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20044 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-02 10:53:57 +00:00
Philippe Houdoin
7029621374 Added forgotten space between kernel build date and time.
Also prepare uname to return the build SVN revision number,
which will work only if I could figure out how to define it from Jamfile.
Or, better, in build/jam/BuildSetup. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20023 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-30 22:30:01 +00:00
Axel Dörfler
923ce6f922 * waitpid() now only clobbers _status in case it succeeded.
* improved comments and TODOs.
* added note about unimplemented WUNTRACED, and WCONTINUED options


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-29 15:45:34 +00:00
Axel Dörfler
1beeb96080 setpgrp() returns a pid_t, not an int.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20008 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-29 13:31:24 +00:00
Axel Dörfler
a9d09fc255 Added _kstatfs_() for binary compatibility with some BeOS apps (most notably, SoftwareValet).
We might want to remove it again once we have a replacement for it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-23 21:01:18 +00:00
Jérôme Duval
9481ed48de updated to tzcode2007a
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19755 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-09 23:16:26 +00:00
Axel Dörfler
6b507ddd46 Made set[e]gid() and set[e]uid() succeed in case they don't have anything to do.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19553 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-18 18:00:21 +00:00
Jérôme Duval
e20b9d2cf1 added missing asin asinf functions for ppc
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19500 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-13 21:06:18 +00:00
Axel Dörfler
a7854360ac Added vfork() as a wrapper to fork().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19491 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-13 14:50:14 +00:00
Axel Dörfler
489caaef82 setitimer() allows the second argument to be NULL.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19411 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-01 13:08:24 +00:00
Axel Dörfler
7f4e6824df Added a private call to get the dependencies of a loaded image. This will be used
to determine linkage of libnet.so vs. libsocket.so/libbind.so in the libnetwork.so.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19008 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-06 11:40:20 +00:00
Jérôme Duval
d75882bf8b finally add a good tmpfile function
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-19 14:31:40 +00:00
Jérôme Duval
13510b4105 added oldtmpfile.c to libroot.so, hopefully should fix bug #857
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18889 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-09-19 13:41:01 +00:00
Axel Dörfler
48096634af Enabled private BeOS syscalls for the build with GCC 4 as well for now, until
this issue has been solved in the code that needs them (which is the same as
the PPC version also does at this time).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18570 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-22 20:48:12 +00:00
Jérôme Duval
5ed5c96602 updated these files to glibc 2.3.5
hopefully it should fix bug #754


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18549 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-21 15:05:59 +00:00
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
Axel Dörfler
22b4c9cace Added missing [l]lrint[f|l]() functions.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16570 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-02 17:55:26 +00:00
Jérôme Duval
5a2ad00cab fix a TODO in _user_mount : added an argsLength parameter
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16480 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-20 18:04:27 +00:00
Jérôme Duval
ba41c65055 added more math functions (complex ones)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16394 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-14 14:57:33 +00:00
Jérôme Duval
5acbf1f50e added more math functions (complex ones)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16392 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-14 13:34:43 +00:00
Jérôme Duval
162972f5f2 added missing wrappers from glibc 2.3.6
hopefully fix bug #157


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16391 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-14 13:06:48 +00:00
Jérôme Duval
c4d9fc29b5 fix bug #151
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16371 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-12 23:19:12 +00:00
Axel Dörfler
df213cedbc * CPUs can now be disabled - that is, they will keep idling.
* Added syscalls _kern_set_cpu_enabled() and _kern_cpu_enabled().
* scheduler.c::sRunQueue::tail was not maintained at all; changed sRunQueue to
  be a simple thread pointer instead of a struct thread_queue.
* Turns out we're monitoring CPU activity incorrectly when we've got more
  than one CPU.
* Renamed the global CPU array from "cpu" to gCPU.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16186 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-01 16:09:05 +00:00
Axel Dörfler
204131dc97 Added a real yield function to the kernel (using the next_priority approach).
The test application lets run a thread at the highest priority that calls
yield all the time - the system stays responsible when it runs, so it seems
to work fine :)
Changed the malloc implementation to use _kern_thread_yield() instead of
snoozing.
We should think about making this call public, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16166 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-31 02:29:02 +00:00
Axel Dörfler
7e46f8319e snooze(5) works more or less fine for standard threads, but is a very bad
idea for real-time threads. They could completely hog the CPU in this
case. Thanks to Marcus for investigating!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16161 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-31 00:11:51 +00:00
Axel Dörfler
979aeaf71c Fixed bug #97:
* BEntry::Remove() now uses _kern_remove_dir() for directories.
* Added fd parameter to _kern_remove_dir().
* Fixed LibBeAdapter's _kern_unlink() to only work on files, and
  added _kern_remove_dir() for directories.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16078 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-25 11:12:21 +00:00
Axel Dörfler
f7ba8efac9 Fixed GCC4 warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15867 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-08 13:09:31 +00:00
Ingo Weinhold
15af38b288 Removed pointless comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-08 04:54:47 +00:00
Ingo Weinhold
262e0a636b We use the same strategy for computing the system time as on x86 now.
The time base conversion factor is the 32 bit value
  2^32 * 1000000 / time base frequency,
so the system time can be computed by
  system time = time base * conversion factor / 2^32.
The expression in system_time() looks more complicated now, but is
actually much faster (factor 2.5 on my Mac mini). I'm positively
surprised, how good the assembly looks, that GCC 4 generates. There's
not that much potential for optimization by hand-coding the function.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15863 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-07 23:05:56 +00:00
Ingo Weinhold
b264ddab5d Corrected copyright. :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15858 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-07 20:27:13 +00:00
Stephan Aßmus
34a9556215 Made our glue code compatible to BeOS again. IOW executables compiled for Haiku will
now run under BeOS as well (as long as they don't use any functions that are not
available under R5).
The solution is a bit messy, but we have to live with it :-)
The runtime loader now patches the __gRuntimeLoader symbol in libroot.so to point
to its exported structure instead of passing it to the init functions as an
argument.
(Hax0red by axeld and bonefish on stippi's assimilated machine -- resistence is futile)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15848 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-06 03:48:11 +00:00
Jérôme Duval
8f9f676b46 we don't use atomic_get64 to read a read-only area, not authorized and throw a VM fault
this fix #83 partially


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15845 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-05 15:09:50 +00:00
Ingo Weinhold
e55e1a0e66 Implemented the PPC specific RTC support. We search for an "rtc"
device in the Open Firmware implementation of boot loader and
pass its path to the kernel, where it's opened and used for
getting/setting the real time. The expensive atomic_*64() on PPC
32-bit make things a bit more complicated. Moreover, missing
64 bit multiplication and division instructions won't really
allow system_time() to be anywhere near as fast as on x86. :-/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15837 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-04 04:55:04 +00:00
Ingo Weinhold
09bb4e9ac5 The real_time_data structure contains an architecture specific
substructure now (that's the only member actually). The system time
offset is therefore accessed via architecture specific accessor
functions.
Note, that this commit breaks the PPC build. Since I want to rename at
least one file I've already changed, I can't avoid that.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15835 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-04 02:17:59 +00:00
Ingo Weinhold
481b133143 Added missing wrappers for hypot() and hypotf(), fixing bug #75.
I wouldn't be surprised, if more wrappers are still missing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15709 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-29 02:01:55 +00:00
Axel Dörfler
78f2557c8f Found and fixed number one app_server crashing bug: our Hoard backend didn't
support unsbrk(), and that is actually called quite often in Hoard, resulting
in out of memory quite fast.
We don't shrink the heap (yet), but at least we can reuse the memory that
was freed by Hoard (it doesn't just remove bytes from the end, it will also
free up smaller parts in the middle).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15655 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-22 11:42:02 +00:00
Ingo Weinhold
6e040d83ea Added __swap_{float,double} for PPC. They are probably horribly
suboptimal (if working at all) -- review is appreciated.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15486 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-11 13:26:50 +00:00
Ingo Weinhold
d85fe0ec25 Compatibility functions. Actually not needed for PPC Haiku, but it's
easier to define them for now, since they are used unconditionally e.g.
in the Tracker sources.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15485 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-11 13:25:00 +00:00
Ingo Weinhold
fe14a904a8 * Implemented [sig]{set,long}jmp() for PPC. No idea, if it is any good,
but it compiles at least. :-)
* Pulled the architecture specific part out of <posix/setjmp.h> into
  <posix/arch/<arch>/arch_setjmp.h>.
* Moved setjmp_save_sigs.c from the x86 specific implementation into a
  "generic" sibling directory, since it is reusable (and actually used
  by the PPC implementation).
* Added generic/longjmp_return.c containing a function __longjmp_return,
  which is invoked at the end of siglongjmp(), resetting the signal mask
  and validating the return value. It is used by the PPC implementation,
  and should also be used by the x86 implementation, but I'll leave that
  to someone who's motivated enough to also test it. :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15479 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-10 22:56:52 +00:00
Ingo Weinhold
901f399036 * Removed libroot/posix/math completely and added the respective
functions from glibc 2.3.2. Adding those one by one is extremely
  boring and time-consuming work. We should probably just remove the
  math stuff again, add a verbatim copy of the glibc directories, and
  shuffle things around afterwards.
* Note that for x86 holds sizeof(long double) == 96. I removed the
  generic 128 bit long double functions that were in use before and
  added respective 96 bit versions to arch/x86 (or left them out, if
  they weren't used). For PPC the System V ABI spec supplement specifies
  sizeof(long double) == 128, but I had trouble configuring gcc to
  actually use that setting (looks like there simply is no support for
  TI mode for PPC 32). So we have to live with sizeof(long double) ==
  sizeof(double) == 64 for the time being.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15477 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-10 20:39:04 +00:00
Axel Dörfler
4f9b08dffa Obviously, atan.c is needed after all. This should fix the build again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15456 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 20:48:44 +00:00
Ingo Weinhold
e695fe845d Removed atan.c. For PPC we're using the glibc implementation, for
x86 the Haiku image still builds, so it is apparently not used. I
guess it would be best to abandon our posix_math.o completely and
use the glibc math implementations instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15446 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 14:23:30 +00:00
Ingo Weinhold
379f146735 Added more missing math functions for PPC from glibc 2.3.2.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15445 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 14:16:39 +00:00
Ingo Weinhold
7c360a1007 Removed the x86 specific __compare_and_swap() implementation and
added a generic implementation using atomic_test_and_set().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15444 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 14:11:44 +00:00
Ingo Weinhold
0799002097 Added an unimplemented __arch_init_time() for PPC.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15443 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-09 14:09:42 +00:00
Ingo Weinhold
8e17108ffa Add some more PPC math functions from glibc 2.3.2.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15406 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-08 00:27:03 +00:00
Ingo Weinhold
c1437015dd Moved architecture independent sources into new subdirectory "generic".
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15405 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-07 23:14:51 +00:00
Ingo Weinhold
c729b01278 The <arch_config.h> header is needed in <syscalls.h>, since we're using
the atomic functions related macros.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15404 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-07 23:11:02 +00:00
Ingo Weinhold
e616992242 Fixed compilation with our PPC compiler.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15403 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-07 22:42:57 +00:00
Ingo Weinhold
8b150d6067 Added PPC specific and some generic glibc headers. Taken from
glibc 2.3.2, which seems to be the version used in other places,
though I also found older files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15402 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-07 22:41:39 +00:00
Ingo Weinhold
2034e20826 Added building of an empty posix_arch_ppc.o to make the build
system happy for the time being. We need real setjmp()/longjmp()
implementations for PPC eventually, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15401 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-07 22:37:25 +00:00
Ingo Weinhold
353d20c0c5 * libroot and the runtime loader are no longer built with kernel rules.
* New rule Ld, analogously to KernelLd.
* Added StaticLibrary parameter for supplying additional objects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15191 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-27 13:31:50 +00:00
Ingo Weinhold
38f6264454 Reorganized building of kernel, boot loader, and libroot.
Each component is built in the respective subdirectory now
and no longer in src/system/Jamfile.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15184 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-27 00:27:19 +00:00
Axel Dörfler
bf9979bdaa This should fix the build of libroot.so, patch by Korli.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15067 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-22 14:16:20 +00:00
Jérôme Duval
ef0635bd49 added some more glibc functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15064 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-21 21:41:39 +00:00
Jérôme Duval
5412911f7f added some x86 glibc functions (more to come)
we might miss some wrappers for some ieee754 functions (to check)
hope nothing is broken


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14968 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-16 18:33:51 +00:00
Axel Dörfler
589f2f5a7f Made it a bit clearer how settings parsing works in the kernel, so that Ingo
hopefully doesn't see the need to "fix" it anymore :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14961 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-16 17:06:44 +00:00
Axel Dörfler
10fbb5f7fd The driver settings in the boot loader overwrote the settings for later kernel use;
they could not be parsed again by the kernel, and thus, safemode was not working
anymore (as it was queried by the SMP stuff).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14960 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-16 17:01:45 +00:00
Ingo Weinhold
9818fa6bc3 add_variable() just threw away the freshly copied environment (makes me
wonder why things worked nevertheless with the old gcc). We now also use
realloc() instead of malloc()+memcpy(), and check add_variable()'s
return code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14957 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-16 15:12:19 +00:00
Ingo Weinhold
c5f20ef053 Added finitef() implementation. Won't work yet, since __fpclassifyf() is
not implemented.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14911 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-14 12:28:21 +00:00
Ingo Weinhold
ef9b2fc28b Added temporary implementation of strxfrm().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14909 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-14 12:07:29 +00:00
Axel Dörfler
0c0bf02aac setjmp() is now an assembly stub that doesn't create a stack frame but just
jump to sigsetjmp(). I'm a bit irritated that the previous version didn't
run as expected, but it now does.
This needs some more investigation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14901 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-13 17:46:40 +00:00
Axel Dörfler
4e766dd482 * header cleanup, but there is still a lot more to do...
* added round(), roundf(), and roundl() implementations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14891 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-13 13:22:47 +00:00
Axel Dörfler
6065411b88 ualarm()'s arguments are actually useconds_t, too.
Fixed implementation of ualarm() to support larger values.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-13 13:20:25 +00:00
Ingo Weinhold
758b1d0e05 Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
  declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
  explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
  something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
  'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
  is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
  Otherwise the an inner class with that name is considered as friend.
  gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-12 23:27:14 +00:00
Ingo Weinhold
ca9e5772c3 * Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
  "haiku") -- added one more level of indirection to achieve that.
  (TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
  (auto-included when compiling something that uses the Be API for platform
  "host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
  which can be included when compiling something that can be built for both,
  Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
  under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
  to a BeOS compatible host platform target, with the exception, that instead
  of the host platform's libbe.so a special build of Haiku's libbe.so
  (libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
  Haiku's public app, interface, storage, and support kit headers are used
  when compiling. This replaces the less nice way in which the test app server
  and applications for this test environment were built.
  When building for platform "libbe_test", the library name "be" is
  autotranslated to "libbe_haiku.so". Thus most applications don't need
  special fiddling when them building them for the app server test environment;
  usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
  (e.g. source files not including the needed headers directly).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 16:07:25 +00:00
Axel Dörfler
6efb3f085f Added statvfs.h header and implemented statvfs() and fstatvfs() - both untested, though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14746 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 13:47:55 +00:00
Axel Dörfler
c713cfe2bb Fixed __strerror_r() - this closes bug #66.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14723 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-06 23:36:59 +00:00
Jérôme Duval
3ef41e42cd added fgetpos fsetpos
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14716 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-05 17:58:15 +00:00
Jérôme Duval
d05775b3bd added seteuid and setegid
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14701 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 16:38:40 +00:00
Ingo Weinhold
571bb2b2a6 Simplified the x86 syscall interface a bit. We no longer pass a pointer
to the parameters nor the number of parameters; the kernel is able to
get both without problems.

The syscall functions in libroot (_kern_*()) are now self-contained
(they don't "jmp" to separate code anymore), which at least
theoretically allows gdb to print a stack trace with the syscall
function on the top when a thread is currently performing a syscall.
Practically it doesn't work yet, though, since those functions are
frameless (i.e. create no stack frame) which needs special support
I haven't implemented yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14661 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-03 14:36:46 +00:00
Jérôme Duval
687193750c added drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48,
seed48, and lcong48 functions
fixed bug #63


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14645 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-02 14:29:50 +00:00
Axel Dörfler
0e1358bd5c Applied a patch from Alexander Deynichenko: added missing signal definitions.
That also includes some XSI signals, SIGPOLL and SIGVTALRM, dunno if we will every support
those in a useful way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-31 12:39:29 +00:00
Axel Dörfler
4d9b4412bd Added memccpy() - not there in BeOS, but part of the POSIX specs.
Contributed by Alexander Deynichenko.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-31 12:18:55 +00:00
Ingo Weinhold
338b8dc301 Merged changes from branch build_system_redesign at revision 14573.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-29 16:27:43 +00:00
Jérôme Duval
0c7b6e66e8 added ctype.c, from glibc version 2.2.5
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14548 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-27 22:34:12 +00:00
Axel Dörfler
f3bb653937 Simplified sigsuspend() a bit.
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14460 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-20 18:38:30 +00:00
Axel Dörfler
da6d1a7022 fs_mount_volume() now returns a dev_t as well - changed mount/mountvolume to take
that into account as well (they were reporting an error even though everything
went fine).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14450 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-20 13:03:50 +00:00
Jérôme Duval
a26988784a added _fseek for R5 compatibility
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14365 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-12 15:52:35 +00:00
Jérôme Duval
42848b0907 added index and rindex to libroot.so
R5 ftp and telnet commands now run on Haiku


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14362 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-12 13:05:03 +00:00
Axel Dörfler
eddf43dd76 Added missing clock() function.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14329 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-06 17:33:10 +00:00
Jérôme Duval
ab38c90461 added a libroot sigpending, kernel support isn't implemented
(fixed partly bug #49)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14181 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-13 16:12:20 +00:00
Jérôme Duval
04b831a692 added pause() (kernel support is lacking though)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14130 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-08 13:06:49 +00:00
Jérôme Duval
96e6579454 added a libroot sigsuspend, kernel support isn't implemented
(fixed partly bug #48)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14129 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-08 12:26:16 +00:00
Jérôme Duval
e96ac99568 improves style
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-05 18:01:48 +00:00
Jérôme Duval
e5ee1dad6a added sigaddset, sigismember, sigdelset to libroot.so from inline versions in signal.h
moved static inline to extern inline to allow this change
please someone review this (ie are they platform dependent functions ?)
should fix bug #47


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14103 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-02 11:53:43 +00:00
Axel Dörfler
61a1551551 Added empty function stubs for __fpclassify[fl](); they currently pretend that every number
is a normal one - maybe someone finds the time to implement them for real before I do :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14046 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-22 01:34:32 +00:00
Marcus Overhagen
cc33b4a1ca This adds the required functions to libroot.so and fixes DEBUG build.
Unfortunately, they are pretty broken, so I added them into floatmath.c


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14019 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-21 01:30:46 +00:00
Marcus Overhagen
794df3bf25 This removes the inline assembly code for find_thread
from OS.h, sorry for triggering a complete rebuild.
To avoid doing a syscall for find_thread(0), the assembly
version is now in libroot. For BeOS R5 compatibility, 
_kfind_thread_ is retained. This will fix some compile 
problems, and provides a cleaner OS.h for future Haiku
versions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14014 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-20 23:57:11 +00:00
Jérôme Duval
16c05905ae forgot this one
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13992 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-19 15:24:08 +00:00
Jérôme Duval
19664a737a added UFC crypt library (LGPL)
provides crypt() to libroot, untested


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13991 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-19 15:17:43 +00:00
Axel Dörfler
13d77a4cde Now fills in the machine field with something more appropriate (currently mimics
BeOS behaviour). Maybe we want to have some different values here later on.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-09 22:58:58 +00:00
Jérôme Duval
b1c123994c Updated to tzcode2005j.tar.gz
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13561 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-08 23:49:29 +00:00