Commit Graph

474 Commits

Author SHA1 Message Date
Ingo Weinhold 64ccb6b58a Synced the different definitions of BUFSIZ with the internal one. What a mess...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31776 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-26 15:28:33 +00:00
François Revol 9463ff4cb7 [GSoC] [ARM] Patch by Johannes Wischert.
Add ARM defines.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31693 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-22 17:19:02 +00:00
Axel Dörfler 0ca5323479 * Changed the enum into defines, so that apps can check whether or not they
exist (as mDNSResponder does, for example).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31588 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-15 15:28:49 +00:00
Oliver Tappe f612278f55 * switched back libiconv to a static library and remove all references to
it (headers and library) from the image. The libiconv in our tree is 
  only used internally as a backend for libtextencoding. The real libiconv
  is provided as an optional package.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31452 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-08 01:00:22 +00:00
Axel Dörfler 7f5bbbdc56 * Removed PI, and PI2 from math.h.
* Replaced all occurences with the standard macros M_PI, and M_PI_2.
* Some coding style cleanup on the touched files, no other changes besides
  adding a missing check for a failed memory allocation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31250 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-26 11:58:43 +00:00
Oliver Tappe 510c100a8f * synced wchar.h with POSIX and the implementations provided by our libroot
* added WCHAR_MIN and WCHAR_MAX - already as 32-bit values, since that's
  what wchar_t is going to become, soon (and those values could not have
  been used before, since they were missing)
* this is still work-in-progress though, I need to run more tests to find
  out which of these functions are actually working, too


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31182 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-22 19:48:36 +00:00
Jérôme Duval 59d67522ea added lrint and llrint functions to math.h
added generic implementations for ppc and m68k


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30945 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-02 20:24:18 +00:00
Jérôme Duval 7abb735ac6 * Includes termios.h in sys/ioctl.h, for TIOCGWINSZ.
* added watch command, which executes a program periodically, showing output full screen. 
* added watch to the image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30900 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-28 20:16:35 +00:00
Oliver Tappe a8149000f0 * removed three locale-related headers which currently just pretend that
haiku would support any of the declared functions (none of which are
  provided by libroot)
  These will come back once the locale kit has been integrated
  

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30883 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-27 20:46:49 +00:00
Oliver Tappe 440447ec2f closing #3481:
* applied a patch suggested by kaliber that seems to fix the issue for good,
  thanks!


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


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30830 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-22 15:15:16 +00:00
Jonas Sundström b7b7891476 Adding mipsel arch.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30587 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-02 19:05:28 +00:00
Jonas Sundström 41a9e149b7 Adding a few directories for mipsel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30581 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-02 18:30:28 +00:00
Oliver Tappe 723383c0f4 Applied patch by PulkoMandy, adjusted and extended by myself:
* integrating most of the locale kit into the build (and image)
* removed LocaleBuild.h and _IMPEXP_LOCALE since that does not make
  sense for elf (which usually exports all symbols anyway)
* added a couple of locale kit related pseudo targets for convenience
Hey, some of that stuff already seems to work :-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30545 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-01 21:56:16 +00:00
Oliver Tappe c3ac87e8fc * Copied imported OpenTracker Locale Kit files from the vendor branch
into their new homes (at least for now, might need some adjustment).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30540 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-01 19:23:59 +00:00
Axel Dörfler a87124634a * Our INADDR_* and IN_CLASS* macros were mostly wrong - they are supposed to
be in host endian order.
* Adapted ipv4 code that automatically finds a netmask to this change.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30299 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-21 19:21:52 +00:00
Stephan Aßmus a6f9e71c98 This should fix ticket #3481 again. It keeps the same semantics as before when
the header is used for compiling with -std=c99 or -std=gnu99 and GCC4, which
has a reverted meaning of "extern inline" (now standard compliant).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29558 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-16 09:40:33 +00:00
Ingo Weinhold 3967230d7f Reverted r29471. It breaks building kernel code including this heaader in
debug mode with gcc 2.95.3.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29547 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-15 23:45:05 +00:00
Stephan Aßmus 105c63e8cd To avoid problems of reversed meaning of "extern inline" in
GCC 4.3 and above (conforming to the standard when compiled with -std=c99
or -std=gnu99), define the inline functions as "static inline". I've had
another patch that maintains the previous behavior, but as titer pointed
out, we have no code in our repo that overrides the inlined functions
with their own version, and doing so for any other code would be
problematic, since for example Linux libio.h #defines these as macros.
In any case, I don't really know what I am doing, so please correct me
if I did something stupid! :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29471 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-11 11:21:52 +00:00
Jérôme Duval 2c9d779293 * pthread.h should include sched.h (bug #3516)
* semaphore.h should include fcntl.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29438 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-08 13:56:15 +00:00
Ingo Weinhold 9af9826fca Fixed value of _POSIX_VDISABLE. cc_t is unsigned in Haiku. ATM we don't
support _POSIX_VDISABLE at all. It's even questionable whether the value
(unsigned char)-2 is a good choice.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29137 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-02-06 12:35:01 +00:00
Ingo Weinhold 8eba0c540f Added O_NDELAY as synonym of O_NONBLOCK.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29136 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-02-05 11:07:20 +00:00
Michael Lotz d0a06a0995 Add missing mkdtemp prototype.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-25 17:11:22 +00:00
Axel Dörfler b2cd5c48e7 * Applied Scott's patch to remove the duplicate definitions, thus closing
bug #2237. Thanks!
* Cleaned up the file a bit (removed the _P() and fixed indentation).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28961 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-19 22:20:28 +00:00
Axel Dörfler 18f27bf19f * Added POSIX function strndup(), closing ticket #3309.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28939 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-18 20:27:12 +00:00
Axel Dörfler e38a38aacf * I obviously forgot to commit this: adds siginterrupt() prototype, and
does some minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28897 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-14 13:52:13 +00:00
Salvatore Benedetto b3e849c2ce * Adding libgen.h as a public header
* Implementing dirname and basename

I removed dirname from glibc/misc and reimplemented in order
to (hopefully) keep thing tidy.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28888 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-11 23:38:27 +00:00
Axel Dörfler 0b6361ef3a * Replaced INADDR_ANY, INADDR_BROADCAST, and INADDR_NONE with constants, as
the endian doesn't matter for them. While I consider code that relies on this
  as broken (as they don't follow the standard), it doesn't hurt, anyway; this
  closes ticket #3121.
* Header cleanup, added license.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28625 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-12 12:36:32 +00:00
Ingo Weinhold 0c85bd054e * Reworked undefined symbol resolution in the runtime loader. Got rid of
the per-root-image breadth-first sorted image array. Instead we have a
  per-image hook function to resolve the symbols. The default function
  uses the sLoadedImages list directly, which is breadth-first sorted
  anyway. There's also a BeOS function for old-style symbol resolution
  and one for add-ons, which lacks a proper implementation yet (just
  uses old-style ATM).
* Made the dl*() functions POSIX compliant:
  - dlopen() does no longer use load_add_on(), but loads the object as a
    library. It also properly supports a NULL name, now -- the previous
    "_APP_" work-around did only work, if this soname was set on the
    program (unlikely for programs using this API).
  - Implemented RTLD_{GLOBAL,LOCAL}.
  - dlsym() looks up symbols properly now, i.e. not just in the given
    image, but breadth-first for an actual image or in load order for
    the global scope. It also supports the not-quite POSIX RTLD_DEFAULT
    and RTLD_NEXT extensions. Our RTLD_NEXT finds more symbols than in
    Linux (also in later dlopen()ed libraries), but that should be fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28568 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-08 22:40:56 +00:00
Ingo Weinhold 3a39905b59 Implemented __freading(), __fpurge(), and fpurge().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28397 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-31 13:02:40 +00:00
Axel Dörfler 6e036f0479 * Updated glob.h and its implementation to FreeBSD current (1.10, 1.27),
adapted them to work on Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28355 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-28 14:13:30 +00:00
Axel Dörfler e2040be893 * Applied patch by Romain Picard: added support for the GNU extension dladdr(),
thanks!
* This closes ticket #2818.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28308 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-24 09:53:48 +00:00
Axel Dörfler 051bb0bb64 * Added a comment to SO_BINDTODEVICE.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28128 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 12:33:59 +00:00
Axel Dörfler 2716cfd3d7 * Threw away the broken stat() vs. _stat() mechanism to allow for more fields
in struct stat.
* Instead, I followed Marcus' great idea and added a compatibility check in
  the runtime loader: now, R5 binaries (also shared libraries) are detected,
  and they get special versions for stat(), fstat(), and lstat() that return
  the smaller stat struct.
* However, I've disabled (in src/system/libroot/posix/sys/stat.c) using the
  larger stat field for now, as this breaks some of our optional packages.
  So until we rebuild them all, this shouldn't be enabled.
* This should now also be used for BeOS compatibility in libnetwork.so.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27961 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-10 22:13:05 +00:00
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
Ingo Weinhold f7cc12b389 Implemented pthread_attr_{g,s}etstacksize(). Also added commented-out
prototypes for the missing pthread_attr_*() functions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25390 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-09 01:36:49 +00:00
Ingo Weinhold f23d0a6242 Implement shm_open() and shm_unlink(). The shared memory objects are
simply created as files in /boot/var/shared_memory/. The Bootscript
clears the directory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25374 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 13:42:33 +00:00
Ingo Weinhold 3dfe682f55 * Added some padding to the sem_t structure.
* Changed the semantics of unnamed semaphores. Before parent and child
  of a fork() would always share an earlier created semaphore. Now we do
  that only, if the "shared" parameter of sem_init() was true. That's
  still not quite the behavior Linux and Solaris have, but should be
  perfectly fine with how reasonable code would use the API.
* There's a global table for shared unnamed semaphores now. ATM a
  semaphore is leaked when no one explicitly destroys it (just as with
  named sems).
* Enforce per-team and global semaphore number limits.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25362 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 01:39:49 +00:00
Ingo Weinhold 01b1098795 * Fixed some misunderstanding regarding the _POSIX_* macros. They are
not supposed to be passed to pathconf() or sysconf().
* Added POSIX semaphore related macros.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25361 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 01:27:31 +00:00
Ingo Weinhold 5142c2ac86 Added support for POSIX semaphores (the ones from the XSI extension
Realtime option group). The implementation should be complete, but is
totally untested yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25326 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-06 03:39:36 +00:00
Ingo Weinhold d29deffa2c Added the Linuxish SO_PEERCRED.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25303 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-04 00:28:27 +00:00
Ingo Weinhold 0e42d1bcd8 Our sockaddr_storage is only 128 bytes long. Hence invocations of bind()
or connect() that passed sizeof(sockaddr_un) would always fail. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25138 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-24 22:30:54 +00:00
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
Axel Dörfler 945fb7e32a * Replaced destructor with destructorFunc to please python - it's not a reserved
keyword, so this stupid python should really be fixed instead.
* Enforced the 80 column limit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25090 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-20 21:20:07 +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
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
Ingo Weinhold ac4630e161 * Added <sys/param.h> include, which is needed for _ALIGN().
* Added SCM_RIGHTS macro.
* Added a few non-standard but widely-used CMSG_*() macros.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24936 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:30:25 +00:00
Ingo Weinhold bab4c3bbff Changed the type of msghdr::{msg_name,msg_control} to void* as dictated
by POSIX.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24902 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 03:27:53 +00:00
Ingo Weinhold ef7cb2253b Rather use a char[] for the path. uint8_t[] is rather uncomfortable to
use with the string and *printf() functions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24882 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 03:06:11 +00:00
Ingo Weinhold 64cd033664 Added socket macros.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-10 03:04:03 +00:00
Axel Dörfler 3d7e508f7b Added sys/poll.h header by popular request (see ticket #2037).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-08 09:17:07 +00:00