Commit Graph

1779 Commits

Author SHA1 Message Date
christos 9dd3d50e00 PR/53393: coypu: move rint to the right section. 2018-06-24 22:07:46 +00:00
kamil 4f2f27c8d8 Mark in string.h: memccpy(3) and strdup(3) as _POSIX_C_SOURCE >= 2001 2018-02-20 02:35:24 +00:00
christos 3c15acfdbe fix typo 2018-02-06 20:22:41 +00:00
christos 4e8153bc86 detect duplicate declaration of pthread_atfork() in pthread.h 2018-02-06 20:21:21 +00:00
mrg 8fdd01b3ee fixes for GCC 6:
- -Wstrict-prototypes is not available for C++, so don't try to
  ignore it for C++.
- remove many _DIAGASSERT() checks against not NULL for functions
  with arguments with nonnull attributes.  in two cases, leave
  code behind that should set defaults to "(null)".
- use -Wno-error=frame-address for i386 mcount, as it seems valid
  to assume the caller will have a frame.fair
2018-02-04 01:13:45 +00:00
christos b985414b8f Merge autofs support from: Tomohiro Kusumi
XXX: Does not work yet
2018-01-09 03:31:12 +00:00
christos 85bf85b701 make _lwp_park return the remaining time to sleep in the "ts" argument
if it is a relative timestamp, as discussed in tech-kern.
XXX: pullup-8
2017-12-08 01:19:29 +00:00
maya a1df7aec01 Add endian.h header. Simply includes sys/endian.h
<endian.h> has been accepted by the austin group.
2017-10-16 11:38:25 +00:00
christos 96a83291ba remove recallocarray 2017-10-07 21:15:48 +00:00
christos 345c694682 add recallocarray (used by openssh-7.6) 2017-10-07 19:38:09 +00:00
joerg 29f5b623d9 Add missing strfmon_l. Noticed by Bruno Haible. Add test case. 2017-08-16 13:53:19 +00:00
christos 7b923e1c00 s/not sure why// and make these work :-) 2017-08-16 08:35:48 +00:00
joerg e5678be828 Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
functions are used for destructors of thread_local objects.

If a pending destructor exists, prevent unloading of shared objects.
Introduce __dl_cxa_refcount interface for this purpose. When the last
reference is gone and the object has been dlclose'd before, the
unloading is finalized.

Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists
on providing __cxa_thread_atexit as direct wrapper without further
patching.
2017-07-11 15:21:31 +00:00
kre 486691905e Add the new signalname/signalnext/signalnumber interface to libc.
This as discussed on current-users in the thread
entitled:
  Proposal: new libc/libutil functions to map SIGXXXX <-> "XXXX"
that can be found (starting at):
  http://mail-index.netbsd.org/current-users/2017/04/28/msg031600.html

These functions provide the mechanism to enable applications
to divorce themselves from internal details of the signal
implementation.

Libc minor bumped, prototypes in <signal.h>, sets lists updated (and sorted).

One and all: feel free to improve the sources & man page (etc), but
please do not change the function signatures without discussion.
2017-05-09 11:14:16 +00:00
christos f81dba2062 Add vis DQ. 2017-04-23 01:57:36 +00:00
christos 395ebe609b fexcept_t + fenv_t should be handled the same way for softfloat 2017-04-09 15:29:07 +00:00
sevan a15505744d Add RCS tag. 2017-04-04 12:25:40 +00:00
chs 7e30e94394 provide a common softfloat fenv implemenation and use it for softfloat builds.
restore ABI compatibility with previous releases for ieeefp.h on sh3.
add namespace.h protection for all the fenv interfaces.
use MKSOFTFLOAT on sh3 instead of assuming softfloat.
standardize on comparing MKSOFTFLOAT with "no".
remove the arm-specific softfloat fenv code (which also had several bugs).
fix logic errors in the arm hardfloat feraiseexcept() and feupdateenv().
2017-03-22 23:11:07 +00:00
scole e3edf3b621 Add fenv for ia64, imported from FreeBSD, compile tested only. 2017-02-23 02:05:30 +00:00
christos a8c3505052 add _PATH_DEVZERO 2017-01-16 19:15:28 +00:00
christos 9279f94b7e elide strict-prototypes for unrepresentable function 2017-01-15 20:10:25 +00:00
christos 86268722b0 Welcome to the constant age! 2017-01-12 18:42:53 +00:00
mrg f1582e88f7 scandir/alphasort take "const struct dirent **" not "const void *" in
modern unix.  since we claim to be 'IEEE Std 1003.1-2008', make it so.
2016-12-16 04:45:04 +00:00
kamil 6245abaafa Import wcsnlen(3) to libc
The wcsnlen(3) function conforms to POSIX.1-2008 and is an addition to the
ISO C standard.

size_t wcsnlen(const wchar_t *s, size_t maxlen);

The wcsnlen(3) function computes the number of wide-characters in a wide-
-string to which s points, not including NULL terminating wide-character
code and checking no more than maxlen wide-characters. This function never
examines wide-characters beyond a wide-string of maxlen size.


This function is a safer version of wcslen(3):

size_t wcslen(const wchar_t *s);


Update STANDARDS section of wmemchr(3) describing wide-character functions.
2016-10-15 14:21:59 +00:00
christos 12b4355e4e add strchrnull 2016-10-12 20:01:22 +00:00
kamil 7f4b5eb156 Add timespec_get(3) in <time.h> and enable unconditionally struct timespec
These changes conforms to the C11 standard
References:
 - 7.27.1/3 Components of time (struct timespec)
 - 7.27.2.5 The timespec_get function

According to ISO/IEC 9899:201x (draft) <time.h> defines the timespec
structure and declares the timespec_get(3) function with TIME_UTC
definition.

According to a C++17 standard draft <ctime> offers the same interface in
the std:: namespace.

The timespec_get function modifies the timespec object pointed by ts
to hold the current calendar time in the given base. The standard notes
only the TIME_UTC base with implementation defined value, set it to 1
as zero is reserved for error handling. Once operation was successful this
function returns passed base, otherwise exits with zero.

The timespec struct was already part of the POSIX standard in <time.h>.

Enable this interface unconditionally in the header to allow to use it
in a code prior C11 and C++17 as an extension.

Review notes from <christos>
2016-10-04 09:41:40 +00:00
kamil ba27f5b7d6 Add static_assert macro definition in <assert.h>
This declaration conforms to the C11 standard
Reference: ISO/IEC 9899:201x 7.2 Diagnostics <assert.h>

_Static_assert performs compile-time assertion checking.

According to ISO/IEC 9899:201x (draft) 7.2 Diagnostics <assert.h> defines
the static_assert macro which expands to _Static_assert. It's not
conditionalized by NDEBUG like the assert macro.

According to ISO/IEC N3242=11-0012 (C++1x) the <cassert> header shall
define only the assert macro, but not static_assert as it's already part
of the C++11 language.

Allow to define static_assert in C++ prior the C++11 standard. It might be
broken but a nonstandard C++ compiler might support C11-like _Static_assert
feature. Note that it's fatal for g++ 5.4, but it works for clang++ 3.8.1.

Approved by <joerg>.
2016-10-03 12:08:39 +00:00
kamil 7db6ba3b08 Import <stdalign.h>
This header conforms to the C11 standard
Reference: ISO/IEC 9899:201x 7.15 Alignment <stdalign.h>

According to ISO/IEC 9899:201x (draft) 7.15 Alignment <stdalign.h> defines
four macros:
 - alignas which expands to _Alignas
 - alignof which expands to _Alignof
 - __alignas_is_defined and __alignof_is_defined which both expand to 1

The _Alignas declaration appears as one of the type specifiers to modify
the alignment requirement of the object being declared.

The _Alignof operator is used to query the alignment requirement of its
operand type.

ISO/IEC N3242=11-0012 (C++1x) and ISO/IEC N3797 (C++1y) both note a header
<cstdalign> which defines only __alignas_is_defined and shall not define
the alignas macro. It misses the alignof case as it's probably based on an
older C1x draft, which defined only alignas. Assume that this is a bug in
the standard and treat alignof the same way as alignas in C++11.

Allow to define alignas and alignof in C++ prior the C++11 standard. It
might be broken but a nonstandard C++ compiler might support C11-like
_Alignas and _Alignof. Note that it's fatal for g++(1) v.5.4.
2016-10-02 17:19:00 +00:00
kamil 7798b8a775 Import <stdnoreturn.h>
This header conforms to the C11 standard
Reference: ISO/IEC 9899:201x 7.23 _Noreturn <stdnoreturn.h>

According to ISO/IEC 9899:201x (draft) <stdnoreturn.> defines the
noreturn macro which expands to _Noreturn.

The _Noreturn keyword appears in a function declaration and specifies
that the function does not return by reaching the end of the function
body.

Design choices:
 - don't implicitly break C++ code including this header with #error
   C++11 offers [[noreturn]] which conflicts with C11 _Noreturn

 - don't check for __STDC_VERSION__, everybody is free to reuse it with
   a nonstandard compiler not conforming to C11 but supporting _Noreturn

   gcc(1) and clang(1) support _Noreturn in -std=c99 and older standards

   this follows <stdbool.h> choice for not checking for C99

 - follow <stdbool.h> and declare the __noreturn_is_defined guard

 - use a standard header guard (_STDNORETURN_H_), similar to <stdbool.h>

Reviewed by <pgoyette> and <joerg>
2016-10-02 13:09:24 +00:00
christos 2b55b3112e remove mpool_getf 2016-09-24 21:18:09 +00:00
christos 0ac50079c4 sync with mit/kerberos db 2016-09-24 20:11:43 +00:00
roy 9fed1c5a9e Add ifa_addrflags to ifaddrs (forgot to commit this file, thanks Ryo!) 2016-09-21 13:32:27 +00:00
christos 40cfe4c8d2 add sh 2016-08-25 12:12:59 +00:00
christos 6aac56bef8 add alpha 2016-08-23 09:59:46 +00:00
christos c10c4abe0f Realtime signal support from GSoC 2016, Charles Cui. 2016-08-04 06:43:43 +00:00
njoly d1b4525986 According to Opengroup online specifications[1], _POSIX_CPUTIME and
_POSIX_THREAD_CPUTIME options should be present in unistd.h not
limits.h. Move them with other options.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html
2016-07-21 16:01:58 +00:00
christos d32f1d2f0f add hmac(3) 2016-07-01 22:42:01 +00:00
christos 4fda2f64e1 define block length 2016-07-01 16:42:46 +00:00
dholland ae3b3bcc2b PR 51287 Ralf Nolden: posix_fallocate belongs in <fcntl.h> 2016-06-30 15:29:20 +00:00
kamil e3d1905862 Use generic types in the profil(2) function prototype (<unistd.h>) 2016-06-18 14:39:15 +00:00
christos ea2913a0a2 GSoC 2016: Charles Cui: Add timer related macros
_POSIX_CPUTIME
    _POSIX_THREAD_CPUTIME
    _POSIX_DELAYTIMER_MAX
2016-06-10 23:29:20 +00:00
christos 0196f35dd1 GSoC 2016: Charles Cui: add SEM_NSEMS_MAX 2016-06-10 23:24:33 +00:00
joerg 5d45063308 Go back to just using normal visibility for the locale symbols. Without
an actual specifier like dllimport, protected visibility is unusable.
2016-04-29 16:26:48 +00:00
dholland 521eaa499b Define SEM_VALUE_MAX in only one place.
Adding a whole extra header file just for this is not the optimal
solution... but stuffing it in with anything else exposes things that
otherwise wouldn't be.

Nothing in userland should use <sys/semaphore.h> directly, and if some
foolish third-party software should decide to do so anyway in spite of
the instructions to the contrary I will ruthlessly break it later when
the big kernel includes cleanup finally happens.

Reported by Kamil Rytarowski, and, as it turns out, also by Klaus
Heinz in 2008.
2016-04-24 19:48:29 +00:00
christos ac892fb52b add clock_cpugetclockid{2,} 2016-04-23 23:10:10 +00:00
roy 6b9006e83c Implement pidfile_lock, pidfile_read and pidfile_clean.
Discussed on tech-net@, ok core@.
2016-04-10 19:05:50 +00:00
christos 618262a97a use foo - 0 instead of testing for defined(foo); from joerg@ 2016-03-20 16:26:06 +00:00
christos c07b0c6505 PR/50983: David Shao: Protect stddef;
also make the pointer void *.
2016-03-20 14:11:49 +00:00
christos 143f5307f7 disable dso protected for clang now, so that packages can be built.
(again this is the binutils warning about copy relocations on protected objects)
2016-03-17 17:36:32 +00:00
christos 8aeecea358 more casting fixes 2016-03-17 02:25:32 +00:00
christos ede51e408c gcc 5, my patience is waning. 2016-03-17 00:42:49 +00:00
christos 66e7b2616e appease gcc-5 |= #$@#% 2016-03-17 00:15:27 +00:00
mrg b298dc9162 add max_align_t. C11 defines this and GCC 5.3 really wants it.
XXX: language laywers, please feel free to fix this as necessary.
2016-03-17 00:03:38 +00:00
leot 2a4b16ea45 strndup() is part of XSI from The Open Group Base Specification Issue 7 and had
a similar history of stpcpy(), stpncpy() and strnlen().
Make it visible under XOPEN_SOURCE>=700 too (not just _NETBSD_SOURCE).

ok dholland@
2016-03-10 18:53:48 +00:00
christos 53a91c7008 - GC pts_fired, and fix the comment about MAX_TIMERS
- Bump MAX_TIMERS to 36 so that we have 32 POSIX user timers which is the
  minimum required.
2016-03-08 05:02:55 +00:00
christos 25f8e5a66f undo protected symbol hack. 2016-03-08 03:58:31 +00:00
christos 68cdf08b32 We only have 28 timers available. 2016-02-26 17:10:23 +00:00
christos 5641580370 Add relatime. 2016-02-21 22:45:25 +00:00
christos 8bdedb49af disable dso protected to work around binutils bug 2016-01-29 15:18:33 +00:00
dholland b030061971 Needs sys/select.h for fd_set; fails only when _POSIX_SOURCE is defined,
because then something else doesn't include it. (I guess.)
2016-01-23 02:36:57 +00:00
dholland 89050ca13e unsigned -> unsigned int in previous change to accomodate C++ boneheadedness. 2016-01-23 02:34:09 +00:00
dholland 398f572480 Apparently a recent round of vandalism by the C++ standards committee
includes disallowing the standard and historic type name "unsigned". Add
a gratuitous "int" to recent changes.

C++ is really a blight on the world.
2016-01-23 01:26:14 +00:00
dholland 29f79e71d2 u_int -> unsigned, u_long -> unsigned long, etc. 2016-01-23 01:05:30 +00:00
dholland e7633a3426 Needs sys/cdefs.h for __BEGIN_DECLS. Also add time.h to get time_t,
rather than doing the machine/ansi.h #ifdef dance, as it doesn't matter
much what symbols utmp.h exposes. This could be tightened later when we
manage to do enough include cleanup to make such dances less expensive
to maintain.
2016-01-22 23:59:44 +00:00
dholland b43a55ad4d Uses BEGIN_DECLS and needs sys/cdefs.h. 2016-01-22 23:23:13 +00:00
dholland e94e0027be Include <rpc/rpc.h> so XDR is defined. 2016-01-22 23:22:56 +00:00
dholland ff993d476d Needs sys/types.h for mode_t, off_t, ssize_t, and others. 2016-01-22 23:15:58 +00:00
dholland d151926dfa Needs stdint.h. 2016-01-22 23:15:42 +00:00
dholland 8724a4945a Erm, fix previous.
(also, as this protocol is externally defined it probably should use its
own constant and not either of these system-defined hostname lengths...)
2016-01-22 23:13:20 +00:00
dholland a8c9c98e22 These all need stdint.h.
Also, dumprestore.h needs ufs/ufs/dinode.h; in talkd.h use unsigned
char instead of u_char; and in timed.h include limits.h and use
_POSIX_HOST_NAME_MAX instead of MAXHOSTNAMELEN as the latter would
require sys/param.h.
2016-01-22 23:11:50 +00:00
dholland 33adcbb57f Needs stddef.h for size_t. 2016-01-22 22:27:01 +00:00
dholland 433257163a Has __BEGIN_DECLS, needs sys/types.h. 2016-01-22 22:26:45 +00:00
dholland 888c134026 u_char, u_int, u_long -> unsigned char, unsigned, unsigned long
This makes these headers work without _NETBSD_SOURCE.
2016-01-22 21:55:57 +00:00
christos 1a175d5bd9 rename to regnsub 2016-01-14 21:45:18 +00:00
christos 3df8d6b91f add stravis 2016-01-14 20:42:14 +00:00
christos 4c892c323a add reg{,a}sub 2016-01-14 20:41:47 +00:00
christos eae3ba3928 fix inverted condition... 2015-12-29 01:58:26 +00:00
martin f8bb018f00 Add missing eol-escape 2015-12-28 11:03:36 +00:00
christos 9c19c47e2d We need at least 68010 or coldfire for fenv. 2015-12-27 19:50:31 +00:00
christos 176b7bf263 add m68k, default types. 2015-12-24 14:13:59 +00:00
christos 9700ed8d5c rearrange... 2015-12-24 04:16:00 +00:00
christos fc70f27d66 Add __HAVE_FENV 2015-12-22 14:24:55 +00:00
christos 8dd36ea983 Add fenv.h for mips 2015-12-21 16:49:53 +00:00
christos 57b499ef66 Powerpc now has fenv.h 2015-12-20 16:24:45 +00:00
christos 3a9f77c250 add some const 2015-11-20 20:37:08 +00:00
christos d432193098 keep value as an int. 2015-11-20 20:27:20 +00:00
christos a5c147c83f update to size_t 2015-11-20 20:24:49 +00:00
reinoud d6424c5393 Revert 2015-11-19 20:57:49 +00:00
reinoud b4f510032f Fix ANSI-C prototype error 2015-11-19 20:34:47 +00:00
christos fcc3c9564a PR/50434: Louis Guillaume: Bump the in and out formats to 511 (NAME_MAX) 2015-11-16 17:09:56 +00:00
christos 58d11ee7bb provide a poll(2) based interface. 2015-11-07 23:10:37 +00:00
christos 670a38d899 Put back NULL tests for allocation failures. 2015-11-07 16:58:24 +00:00
nros b16a5c9dec Add the C11 function aligned_alloc to libc. 2015-11-07 16:21:42 +00:00
christos cdf9ad9883 Switch to the size-unlimited fd_set. Some code will need to change to be
able to use this if the code allocates its own fd_set's.
2015-11-06 19:42:57 +00:00
christos fa13c0f43d - provide accessor functions for the fdset's used internally.
- add getreqset2 method that takes a setsize.
2015-11-06 19:35:40 +00:00
christos 1136c97c1c add tzgetgmtoff 2015-10-29 17:48:55 +00:00
christos 3762d08e86 add kinfo_getvmmap() decl 2015-09-24 14:39:37 +00:00
plunky 762a9b9c68 correct __ssp_overlap() to not trigger for adjacent areas 2015-09-03 20:43:47 +00:00
kamil 0c4bdb7434 Do as POSIX says, define the timespec structure in <signal.h>
Extract struct timespec from <sys/time.h> and put into a separate header.

This solution is minimally invasive.
2015-07-31 12:51:32 +00:00
christos 024ced04ed move stdbool.h to sys, reuire pool.h to include <sys/stdbool.h> for bool,
centralize definitions of bool, true, false, to <sys/stdbool.h>
2015-07-29 00:10:25 +00:00
kamil 2cf5f6af2b Add ereallocarr(3) to libutil
ereallocarr(3) wraps reallocarr(3) and embeds return status validation.

Older version reviewed by <riastradh> and <christos>
2015-07-26 02:20:30 +00:00
christos 4701a51d4b updatre with latest from tzcode. 2015-07-11 16:40:53 +00:00
joerg c7f24be614 Allow SSP enabled functions to conditionally skip the object size check.
Use this is fix the getcwd(NULL, lmit) case, which breaks in lang/parrot.
2015-06-25 18:41:03 +00:00
manu 841339f07f Make PTHREAD_KEYS_MAX dynamically adjustable
NetBSD's PTHREAD_KEYS_MAX is set to 256, which is low compared to
other systems like Linux (1024) or MacOS X (512). As a result some
setups tested on Linux will exhibit problems on NetBSD because of
pthread_keys usage beyond the limit. This happens for instance on
Apache with various module loaded, and in this case no particular
developper can be blamed for going beyond the limit, since several
modules from different sources contribute to the problem.

This patch makes the limit conigurable through the PTHREAD_KEYS_MAX
environement variable. If undefined, the default remains unchanged
(256). In any case, the value cannot be lowered below POSIX-mandated
_POSIX_THREAD_KEYS_MAX (128).

While there:
- use EXIT_FAILURE instead of 1 when calling err(3) in libpthread.
- Reset _POSIX_THREAD_KEYS_MAX to POSIX mandated 128, instead of 256.
2015-05-29 07:37:31 +00:00
christos a7328ae62a add VIS_NOLOCALE flag 2015-05-23 11:48:31 +00:00
christos adfc40c594 add a macro to check overlapping pointers 2015-05-09 15:41:47 +00:00
pgoyette 3e6c65d1e2 Add missing PATH_WATCHDOG (to complement PATH_SYSMON and PATH_POWER) 2015-05-06 23:06:26 +00:00
wiz fc5db8c0e8 Put fseeko, ftello, pread, and pwrite in the POSIX 2001 namespace.
Ok christos, apb, martin
2015-03-24 07:44:52 +00:00
dholland faa5a4f036 One vscanf_l is ample. 2015-03-05 03:29:02 +00:00
christos 72566f3f96 PR/49715: Henning Petersen: Missing _*_DECLS in stdio.h around popenve. 2015-03-04 13:33:19 +00:00
christos 4d416d886b belated removal of the advertising clause. 2015-02-24 17:56:20 +00:00
christos 5a70401cf6 PR/49684: Pierre Pronchery: readlinkat(2) return type is wrong. 2015-02-22 00:50:30 +00:00
joerg 9b5f3d5723 Move reallocarray under _OPENBSD_SOURCE where it belongs. 2015-02-17 20:33:40 +00:00
joerg c9baa5968d Introduce reallocarr(3) for easy (re)allocation of memory with overflow
checks. Compared to OpenBSD's reallocarray, makes it easier to avoid memory
leaks on allocation failures and it doesn't depend on malloc(0) != NULL
for correct error checking. Compared to plain realloc, it also avoids
the problem of intermediate integer overflows. The trade-off is the use
of void * to side step C type system with regard to generic pointer to
pointer.
2015-02-17 20:29:20 +00:00
christos 7f04eb91cf add reallocarray 2015-02-05 16:05:46 +00:00
christos 829f81ac73 add popenve(). 2015-01-20 17:29:00 +00:00
christos 0a09d1ccef add estrto{i,u} (Kamil Rytarowski) 2015-01-18 18:10:01 +00:00
christos f1e6017cdd remove restrict to match with OpenBSD prototype (Kamil Rytarowski) 2015-01-18 17:56:09 +00:00
christos 5bdc27618e Add strtonum protected with _OPENBSD_SOURCE 2015-01-16 18:40:16 +00:00
christos eba37ae46b strtoi and strtou additions 2015-01-16 18:35:59 +00:00
martin dce8d6f504 fenv(3) support for hppa 2014-12-27 16:54:02 +00:00
pooka a238844191 Create the stpncpy() inline only when GCC>=4.8 || clang
Mirrors the stpncpy() wrapper macro and avoids the following:
warning: implicit declaration of function ‘__builtin___stpncpy_chk’
2014-11-29 13:23:48 +00:00
christos faef322439 add open_{,w}memstream 2014-10-13 00:47:03 +00:00
christos 3a0f0eb646 sync function signatures with tzcode 2014-10-07 21:50:36 +00:00
christos 718924c8d3 add execvpe, execlpe (reviewed by phone) 2014-09-26 19:28:03 +00:00
christos e36fdb7ec1 add VIS_META/VIS_SHELL support to encode all shell metacharacters.
XXX: /etc/rc.d/wizd fix $
2014-09-26 01:21:07 +00:00
christos 155fdf3987 add strnstr from FreeBSD 2014-09-24 18:16:36 +00:00
matt bf1be8599e RISC-V support <fenv.h> 2014-09-19 17:39:15 +00:00
matt 65b2ebd6b2 or1k support <fenv.h> 2014-09-03 19:28:20 +00:00
matt 547b3a3b01 Changes to existing files to enable building AARCH64 userland.
evbarm64-el
This is clang only.  While gcc4.8 supports aarch64, no netbsd support has
been written for aarch64 with gcc4.8.
2014-08-10 05:56:36 +00:00
christos 8e2b2a8fd3 cast to LHS type and minor KNF. 2014-08-07 17:24:03 +00:00
dholland d0352e761c Add userlevel manifestations of posix_fallocate and fdiscard, in
unistd.h and libc, and add a man page.

Allow wiggle room in the man page for implementations of fallocate
that either (a) don't fully unwind on failure, leaving new blocks
allocated without changing the file size, or (b) create only in-memory
transient reservations that disappear when crashing or rebooting.

Also, add crossreference to fdiscard from ftruncate(2), and remove the
old BUGS entry from there that called for a generalized version that
allows discarding ranges of a file: that's what fdiscard is.
2014-07-25 08:30:47 +00:00
christos 6030f04a15 amend the new destroy function to take function pointers. 2014-07-20 20:17:21 +00:00
christos 842ee049dd Our hdestroy implementation was non-conformant because it freed the key of
each entry. Add a new function hdestroy1 that allows the user to control
what gets freed. Pointed out by Pedro Giffuni at FreeBSD.
2014-07-20 13:34:17 +00:00
christos e00a3615cf add mkostemp{s,} mkstemps from FreeBSD 2014-06-18 17:48:22 +00:00
christos b27e135433 rename to 60 2014-06-12 18:49:37 +00:00
christos 1eb0dcbb1d fix srandom and initstate signatures (from enh at google) 2014-06-12 18:44:36 +00:00
christos af46c9781f Always use the reentrant rpc_createerr. Otherwise every threaded program
that uses rpc needs to define _REENTRANT to work properly. We'll keep
compatibility but setting the old variable in the library, but we are not
advertising it anymore.
2014-06-06 14:31:24 +00:00
joerg a8b7899cfa Fix use of getline and friends in C++ code. 2014-05-23 16:48:52 +00:00
kleink eead6b988e Move declarations of getdelim() and getline() from the (incorrect) ANSI C
section to POSIX-2008.  From Jarmo Jaakkola in PR standards/48788.
2014-05-19 16:04:10 +00:00
pooka 366b2dd23e Apparently clang pretends to be gcc 4.2 but is secretly much awesomer
than gcc 4.2, so enable the stpncpy() wrapper also for clang.
2014-04-25 18:37:38 +00:00
pooka 232a041b7a Wrap stpncpy() iff GNUC_PREREQ(4,8). Fixes USE_SSP=yes builds
with gcc 4.5.
2014-04-24 20:12:56 +00:00
christos 73447a65e4 add stpncpy() 2014-04-06 19:29:58 +00:00
christos 5570e6936a __lwp_park60 2014-01-31 20:44:17 +00:00
christos 1102b348b0 Add the {v,}{warn,err}c function flavors from FreeBSD 2014-01-16 17:22:06 +00:00
christos eabc0dd171 add ptsname_r 2014-01-08 02:15:42 +00:00
christos a012ad3d35 PR/4891: Wiz: readlink moved from xopen to base at issue 5. 2014-01-02 23:33:50 +00:00
matt a9c8f9282e Make ptrdiff_t available in the kernel. 2013-12-12 17:53:03 +00:00
joerg aceb213538 Allow kernel code to access constant databases by moving cdbr(3) and the
required mi_vector_hash(3) into src/common.
2013-12-11 01:24:08 +00:00
joerg fcff7df126 Add cdbr_open_mem. 2013-12-05 21:17:23 +00:00