Commit Graph

1690 Commits

Author SHA1 Message Date
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
christos 115f51c7be add new internal functions 2013-12-01 00:23:11 +00:00
christos 96c26aba65 use a TAILQ instead of a CIRCLEQ, from FreeBSD 2013-11-22 16:25:01 +00:00
degroote 0809f57592 Expose properly vfwscanf and friends for POSIX_SOURCE >= 200112L 2013-11-21 09:09:52 +00:00
christos 53e3f1af8a gcc-4.8.1 is has a builtin stpncpy, but is missing the __builtin_ ssp
equivalent. go figure.
2013-11-07 02:00:54 +00:00
tron fb23e6a8a9 Revert my last change. I'm not convinced it is correct and while it seems
to fix some build problems it might cause others.
2013-11-07 00:02:58 +00:00
tron 24f67c8710 Add missing declarations for SSP versions of stpcpy(3) and stpncpy(3). 2013-11-06 21:33:12 +00:00
christos c15ffc1416 add stp{,n}cpy 2013-11-06 16:31:08 +00:00
njoly 0d88813605 Follow OpenGroup online specification[1], move
fchmodat/mkdirat/mkfifoat/mknodat prototypes to <sys.stat.h>.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html
2013-10-09 09:38:21 +00:00
martin cc4812f36b Allow archs to provide __isinf() and __isnan() as inline functions instead
of macros.
2013-09-16 15:54:42 +00:00
riastradh 1239c2bb08 Publish explicit_memset and consttime_memequal in userland libc.
Remove the double-underscore from the userland versions, and do the
weak alias dance instead, now that these are public parts of libc.

As discussed on tech-userlevel:

https://mail-index.netbsd.org/tech-userlevel/2013/06/24/msg007843.html
(option 3)
2013-08-28 17:47:07 +00:00
riastradh 495fdb7e9a Make explicit_memset match memset's return value. 2013-08-28 15:46:23 +00:00
joerg cc1cb97e40 Remove outdated comment. 2013-08-27 18:29:28 +00:00
joerg 7efdee83f2 Add strerror_l. 2013-08-19 13:03:12 +00:00
joerg 9c11b12444 Add nl_langinfo_l, catopen_l and wcsftime_l. 2013-08-19 08:03:33 +00:00
christos 2c0b172d86 fix gethostbyaddr prototype per TOG. 2013-08-19 07:18:42 +00:00
riastradh 82db4b9858 Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.
consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
2013-06-24 04:21:19 +00:00
joerg 85a67e61f7 Add mbsnrtowcs and wcsnrtombs. Approved by core. 2013-05-28 16:57:56 +00:00
joerg 844ef71922 Too many endif. 2013-05-17 14:11:55 +00:00
joerg 2aac8b87b0 Only provide LC_C_LOCALE under _NETBSD_SOURCE. 2013-05-17 13:00:40 +00:00
joerg e0ac190e1e Provide explicit LC_C_LOCALE accessor and drop the various NULL checks.
Provide LC_GLOBAL_LOCALE in a way that works with all locale functions.
Merge constant data used by the initial global locale and the C locale.
Drop function call layer for _current_locale() and directly return the
locale reference, not a pointer to it. Use protected access for global
variables, so that libc references can avoid the GOT overhead.
2013-05-17 12:55:56 +00:00
christos df2bc3e4f8 add the signal safe prototypes 2013-05-04 18:30:14 +00:00
riz 05108b4611 Add missing #endif (Hi, Christos!) 2013-05-04 00:37:47 +00:00
christos 017320144a PR/25827, PR/32373: addr AI_SRV 2013-05-03 19:34:13 +00:00
matt 8c629cb493 Add getbyteorder(void) prototype. 2013-05-02 07:17:35 +00:00
joerg 81d0329e8d Make that to process PATH_LOCALE the first time _find_category is
called. Use this to implement newlocale and provide duplocale/freelocale
as well. Based on patches by Takehiko Nozaki with simplications and fix
for the init order by myself.
2013-04-30 00:45:04 +00:00
matt 0b64d3196d Enable fenv support for arm. 2013-04-28 21:07:36 +00:00
joerg 668d06e93f Include at least ctype_bits.h, even when not providing the macros. 2013-04-28 19:39:56 +00:00
joerg 89a508fbb5 Systematically include sys/featuretest.h when _NETBSD_SOURCE is used.
Some are redundant, but make verification with grep much easier.
2013-04-27 21:35:24 +00:00
joerg e8c1e0eee9 Include sys/featuretest.h before using _NETBSD_SOURCE. 2013-04-27 21:24:27 +00:00
joerg cce2130bb3 machine/ansi.h is included by sys/ansi.h. 2013-04-27 21:22:05 +00:00
christos c4c409af9e add at_quick_exit and quick_exit 2013-04-26 18:07:43 +00:00
joerg 3be70ab6e0 Define __bool_true_false_are_defined for C++ as well. 2013-04-26 17:41:34 +00:00
joerg cd8f66ed62 Don't pollute the name space with the various stdio macros for C++. 2013-04-26 17:37:06 +00:00
joerg 2e24f90028 Provide the long long routines for C++11 code. 2013-04-26 17:36:24 +00:00
joerg a74df2a38d Do not define the ctype(3) interface via macros for C++. 2013-04-26 17:35:52 +00:00
joerg 49082f1e71 Do not define the C++ alternative operator names as macros. 2013-04-26 10:58:45 +00:00
joerg a4f8ad4bfc Do not define bool/true/false for C++. 2013-04-26 10:58:22 +00:00
joerg e9c87d7728 __BEGIN_DECLS/__END_DECLS 2013-04-21 18:41:32 +00:00
joerg e91cf89069 strftime_l is part of POSIX2008. 2013-04-21 17:54:56 +00:00
joerg 99fac95b50 Store time-specific locale data directly in the locale.
Ad dstrftime_l, strftime_lz and strptime_l.
2013-04-21 17:45:46 +00:00
joerg d1548b5ebd More __BEGIN_DECLS / __END_DECLS wrappers. 2013-04-19 23:45:15 +00:00
joerg 6c5ca8f80c Add missing __BEGIN_DECLS/__END_DECLS. 2013-04-19 23:42:26 +00:00
joerg 9790c07a61 Add scanf_l and wscanf_l families. 2013-04-19 23:32:16 +00:00
joerg e81d3f1ebf Add dummy strcoll_l and strxfrm_l. 2013-04-19 23:28:47 +00:00
joerg 386426dedd If __FLT_EVAL_METHOD__ exists and is in {0,1,2}, provide float_t and
double_t.
2013-04-19 16:40:59 +00:00
joerg 2561b63430 Add explicit locale versions for the printf family. Replace asprintf,
snprintf and sprintf with simple wrappers around the corresponding
va_list functions to reduce code duplication.
2013-04-19 15:22:24 +00:00
joerg 3c1c8515c7 Add MB_CUR_MAX_L. 2013-04-19 14:35:31 +00:00
joerg 10e0e4a06b Add wcscoll_l, wcsxfrm_l, wcsncasecmp_l, wcscasecmp_l, btowc_l,
mbrlen_l, mbsinit_l, mbsrtowcs_l, wcrtomb_l, wcsrtombs_l and wctob_l.
2013-04-18 23:24:26 +00:00
joerg 9a7fa6ff3c Add wcstof_l, wcstod_l and wcstold_l. 2013-04-18 22:23:17 +00:00
joerg ceb51ddcad Add mblen_l, mbstowcs_l, wctomb_l, mbtowc_l and wcstombs_l. 2013-04-18 22:22:20 +00:00
joerg c99aac45e5 Add strtof_l, strtod_l and strtold_l. 2013-04-18 21:54:10 +00:00
joerg 6ffcdd8d70 Add localeconv_l. 2013-04-17 20:40:13 +00:00
joerg 58520523b5 White space 2013-04-17 09:07:32 +00:00
joerg a67fde0356 Add strtol_l and friends. Switch _citrus_bcs_strtol to use plain
strtol_l unless in tools mode. Add note to retire the BCS code on the
next libc major bump.
2013-04-16 21:44:06 +00:00
joerg 444e318434 Add support for wcstoimax_l and friends. 2013-04-16 16:52:13 +00:00
joerg 2eb3224ae9 Also add prototypes for wcwidth_l and wcswidth_l. 2013-04-16 11:55:02 +00:00
joerg b7970e3b60 Add wcwidth_l, wcswidth_l and the wctype.h family of *_l functions. 2013-04-16 11:39:13 +00:00
joerg 4e2459a9e6 Add isalpha_l and friends. 2013-04-16 11:29:12 +00:00
joerg 14b179f1c9 Rename struct _locale_impl_t to struct _locale, since it will end up as
locale_t later.
2013-04-14 23:30:15 +00:00
christos 4ce5b0bd1b PR/47617: Thorsten Brehm: Memory and socket leak in librpc 2013-03-04 17:29:03 +00:00
christos 88d1b254b8 More fixes from J.R. Oldroyd. We introduce a new function that can
retrieve and return if there has been a conversion error, so that
it can keep performing char-by-char processing if a multi-byte
conversion occurred. Also some more code cleanups in the "extra"
processing.
2013-02-20 17:01:15 +00:00
matt aa951aade1 FP_ILOGBNAN should be INT_MAX 2013-02-11 07:29:21 +00:00
matt 05393fd8a6 Define FP_ILOGB0 and FP_ILOGBNAN 2013-02-09 22:56:20 +00:00
matt 6c1355b4ee Add missing long double prototypes. 2013-01-28 23:19:50 +00:00
matt 1ab62a3abe Add missing long double functions 2013-01-28 23:19:28 +00:00
mbalmer eab9b0114a Fix typo. 2013-01-23 17:27:35 +00:00
dholland 196f95b039 Remove #if defined(_KERNEL) around a userlevel function. 2013-01-12 17:17:26 +00:00
christos d37bfd6475 Add VIS_GLOB (Brooks Davis) 2012-12-14 21:36:59 +00:00
skrll 6da0cd6163 Check for _NETBSD_SOURCE being defined wherever we check for
_INCOMPLETE_XOPEN_C063 so that we expose the new POSIX extended API set
recently added.
2012-12-01 13:28:18 +00:00
pooka 169dfff670 revert previous commit since it breaks the build on NetBSD and
apparently that's considered important
2012-11-26 19:53:41 +00:00
pooka 1fedf4b3c8 When including this from a tools build, avoid defining _PWD_H_ since
that macro causes DragonFly's util.h to define conflicting routines.
2012-11-26 17:18:39 +00:00
manu a76c1cc17f Add most system calls for POSIX extended API set, part 2, with test cases:
faccessat(2), fchmodat(2), fchownat(2), fstatat(2), mkdirat(2), mkfifoat(2),
mknodat(2), linkat(2), readlinkat(2), symlinkat(2), renameat(2), unlinkat(2),
utimensat(2), openat(2).

Also implement O_SEARCH for openat(2)

Still missing:
- some flags for openat(2)
- fexecve(2) implementation
2012-11-18 17:41:51 +00:00
christos ed2260d139 use standard queue macros. 2012-11-15 18:49:37 +00:00
christos 48b1b7d23d add <netinet/in.h> because it is needed for sockaddr_in. 2012-11-07 15:45:24 +00:00
christos 8abc3de551 Over the years this header gained a lot of disparate functionality
and willy nilly people kept adding headers appropriate to the new
functionality  So we reached where we are today, this header causes
lots of namespace conflicts (for example you cannot use util.h from
a lex file, because ECHO is macro used in lex, and ECHO is defined
to 8 in termios). Roll back time, and remove all the unnecessary
includes, leaving it to the program to include the ancillary headers
they need.
2012-11-04 23:25:59 +00:00
drochner 5724e77fda Implement experimental support to pass notifications that a file
was deleted from the filesystem to the disk driver, commonly
known as "discard" or "trim".
fs/driver support is in ffs and ata wd for now.
This is what was posted here:
http://mail-index.netbsd.org/tech-kern/2012/02/28/msg012813.html
with minor cleanup, and the global switch replaced by a mount option.
2012-10-19 17:09:06 +00:00
christos 71bbc99990 add clock_nanosleep 2012-10-02 01:42:06 +00:00
christos 9d1644e9da make the default to not check names. 2012-09-09 18:03:17 +00:00
drochner 8588929dc5 Add "consttime_bcmp" and "explicit_bzero" functions for both kernel
abd userland, as proposed on tech-security, with explicit_bzero using
a volatile function pointer as suggested by Alan Barrett.
Both do what the name says. For userland, both are prefixed by "__"
to keep them out of the user namespace.
Change some memset/memcmp uses to the new functions where it makes
sense -- these are just some examples, more to come.
2012-08-30 12:16:48 +00:00
joerg 5e0b44099f SSP mostly works with Clang, even if optimisation is disabled.
Explicitly disable it for Lint though.
2012-08-08 20:23:32 +00:00
yamt 5c3967c0d3 comments 2012-07-30 23:04:42 +00:00
joerg 37a2d02f2e Always provide *_chk prototypes. Fixes DBG=-g build of libc. 2012-07-22 21:05:26 +00:00
darrenr 3ec957d580 bin/46703: BSD r-commands use wrong source address for stderr
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=46703
Bump libc minor for the addition of rresvport_af_addr()
2012-07-14 15:06:26 +00:00
christos 6ddff5efba sprinkle restrict in realpath(3) 2012-06-21 21:13:29 +00:00
joerg 1907ec3a61 Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) to
depend on new devname_r(3) as heart. Add /dev/pts magic directly to
devname(3). While it can lead to returning non-existing paths, the
behavior is more consistent that way. Drop caching layer in devname(3),
it doesn't buy anything for the common case of having access to the
database. Teach devname(3) proper fallback behavior of scanning /dev.
Create both old-style and new-style database for now in /etc/rc.d/sysdb.
2012-06-03 21:42:44 +00:00
joerg f22837c031 Prototype for cdbw_stable_seeder. 2012-06-03 21:21:45 +00:00
christos ba12b0dcec oops, forgot to commit: add tgamma and tgammaf 2012-05-05 22:07:57 +00:00
christos 0bcf0d6f44 PR/46360: YAMAMOTO Takashi: Restore NetBSD-5 compatibility with putenv()
copying the passed string (which is not ToG compliant), instead of using
it directly in the environment arrat as it should. Needs to be pulled up
to NetBSd-6.
2012-04-20 17:31:29 +00:00
joerg 2839b8fcc3 Do not wrap other header files with extern "C". 2012-04-20 16:20:45 +00:00
christos ca5a32edc2 specify size of the array to help -fmudflap 2012-04-18 19:30:15 +00:00
christos e457beb983 new flag. 2012-04-14 01:34:08 +00:00
christos ffed4f27af add more options. 2012-04-13 23:29:14 +00:00
christos 5d7ab7f99c add timeout to getpassfd. 2012-04-13 14:39:49 +00:00
christos 311b90b920 add GETPASS_ECHO_STAR 2012-04-12 23:16:38 +00:00
christos 7def94a8ad add getpassfd 2012-04-12 22:08:02 +00:00
christos eead6b2f0e add getpass_r 2012-04-12 19:36:34 +00:00
christos 8630757097 add getdisk{raw,cooked}name 2012-04-07 16:44:59 +00:00
christos 29484ab26f add getfsspecname 2012-04-07 04:04:21 +00:00
christos 20331437fc make CHAR_{MIN,MAX} work for both -fsigned-char and -funsigned-char 2012-03-28 17:04:41 +00:00
christos 0ed4e38b3f funopen2() 2012-03-27 15:06:01 +00:00
dholland 975bbee604 typo in comment 2012-03-22 03:06:06 +00:00
christos 53cd98be07 Add AI_ADDRCONFIG 2012-03-17 21:57:48 +00:00
christos 1aa0fee779 use __type_fit() instead of locally brewed macro 2012-03-13 21:14:55 +00:00
joerg 4acff4c01b Implement sem_timedwait. 2012-03-08 21:59:24 +00:00
christos 2b01a8ad07 PR/46111: Wolfgang Stukenbrock: Add yp_setbindtries(3) so that yp operations
don't hang forever if requested.
2012-03-02 17:27:48 +00:00
martin 136a5cd515 Use C++ compatible declaration for posix_spawn (instead of the C99 specific
posix one).
2012-02-22 17:51:01 +00:00
martin 74ce3f6bfc Make this include file C++ save, using the new __conly_restrict. 2012-02-21 10:54:07 +00:00
martin 2b8e910c25 Add missing __BEGIN_DECLS, from Henning Petersen in PR misc/46058. 2012-02-20 09:28:43 +00:00
rmind 8dad299218 Remove <sa.h> which has been obsolete since 2007. 2012-02-19 22:32:32 +00:00
joerg 52a4c27e3e Add _dlauxinfo helper function to provide access to the ELF auxilary
vector. This can normally be found via __ps_strings, but libc is
initialised too early when linked dynamically and doesn't have access to
it yet, so provide an alternative mechanism via ld.elf_so.
Bump libc minor.
2012-02-16 23:00:38 +00:00
martin 19f52532ad Add userland part of posix_spawn. Libc functions imported from FreeBSD.
Based on Charles Zhang's summer of code project.
2012-02-11 23:31:22 +00:00
matt a99c34e987 Use __INFINITY in preference to __builtin_inff(). Currently only VAX defines
__INFINITY and allows to use __builtin_huge_valf() instead since gcc4.5 will
error out unconditionally if __builtin_inf() is used.
2012-02-05 17:57:17 +00:00
dholland 7609b9bc56 Migrate one last leftover bit (used only by the kernel now) to
sys/ufs/ufs and remove the old quota headers and no-longer-used shared
code. Ok by releng.
2012-02-05 14:19:02 +00:00
dholland 832d4ca72b Be consistent about whether idtype and objtype codes are signed or
unsigned. They are signed. (While unsigned might have been a better
choice, it doesn't really matter and the majority of preexisting uses
were signed. And consistency is good.)
2012-02-01 05:46:45 +00:00
dholland 5f0d2c5f55 Add quota_quotaon() and quota_quotaoff(). Use them in quotaon(8). 2012-01-30 16:45:13 +00:00
dholland f6b247aa3b Add quota_getrestrictions() to report the semantic restrictions
associated with a particular quotahandle.
2012-01-30 16:44:08 +00:00
dholland d87a2031f8 Per the FS-independent schema, get one quotaval at a time from the
filesystem, instead of blocks and files together.

This results in fetching each FS-level quota entry twice and therefore
doing slightly more work, but (1) quota access isn't a critical path
and (2) after fetching the block values the file values will be hot in
the cache, so it won't add much total time.

Also move more of the FS-independent defintions from <quota.h> to
<sys/quota.h> so we can use them internally.

Step 4 of 5 for QUOTACTL_GET.

Note: this change requires a kernel version bump.
2012-01-29 06:40:57 +00:00
dholland 1d762ff060 Move second-layer proplib frobbing within ufs quota code up to the
first layer. (Step 2 of several for QUOTACTL_GET.)
2012-01-29 06:38:23 +00:00
christos 1897181a72 From tnozaki@: make fpos_t a complex object that keeps track of the parse
state of the stream. Change argument of the seek function to funopen() from
fpos_t to off_t. Make f{g,s}etpos() use the new fpos_t struct, while providing
backwards compatible entry points. Approved by releng@
2012-01-22 18:36:14 +00:00
dholland 0d7dfe62fa Add <quota.h> with the new libquota API.
This is the user/application API and does not include the kernel
interface. Definitions shared with the kernel are found in
<sys/quota.h>.

Since I've been working on a local branch I have taken the liberty of
moving the latest-so-far version of <quota.h> to the front of the
patch queue. This loses (a small amount of) history but has the
advantage of avoiding unnecessary version bumps of libquota.so.
2012-01-09 15:19:44 +00:00
christos 423a6f5ef0 strspct 2012-01-07 18:41:14 +00:00
christos 80b0f3a562 getfstypename addition 2011-11-13 21:57:14 +00:00
joerg 0b50389a15 Add __returns_twice for the attribute of the same name. This makes the
attribute explicit based on the functions GCC gives it too.
2011-11-05 09:27:06 +00:00
christos d69c1b55d9 Fix pthreads variables:
- Add missing stuff from Issue 6 (some of it commented out)
- Fix _POSIX_THREAD -> PTHREAD variable confusion
- Amend PTHREAD_KEYS_MAX to 256 since this is what libpthread defined internally
2011-10-06 16:02:52 +00:00
jruoho be8b5eb28c Define _PATH_CPUCTL. 2011-09-27 11:24:20 +00:00
christos 711f328e6e add re-entrant versions of the hash api based on the GNU extensions. 2011-09-14 23:34:26 +00:00
christos ea9367e3e4 add kvm_getkernelname() 2011-09-12 21:14:29 +00:00
plunky 76be87e1ac provide a complete prototype for xdrproc_t
(I found no instances where three arguments were actually
used, as per the claim in the comment. If there are any
in third party code then they will need to use a cast)
2011-08-30 17:09:51 +00:00
plunky 87d4f6076b Apply casts to cases where xdrproc_t is expected but is not
strictly passed, for example because the second argument is
a different kind of pointer.
2011-08-30 17:06:20 +00:00
bouyer a47e2eb758 Add getlabelusesmbr(), as proposed in
http://mail-index.netbsd.org/tech-userlevel/2011/08/25/msg005404.html
This is used by disk tools such as disklabel(8) to dynamically decide is
the undelyling platform uses a disklabel-in-mbr-partition or not
(instead of using a compile-time list of ports).
getlabelusesmbr() reads the sysctl kern.labelusesmbr, takes its value from the
machdep #define LABELUSESMBR.
For evbmips, make LABELUSESMBR 1 if the platform uses pmon
as bootloader, and 0 (the previous value) otherwise.
2011-08-30 12:39:49 +00:00
elric 95bd2d4a1e Remove crypto/dist/heimdal and its associated build infrastructure as
it has been replaced by crypto/external/bsd/heimdal.
2011-08-28 16:21:57 +00:00
christos b8788050c4 prototype for strpct 2011-08-28 07:46:13 +00:00
dyoung 9943264696 Build and install ppath(3), property-list paths library. 2011-08-26 21:22:07 +00:00
joerg ed20f4b6ec pw_error is documented to be dead 2011-08-26 01:48:39 +00:00
joerg be47d2fc97 __assert and __assert13 are dead 2011-08-26 01:10:49 +00:00
dholland 112cae6f8e Don't pollute the namespace with stdint.h. (This file is included from
string.h so it can't blithely do whatever it feels like.) PR 45258.
2011-08-22 01:24:15 +00:00
manu 2a4490f2fd Add macros to hide OpenGroup extened API set 2 from GNU configure. This
is a temporary  workaround until the implementation is completed.
2011-08-16 07:55:29 +00:00
manu 9db30be448 First stage of support for Extended API set 2. Most of the think is
unimplemented, except enough of linkat(2) to hardlink to a symlink.

Everything new in headers is guarded #ifdef _INCOMPLETE_XOPEN_C063 since
some software (e.g.: xcvs in our own tree) will assume they can use openat(2)
when AT_FDCWD is defined. _INCOMPLETE_XOPEN_C063 will go away once support
will be completed.
2011-08-08 12:08:52 +00:00
joerg 5ccaf4b804 Add ilogbl(3). 2011-07-28 22:32:28 +00:00
joerg afda0f82d1 Add scalbnl to libm. 2011-07-26 16:10:15 +00:00
joerg 3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
manu 319b6ef0ee Import xdr_sizeof() from FreeBSD 2011-07-04 07:54:38 +00:00
christos e2bebf7172 * Arrange for interfaces that create new file descriptors to be able to
set close-on-exec on creation (http://udrepper.livejournal.com/20407.html).

    - Add F_DUPFD_CLOEXEC to fcntl(2).
    - Add MSG_CMSG_CLOEXEC to recvmsg(2) for unix file descriptor passing.
    - Add dup3(2) syscall with a flags argument for O_CLOEXEC, O_NONBLOCK.
    - Add pipe2(2) syscall with a flags argument for O_CLOEXEC, O_NONBLOCK.
    - Add flags SOCK_CLOEXEC, SOCK_NONBLOCK to the socket type parameter
      for socket(2) and socketpair(2).
    - Add new paccept(2) syscall that takes an additional sigset_t to alter
      the sigmask temporarily and a flags argument to set SOCK_CLOEXEC,
      SOCK_NONBLOCK.
    - Add new mode character 'e' to fopen(3) and popen(3) to open pipes
      and file descriptors for close on exec.
    - Add new kqueue1(2) syscall with a new flags argument to open the
      kqueue file descriptor with O_CLOEXEC, O_NONBLOCK.

* Fix the system calls that take socklen_t arguments to actually do so.

* Don't include userland header files (signal.h) from system header files
  (rump_syscallargs.h).

* Bump libc version for the new syscalls.
2011-06-26 16:42:39 +00:00
nonaka c52f9a5df2 PR/45015: ld.elf_so: support ELF symbol versioning
Applied latest patch.
2011-06-25 05:45:10 +00:00
manu 448e1c49b2 Add mount -o extattr option to enable extended attributs (corrently only
for UFS1).
Remove kernel option for EA backing store autocreation and do it by
default. Add a sysctl so that autocreated attriutr size can be modified.
2011-06-17 14:23:50 +00:00
nakayama 88e42b609b Add fenv support for sparc. Mostly copied from sparc64 and share with it. 2011-05-20 21:42:48 +00:00
martin 3f0fc12d5a Actually test for sparc v9 architecture, doesn't matter if we are building
32bit or 64bit (fixes 32bit compat library build on sparc64 - yes, they
differ from native sparc libs!)
2011-05-16 14:50:36 +00:00
he 1fd8e2619a The support of <fenv.h> is actually for __sparc64__, not for __sparc__
(which is also defined on sparc64).  This fixes a build problem for
plain sparc.
2011-05-16 07:59:18 +00:00
mrg be06c07b98 finish the ieeefp.h vs fp_prec_t hack from the previous change and
don't try to define a type when "fp_prec" isn't defined.

this lets my non-x86 (and i presume non-m68k) builds pass again.
2011-03-27 05:13:15 +00:00
christos 2587e6e437 add fpgetprec/fpsetprec 2011-03-26 19:51:41 +00:00
bouyer d9210c2405 Add a new libquota library, which contains some blocks to build and/or
parse quota plists; as well as a getfsquota() function to retrieve quotas
for a single id from a single filesystem (whatever filesystem this is:
a local quota-enabled fs or NFS). This is build on functions getufsquota()
(for local filesystems with UFS-like quotas) and getnfsquota();
which are also available to userland programs.
move functions from quota2_subr.c to libquota or libprop as appropriate,
and ajust in-tree quota tools.
move some declarations from kernel headers to either sys/quota.h or
quota/quota.h as appropriate. ufs/ufs/quota.h still installed because
it's needed by other installed ufs headers.
ufs/ufs/quota1.h still installed as a quick&dirty way to get a code
using the old quotactl() to compile (just include ufs/ufs/quota1.h instead of
ufs/ufs/quota.h - old code won't compile without this change and this is
on purpose).
Discussed on tech-kern@ and tech-net@ (long thread, but not much about
libquota itself ...)
2011-03-24 17:05:39 +00:00
christos a66aa579a5 remove commaize_number. 2011-03-16 00:48:34 +00:00
pooka bfbab30192 put in a proto for commaize_number()
(nb. doing this purely as the minimum work solution to get a working build)
2011-03-15 12:21:08 +00:00
christos 2d8f83e77b Fix various vis/unvis issues:
- no need for all the weak symbols
- define a new _VIS_END flag for UNVIS_END so that there are no collisions
  between and vis and unvis flags.
- add bound versions of the vis and unvis functions that take the length of
  the destination buffer. Unlike the OpenBSD ones they return -1 or NULL if
  the buffer is not large enough, instead of silently truncating.
2011-03-12 19:52:45 +00:00
joerg 4bf46019d9 Redo the SSP wrappers to be transparent on the resulting object files.
This works by having the inline wrapper calling a second function which
uses renaming to output the correct function name.
2011-02-21 00:40:07 +00:00
christos c22a900646 handle ssp 2011-02-16 19:29:35 +00:00
christos e60f59b973 remquo{,f} from FreeBSD via Stathis Kamperis 2011-02-06 00:44:08 +00:00
christos a52c04784a add arc4random_{buf,uniform}, from OpenBSD. 2011-02-04 22:07:07 +00:00
christos f913257c92 new error. 2011-01-31 04:49:46 +00:00
christos 17b8402a39 fenv support for sparc64 from Stathis Kamperis 2011-01-31 00:19:33 +00:00
christos e6a9e964d2 provide a way to override the weak name. 2011-01-26 18:08:00 +00:00
christos 93fcf9c9a9 fix readlink prototype. 2011-01-26 18:07:44 +00:00
christos 3203d4e972 proved an __ssp_check macro. 2011-01-25 19:13:44 +00:00
christos 2d76e866a6 Use the _sys alias instead of the _ alias as the way to access the baseline
syscall.
2011-01-20 02:58:17 +00:00
christos 416c220c02 Re-do ssp hijacking by defining inline functions and using the weak libc
symbols to do the indirection for unistd.h instead of #define tricks.
Fixes compilation for things that define struct { ssize_t read(int fd, ...); }.
2011-01-19 19:21:29 +00:00
pooka 3bf7a94975 practice alphabet: "g before i except never" etc. 2010-12-29 15:53:57 +00:00
jmcneill b8d8357d86 add /dev/video, /dev/video0 2010-12-25 16:49:08 +00:00
skrll f1d73a2c94 Add support for DF_1_BIND_NOW, DF_1_NODELETE and DF_1_NOOPEN marked
objects, and the RTLD_NODELETE and RTLD_NOLOAD flags to dlopen(3).

Mark libpthread as DF_1_NOOPEN and use it to test the functionality.

Somewhat taken from FreeBSD.

Fixes PR 42029.

OK from christos and joerg.
2010-12-24 12:41:42 +00:00
jruoho 5b557140cd Use __constfunc(3) instead of __attribute__((const)) directly. 2010-12-22 19:47:56 +00:00
jruoho c33b9df9f8 Use __dead instead of __attribute__((__noreturn__)) directly. 2010-12-22 19:43:33 +00:00
christos 5a87b22ec6 Provide a re-entrant and thread-safe set of timezone API's that
don't require locking and can operate on user-specified timezones
as opposed to having to alter the environment to change a timezone.
This work was presented to the tzcode folks and it was generally
accepted, but there seems to be a lot of inertia.
2010-12-16 18:36:47 +00:00
christos fb5fb3142c add VIS_NOESCAPE and VIS_HTTP1866 2010-11-27 19:44:54 +00:00
skrll e6cdac9c4b Implement dl_iterate_phdr.
Somewhat taken from FreeBSD. Manual page from OpenBSD.
2010-10-16 10:27:06 +00:00
skrll 9c4f0f800b Move a comment so that it is correct. 2010-10-14 07:51:21 +00:00
christos 7acc3301d8 make putenv POSIX compliant. 2010-10-01 20:11:32 +00:00
yamt ab5972b02c fix rewinddir on nfs. fix PR/42879 (and probably PR/40229.) 2010-09-26 02:26:59 +00:00
tnozaki 93b7363c93 add fmemopen(3) derrived from POSIX:2008.
libc minor bump.
2010-09-24 09:21:53 +00:00
christos e2a86dd3c7 Commit SoC long double support from Stathis Kamperis 2010-09-15 16:11:28 +00:00
christos 748dbd74c6 Add dprintf and vdprintf. XXX: Might ifdef it if too many things break. 2010-09-06 14:52:26 +00:00
christos 7949642c16 add globstar. 2010-09-06 14:38:56 +00:00
enami 8713952936 Move prototype of isrmt() to rmt.h. It is a public interface
described in rmtops(3).
2010-08-31 05:12:35 +00:00
christos 6a4804166f The signal number argument in psignal is int not unsigned int.
Add psiginfo.
2010-08-27 08:40:38 +00:00
joerg 162d6d7dbb Missing defined. 2010-08-02 17:49:04 +00:00
joerg 7f1183f226 Add support for fenv.h interface for i386 and amd64.
Submitted by Stathis Kamperis as part of GSoC 2010 and ported from
FreeBSD.
2010-07-31 21:47:52 +00:00
joerg 44b309378f Define a new __c99inline macro for compilers known to implement the C99
behavior.  This unbreaks GCC 4.4's libgfortran build with the old
signal.h logic, because GCC decided to put the body for the sigsetop
functions in multiple objects.
2010-07-31 00:04:42 +00:00
tnozaki 9efec5bce3 1. MB_LEN_MAX switch MD to MI.
2. unfortunately hppa's MB_LEN_MAX is defined incorrectly 6 instead of 32
   so we have to add more setlocale(3) __RENAME func, __setlocale50.
3. move setlocale1.c and setlocale32.c to lib/libc/compat/locale/*
   prepareing for next libc major crunk.
4. bump libc minor version.
2010-06-07 13:52:28 +00:00
tnozaki 9a35d7972b more split ctype.h -> sys/ctype_inline.h, sys/ctype_bits.h 2010-06-01 13:52:07 +00:00
plunky bdbcfb0d2d later versions of pcc may define __GNUC__ for compatibility reasons, so
having a system definition for alloca is counter productive as it seems
fairly common to use

    #ifdef __GNUC__
    #define alloca ..
    #endif

in user-headers (eg see usr.sbin/gspa/gspa/gspa_ass.h)

So, defang this definition as we don't otherwise provide alloca on NetBSD
2010-06-01 08:42:56 +00:00
tnozaki 64a7d4fa9a 1. hide _CTYPE_PRIVATE section in ctype.h, move them to private header ctype_local.h.
2. do not use _CTYPE_NUM_CHARS macro to read data from LC_CTYPE(old BSDCTYPE style) database.
   because 1<<CHAR_BIT is MD, so i added MI macro _CTYPE_CACHE_SIZE(1<<8).
3. remove _NB_CACHED_RUNE macro, use _CTYPE_CACHE_SIZE instead.
2010-05-22 06:38:15 +00:00