Commit Graph

390 Commits

Author SHA1 Message Date
Axel Dörfler b2ec044cb8 * Added stat::st_blocks field as required by POSIX. This also closes ticket
#2261.
* Made at least BFS report it more or less correctly (the attributes are
  ignored, though).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27791 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-30 14:16:39 +00:00
Stephan Aßmus dc55af6452 Applied patch by Urias McCullough:
* Added stdio_ext.h header with declaration for the only currently implemented
  stdio extensions fsetlocking() and flushlbf() and associated constants. This
  helps compiling some software like gettext and cvs.

NOTE: I have not tested this myself, but trust the review done by Andreas
and Scott.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27789 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-30 10:04:22 +00:00
Jérôme Duval 53e8a878e6 isnan and isfinite are macros
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27424 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 22:45:17 +00:00
Jérôme Duval 645fa87a21 added lsearch and lfind
remove unknown infnanf and strtcopy functions


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27423 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 22:27:55 +00:00
Salvatore Benedetto f22e1421a4 * Adding sys/msg.h header and relative syscalls
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 14:52:35 +00:00
Jérôme Duval ab2b993da9 added nexttoward()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27349 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-06 15:00:33 +00:00
Jérôme Duval bb97148298 added more posix functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27348 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-06 14:31:28 +00:00
Jérôme Duval 2eb280d3a8 added a few more math functions, rearranged some functions in math.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-05 23:21:33 +00:00
Jérôme Duval 9c91170f95 added fpclassifyl
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27272 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 19:37:23 +00:00
Salvatore Benedetto 29fd670a1b * Updated license
* Removed extraneous tabs
* Implemented lldiv (#2688)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27250 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 10:40:58 +00:00
Marcus Overhagen 1d19f96fff Removed my Copyright notice, assign future copyright to Haiku Inc, in contribution to ticket #2191
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27068 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-19 19:28:41 +00:00
Axel Dörfler 6dc27eba0c * As requested by POSIX, we now have PTHREAD_STACK_MIN, and PTHREAD_KEYS_MAX
defined in limits.h.
* This closes ticket #2559.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26982 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-15 15:00:26 +00:00
Salvatore Benedetto 461106374f * Fix year in license
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26922 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 17:02:34 +00:00
Salvatore Benedetto 4093d16d51 * updating license
* use _{BEGIN|END}_DECL macro instead of ifdef C++



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26921 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 16:29:51 +00:00
Ingo Weinhold a9d7be0708 * Implemented mprotect(). A vm_area does now have an optional array
specifying the protection of each page (4 bits per page).
* Added no-op implementation of posix_madvise().
* Replaced a few "addr_t size" parameters by "size_t size".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26871 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 01:00:06 +00:00
Salvatore Benedetto b3ae704659 * fix year in copyright
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26856 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-07 10:59:35 +00:00
Salvatore Benedetto 40353b088c * Updating license
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26855 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-07 08:14:09 +00:00
Axel Dörfler f8009f7ba4 * Applied patch by kaliber: those headers weren't self-containing.
* This closes bug #2346.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26841 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 10:01:53 +00:00
Axel Dörfler 8169e6b4e6 * Patch by Andreas that adds sched.h, and sched_yield() to Haiku.
* This closes ticket #2568.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-05 17:54:14 +00:00
Axel Dörfler 6449b66e22 * As pointed out by Andreas, the previous patch wasn't really correct; ALLPERMS
should really contain all permission bits.
* It now uses S_ISVTX instead of S_ISTXT - this is how it works in Linux as
  well, while FreeBSD uses S_ISTXT there (but S_ISTXT and S_ISVTX have the
  same value there, too).
* Also fixed the fs_shell this time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26761 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 16:30:30 +00:00
Axel Dörfler 826df7bec8 * Patch by Andreas Färber: remove undefined S_ISTXT from ALLPERMS.
* This fixes bug #2560.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26754 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 12:51:40 +00:00
Axel Dörfler cc6c784ae7 * Sean C. Farley made me aware that some of the possible solutions to clear
the environment would crash on Haiku. Added a small test application that
  just checks every one of those.
* Fixed env locking (in userland, you better check against B_INTERRUPTED).
* Made our code safe against an environ of NULL.
* There is now an additional sManagedEnviron that points to the environment
  our code actually managed; whenever an application overrides environ, we'll
  get aware of it with the next *env() function invocation, and will handle
  it adequately.
* Added non-POSIX clearenv() function.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 15:02:03 +00:00
Axel Dörfler 47ca7595ca First patch by Salvatore to implement XSI semaphores with a few changes
by myself:
* renamed xsi_do_undo() to xsi_sem_undo() (there is more to XSI than sems).
* Fixed coding style issues in sys/sem.h and xsi_sem.cpp.
* Added _kern_*() syscall prototypes to syscalls.h.
* Added a TODO in xsi_sem.cpp and xsi_semaphore.h about moving union semun to
  a shared header.
* Made the team::xsi_sem_undo_requests int32 - due to padding, it would have
  needed 4 bytes anyway; please always use specific types over int/short/long.
* xsi_sem_undo() now checks if it needs to do anything - the calls in team.cpp
  no longer needs to do this.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26676 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-29 12:03:41 +00:00
Axel Dörfler eaf71fbdb6 * Build fix: coreutils had a replacement for dirfd().
* Made DIR argument const in dirfd().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26469 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-17 01:22:13 +00:00
Michael Lotz d73327e274 Make dirfd() publically available. It used on other systems as well it seems.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26466 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-17 01:01:52 +00:00
Oliver Ruiz Dorantes 0501b7cd80 Add AF_BLUETOOTH sockets family
- Feel free to change the index
 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26445 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-16 17:30:36 +00:00
Axel Dörfler 9c5c79ad86 * Made DIR definition private, and moved it into the new dirent_private.h
header.
* Added fields necessary to make it possible to retrieve more than one
  dirent from the underlying file system.
* Unless some app creates a DIR on its own to it to feed readdir(), this
  change should be binary compatible. If we find an application misbehaving,
  we can still make it a GCC4 only thing.
* fs_attr/fs_index/fs_query now all use readdir() directly (as that one
  contains the logic to iterate through a number of dirents in userspace).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-09 11:16:00 +00:00
Jérôme Duval 765ae3a785 Applied patch from Mika Lindqvist: This patch implements both strlwr() and strupr() functions in libroot and includes strupr() in kernel build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26226 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-02 19:30:46 +00:00
François Revol 63dff3f9a3 Placeholder for ARM.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26133 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-25 22:57:34 +00:00
Salvatore Benedetto 93dd5d6569 * Fix typo. Thanks mjw!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26132 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-25 19:29:03 +00:00
Ingo Weinhold a2cf1d70ef Removed <syscalls.h>' dependency to <semaphore.h> by giving the sem_t
structure a name.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26015 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-19 00:05:01 +00:00
Axel Dörfler 3b2c863f1c The "search.h" header had a couple of issues:
* It was not self containing, as it used size_t without defining it.
* It was not C++ safe.
* It used the restrict keyword that is not recognized in GCC2. This fixes bug
  #2262.
* It did not contain parameter names as demanded by our coding style.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25818 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-06 07:42:58 +00:00
Ingo Weinhold d46a010c43 Patch by Vasilis Kaoutsis: Added sigpause().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25682 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-28 15:28:49 +00:00
Axel Dörfler 187c576425 * Added sys/ipc.h header. As the functionality has not yet been implemented,
I added an #error directive, so configure scripts shouldn't be fooled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25663 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 16:55:57 +00:00
Axel Dörfler a411c76cd6 * Added pthread_attr_setscope(), and pthread_attr_getscope(). We only support
PTHREAD_SCOPE_SYSTEM which makes the implementation rather simple.
* This closed ticket #2242.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25628 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 11:24:40 +00:00
François Revol 74be35c78b Some more funny sysconf()...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25627 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 01:38:05 +00:00
François Revol 4b9329efe1 Define PAGE_SIZE and PAGESIZE in limits.h. It should really depend on B_PAGE_SIZE, but I'm not sure we can #include anything in there...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25626 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 01:01:57 +00:00
François Revol 3a17a548da - factored out [f]pathconf().
- *pathconf() now uses statvfs and fs_info data when appropriate. It should also check for file type though, some only apply to directory or others.
- added confstr(_CS_PATH) with a sensible default.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25625 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 00:33:08 +00:00
François Revol ca974ded95 Some more [f]pathconf() names, not yet handled. filesizebits returns 64 though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 23:22:26 +00:00
Ingo Weinhold 0f448d21e5 * Added vm_page_write_modified_page_range(), which is similar to
vm_page_write_modified_pages(), save that it only writes pages in the
  given range.
* Added vm_page_schedule_write_page_range() which schedules all modified
  pages in the given cache's range for writing by the page writer.
* Added _kern_sync_memory() syscall and the msync() POSIX function.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25620 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 21:51:12 +00:00
Ingo Weinhold f3917584f1 Added missing INET_ADDRSTRLEN.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25598 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-21 22:37:42 +00:00
Ingo Weinhold 43a4a6bacb Forgot closing parenthesis.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-21 21:08:47 +00:00
Ingo Weinhold 3021393e36 Let's pretend we support POSIX threads.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25588 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-21 00:03:09 +00:00
Ingo Weinhold 9ac19900c4 Added LOG_UPTO() macro. Not part of POSIX, but widely used anyway.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25587 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-21 00:02:26 +00:00
Ingo Weinhold a8af2b6dda Some work on pthreads:
* Made the pthread_cond_t internals public. This is necessary to support
  process shared condition variables. Fixed initializer macro.
* Made the pthread_rwlockattr_t structure opaque.
* pthread_t is no longer typedef'ed to int. It's the pointer to the
  internal _pthread_thread structure.
* Removed __get_pthread(). pthread_self() can be used instead.
* No longer tunnel the pthread exit value through Haiku's thread exit
  value. We do have a separate field in the _pthread_thread structure
  for it, now.
* Handle detaching of threads correctly.
* pthread_rwlockattr_{g,s}etpshared() use the
  PTHREAD_PROCESS_{SHARED,PRIVATE} constants, now.
* Commented out yet unsupported structures (barriers, spinlocks).
* Rebuilt APR optional package. The pthread changes weren't binary
  compatible.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25582 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-20 20:43:28 +00:00
Ingo Weinhold 89d327d66e Added missing spwd::sp_lstchg field.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25560 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-19 02:16:12 +00:00
Ingo Weinhold 6e19c86ab0 Fixed potential warnings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25487 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-14 12:52:34 +00:00
Ingo Weinhold 3ca1072d44 * Reimplemented pthread_once. The old one was neither thread-safe nor
particularly efficient.
* pthread_mutex implementation:
  - Removed the pthread_mutex_t indirection (the type was a pointer to
    the actual structure which was allocated on the heap), as it made
    sharing the mutex between processes impossible.
  - Removed the distinction between process shared and non-shared
    mutexes. Benaphores work just as well in shared memory, so we always
    use them.
* Fixed some static initializer macros. PTHREAD_COND_INITIALIZER is
  still broken, since it doesn't work in C code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25481 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-13 01:50:54 +00:00
Ingo Weinhold 370602bff6 Added pthread rwlock support.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25470 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-12 13:56:11 +00:00
Ingo Weinhold b932012815 Patch by Andreas Faerber:
Replaced single-line comments by multi-line comments for ANSI C
compliance.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25433 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 21:30:34 +00:00