Commit Graph

1384 Commits

Author SHA1 Message Date
christos bb83e0e3c9 change size_t to ssize_t for POSIX compliance. 2010-04-17 17:51:47 +00:00
christos 244f534022 PR/43172: Jukka Ruohonen: swab(3) lacks restrict-keyword 2010-04-17 17:48:34 +00:00
tnozaki 377cb4e4f9 1. {wctype,wctrans,mbstate}_t: switch MD to MI like other
libc implementation (such as *BSD and glibc2).

2. don't typedef void * wc{type,trans}_t, suggested by soda@-san.
   it may pass through compiler type check, it's harmful.
   so i introduce dummy struct __tag_wc{type,trans}_t(iconv_t already does).

no ABI change was made.
2010-03-27 22:14:09 +00:00
joerg 8a601553bc Consistently use __printflike and __scanflike. 2010-02-25 18:37:12 +00:00
joerg 839c0958b5 PR 36988: ISO C99 mandates that HUGE_VAL, HUGE_VALF, HUGE_VALL and
INFINITY are constant expressions.

Use the GCC builtins if possible to implement them.
2010-02-23 00:03:09 +00:00
roy 588d0cb499 getent cannot report on termcap as we now use terminfo. 2010-02-03 18:11:18 +00:00
roy 98eb889579 Userland now builds and uses terminfo instead of termcap.
OK: core@, jdc@
2010-02-03 15:34:37 +00:00
drochner 7033707525 retire pw_policy(3) -- it is not found useful, there are other
(more common) ways to enforce a password strength policy
approved by elad
2010-01-27 19:10:30 +00:00
christos ebd419f208 vasnprintf and asnprintf were never compiled in our libroken.a and never
used by heimdal programs. Remove the false advertising here that broke
the cygwin build.
2010-01-25 00:26:04 +00:00
christos 6439b76ce2 make the window size function return the lines and columns variables separately
instead of depending on the existance of struct winsize. Technically I should
bump the library version or version the symbol, but nothing seems to use this
outside the library!
2010-01-24 16:45:57 +00:00
joerg 00711901b6 Use a proper char */size_t pair in __sfileext to keep track of the line
buffer for fgetln and fgetwln. Simplifies code by dropping the INT_MAX
related logic. Drop conditionals around FREELB, free(NULL) is valid.
2010-01-11 20:39:29 +00:00
christos 5f7c431ef4 Add exp2 and exp2m 2010-01-11 16:28:39 +00:00
skrll c6ed7679c0 Typo in comment. 2010-01-07 07:35:35 +00:00
pooka 8245a2442d +_PATH_PUD 2009-12-22 14:24:37 +00:00
drochner 750e2babfe add some prototypes for checked string functions 2009-11-17 20:47:59 +00:00
christos db576bf322 Don't define wchar_t for c++; it is native in the language. From Alexander
Nasonov
2009-11-15 22:21:03 +00:00
pooka 5f6806f45c typedef struct link_map as Link_map (for solaris-compat) 2009-11-04 19:28:03 +00:00
christos 7523d42dda expose res_check for the benefit of mDNS. 2009-10-24 17:23:34 +00:00
snj 550147bd6a Remove 3rd and 4th clauses in christos' license. OK christos. 2009-10-21 01:07:44 +00:00
pooka 363b14551a In a furious blaze of *facepalm* / "what was i thinking?", fix the
open routine function pointer prototype of opendisk1() to match
the prototype of open().
2009-10-13 22:00:31 +00:00
christos 1799d3c97a oops forgot to commit that one--- Add f{dim,min,max}{,l,f} 2009-10-04 22:59:25 +00:00
tsarna 1f4f234ea9 Introduce allocaddrinfo(3) to make writing getaddrinfo() nss plugins easier.
Discussed on tech-net.
2009-10-02 02:45:28 +00:00
pooka 4c1e54d82b Add Solarisa-like dlinfo() interface to the ELF dynamic linker.
Implement RTLD_DI_LINKMAP which returns a pointer to the linkmap
chain at the given object.  Other Solaris queries are currently
unimplemented.
2009-09-24 21:21:33 +00:00
pooka aaaf93f1d4 Add opendisk1(), which functions like opendisk(), but takes a function
pointer to the routine to be used for open().
2009-09-08 21:34:57 +00:00
he 6218a6dafa Introduce a new accessor macro N_NAME() to access the n_name field
in struct nlist, since it's accessed differently depending on
whether we do a.out or not.  Use this macro as appropriate in the
nlist* functions.
Also replace some includes of <a.out.h> with <nlist.h>, to fix build
problem for mips.
2009-08-21 08:42:02 +00:00
yamt a5ad33a8d7 include <stdint.h> instead of <sys/types.h>.
the latter pulls FD_SET etc and it makes wine-1.1.27's winsock vs unixsocket
namespace dance unhappy.  for more information, grep
	Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
in their source.
2009-08-19 04:22:53 +00:00
christos f227975929 Version fts one more time! This is the most versioned API ever... Bump
fts_level from short to int to avoid a potential DoS.
From Maksymilian Arciemowicz
2009-08-16 19:33:38 +00:00
pgoyette f6f3b4be8a Repair more fallout from the exec_aout.h change.
No guarantee that these are the "right" things to do, but they do allow
building of port-amd64 again.
2009-08-16 17:12:47 +00:00
matt 21d93aff03 Allow <machine/setjmp.h> to override the type using in jmpbuf. 2009-08-12 04:57:36 +00:00
kleink 9be4603670 Declare strsignal(3) in <string.h>, per POSIX-2008, and adjust
documentation accordingly.

Fixes PR standards/41325 from Perry E. Metzger.
2009-07-22 19:48:27 +00:00
drochner d493d48c2e add a "public domain" note (there is nothing creative justifying a
long license)
2009-07-22 15:09:57 +00:00
joerg ebf8c87cf8 Some parts of gcc fail with the direct include of sys/inttypes.h, so
fall back to using sys/types.h like stdlib.h does.
2009-07-21 16:27:54 +00:00
joerg 0578c2ad0f Move popcount et al to src/common and add popcount32/popcount64.
Requested by rmind@. MD should now override popcount32/popcount64 and
provide the aliases as fitting.
2009-07-21 14:55:32 +00:00
joerg 974b291a6c Add popcount(3) and the long and long long version. Name is inspired by
gnulib, the implementation goes back to the AMD Software Optimizer
guide. A number of platforms will want to replace the C version with
assembler code using native instructions.
2009-07-21 13:18:43 +00:00
joerg d6e219476b Add a fast, platform independent hash function to libc.
The algorithm used is the Jenkins hash.  The name (mi_vector_hash)
reflects the nature of the hash function.
Add glue for libc ATF tests and include a test case to make sure that
(mis)alignment and endianess are handled correctly.

Bump libc minor to 169.
2009-07-20 17:03:36 +00:00
roy d4a3cf6a5a Add implementations for getdelim(3) and getline(3). 2009-07-13 22:19:24 +00:00
ginsbach c8da0e5fef Add the getdate(3) function and getdate_err value, conforming to IEEE
Std 1003.1 (``POSIX.1'') and the Open Group Base Specifications X/Open
System Interfaces extension (``XSI'').
2009-05-14 02:37:35 +00:00
pgoyette 28469fc250 Implement snprintb_m(3) to provide multi-line bit/bit-field decode.
Discussed on tech-kern.
2009-05-13 02:50:31 +00:00
perry b1606298a5 note that we have strsignal but it is in the wrong include file. 2009-05-01 20:01:23 +00:00
perry bdb0c5fb32 Add prototypes for stpcpy, stpncpy, strnlen, added in the latest POSIX.
Implementations in libc to follow.

For POSIX compliance, we are still missing:

strcoll_l
strerror_l
strsignal
strxfrm_l
2009-05-01 17:16:49 +00:00
christos 2cca8c559f Bring back binary compatibility with the previous version of the resolver.
There was no room to allocate 16 bytes for _rnd in the struct in the _LP64
case, so we dynamically allocate now. Also put the _rnd field last, so that
we are bitwise compatible too. Now of course we've run out of space, so
next time will need to perform more evil tricks to fit.
2009-04-20 14:42:12 +00:00
christos 178edc61d9 merge libbind 2009-04-12 17:07:33 +00:00
christos 84e3ca2d14 add memrchr 2009-04-10 23:00:52 +00:00
christos 1ef020be5f add glob_pattern_p for glibc because cvs needs it and it is a huge mess
to compile in the gnu glob code.
2009-04-08 16:28:50 +00:00
uebayasi 4a378cffe7 Revert previous since it was just wrong. 2009-03-19 08:04:38 +00:00
uebayasi fe4f9942ce void f(void (*g)()); -> void f(void (*g)(void)); 2009-03-19 05:31:26 +00:00
christos 2c266c8a4c version alphasort. 2009-02-24 18:41:40 +00:00
martin c79c3eed1d Make NAN a compile time constant (with help from the compiler). Suggested
by krister. Fixes PR 40695.
Make references to the old construct (which we can't remove for binary
compatibility reasons) emit a linker warning.
2009-02-22 01:34:01 +00:00
christos bb0dd61478 Add RFC 2045 MIME Quoted-Printable support. 2009-02-10 23:06:31 +00:00
drochner ad965be01b cleanup after devmajor_t:
-since getdevmajor(3) is now binary compatible again with <=5.0
 there is no need to rename, I've just left a __getdevmajor50 symbol
 temporarily for those who track -current
-update manpage
2009-01-20 20:08:12 +00:00
drochner d767912be3 Change major()/minor() to return 32-bit types again, called
devmajor_t/devminor_t, as proposed on tech-kern.
This avoids 64-bit arithmetics and 64-bit printf formats in parts
of the kernel where it is not really useful, and helps clarity.
2009-01-20 18:20:47 +00:00
christos d5c47e0e14 fix reversed test from Tobias Nygren. 2009-01-13 15:11:09 +00:00
pooka f719976d8d Add MOPT_RUMP to STDOPTS so it will be correctly ignored by everyone
else apart from /sbin/mount.
(missed this portion of the file yesterday.  it was in the wrong tree)
2009-01-12 18:14:20 +00:00
pooka 694167d28f Support mount -o rump, which uses the rump server instead of using
the kernel service.  E.g. "mount -t efs -o rump /dev/sgidev /mnt"
runs effectively "rump_efs /dev/sgidev /mnt".
2009-01-11 20:39:34 +00:00
christos 7fc37d6329 don't do size computations because g++ does not like it. 2009-01-11 19:09:29 +00:00
christos 50728e7823 merge christos-time_t 2009-01-11 02:57:17 +00:00
lukem 4a94e73441 Change the second argument of getlogin_r() from int to size_t, per POSIX. 2009-01-06 11:16:46 +00:00
tnozaki 52ed7b035f Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES} db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).

[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
  new locale-db implementation using citrus_db backend,
  see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
  internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].

[tools]
- mklocale(1): add new option ``-t'' that generates new style
  LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().

[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
    en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
    zh_CN.eucCN -> zh_CN.GB18030
    and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
  for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
  i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<

old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
2009-01-02 00:20:18 +00:00
hannken 7586bc881e Make restore work for Linux dump volumes by ignoring extended attribute
records on these volumes.  Tested with Centos 5.2.

Reviewed by: Manuel Bouyer <bouyer@netbsd.org>
2008-12-26 19:26:04 +00:00
ad 117c67b2f2 Add fdopendir(), from Solaris/Linux. 2008-12-05 13:08:53 +00:00
christos 3e6c484639 include <sys/null.h> because _DIAGASSERT(foo == NULL) is too common and some
include it.
2008-11-02 14:27:44 +00:00
rmind 9b24696c04 Add sched_getaffinity_np() and sched_setaffinity_np() wrappers, mainly
for compatibility purposes.
2008-10-31 00:29:19 +00:00
matt 99a8c5ca1c Add the C99 header <tgmath.h> (Type-generic math.h)
Until IEEE libm support *l (long double) we can't install it.
2008-09-28 14:57:41 +00:00
lukem e2a43ad977 Support RESCUEDIR for _PATH_VI.
Fixes /rescue/disklabel -e
2008-09-28 06:38:02 +00:00
christos 9fa41d7348 add missing attributes to the remaining calls, even the ones that gcc has
builtin attributes for (for symmetry and consistency). In the future this
might change to use compiler-neutral macros. On the other hand I don't
know of any other compiler that provides other macros with similar
functionality, so why bother?
2008-09-21 16:59:46 +00:00
christos 6bedd5c51d PR/39534: Henning Petersen: Typo = instead of / to close comment. 2008-09-13 17:05:07 +00:00
gmcgarry 9bdea3498f Don't define __RCSID() here, since sys/cdefs.h does it later. Avoids
re-definition error.
2008-08-29 00:39:30 +00:00
christos e9d445137d Make _POSIX_TZNAME_MAX=6 per SUSv3, from Andy Shevchenko 2008-08-27 08:53:55 +00:00
joerg 40b37a3bf2 Convert db from UCB types to POSIX types. Prefer uint8_t for u_char as
it is mostly about the wire format.

Patched libc.so is bit-identical.

OK matt@
2008-08-26 21:18:38 +00:00
gmcgarry ff2c02da97 Define away __assert_function__ if __lint__. 2008-08-17 00:24:35 +00:00
matt 358dc24349 Add C99 imaxabs and imaxdiv protoypes and imaxdiv_t typedef. 2008-08-04 21:19:45 +00:00
matt e90b08472f Add _POSIX_HOST_NAME_MAX and _POSIX_SYMLOOP_MAX to <limits.h> and add some
references to them in <sys/param.h>
in <stdio.h> also export v*scanf when _ISOC99_SOURCE is defined

From andy dot shevchenko at gmail dot com.
2008-08-04 17:08:49 +00:00
simonb 36d65f1138 Merge the simonb-wapbl branch. From the original branch commit:
Add Wasabi System's WAPBL (Write Ahead Physical Block Logging)
   journaling code.  Originally written by Darrin B. Jewell while
   at Wasabi and updated to -current by Antti Kantee, Andy Doran,
   Greg Oster and Simon Burge.

OK'd by core@, releng@.
2008-07-31 05:38:04 +00:00
ad f778b05135 SUS says that pthread_atfork() must also be in unistd.h 2008-06-25 11:45:38 +00:00
ad 5f64faa3a9 Add getlogin_r. Manual page changes mostly lifted from FreeBSD. 2008-06-25 11:10:24 +00:00
christos bee541c300 restore correct symbol protection and add a comment so that I don't
break this again.
2008-06-21 20:24:40 +00:00
christos a0abbe8fe8 sync with bind-9-5-0 2008-06-21 20:12:49 +00:00
gmcgarry 79ae39b7d3 Use __builtin_alloc() with pcc. 2008-06-21 00:58:00 +00:00
rmind 0d04498ec8 Remove few no longer relevant comments. 2008-06-15 21:38:08 +00:00
ad 032b92980a /usr/include/atomic.h, for Solaris source compat. 2008-05-28 12:28:12 +00:00
rmind 06171502fc Adjust and thus unify my license. 2008-05-26 17:45:51 +00:00
christos 221cf0b076 remove the const again - per core. 2008-05-10 22:37:42 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
christos bd1ba72f92 make name const. 2008-04-25 21:20:57 +00:00
plunky 043900c0cb constify dirname(3) and basename(3) 2008-04-23 07:53:26 +00:00
plunky f983e71d70 constify uuid(3) 2008-04-23 07:52:32 +00:00
plunky 7c883dd79e HAVE_IPV6 is defined by libkrb5/Makefile when USE_INET6 != "no" 2008-04-21 18:31:17 +00:00
yamt e3372d31c3 RANDOM_MAX: don't rely on integer overflow. 2008-04-07 12:24:52 +00:00
drochner 7cc98087b6 everyone else assumes that defining "_XOPEN_SOURCE" means XPG4.2,
so remove comparisions against the numerical values "3" or "4"
2008-04-01 19:23:28 +00:00
mlelstv 61c7bde65a Heimdal on NetBSD uses __RCSID. 2008-03-22 12:43:47 +00:00
mlelstv b0f88a0388 Import Heimdal-1.1 2008-03-22 08:36:48 +00:00
christos 749de7f2a4 Since _file is a short, check that the fd fits in it, otherwise bail with
EMFILE. We treat _file as an unsigned short to double our range, with a
special case for -1 (closed). Make a note of what we should do about stdio
if we ever bump libc. We could change _file in the future compatibly to an
int by putting it in the extension space but for now we don't bother.
2008-03-13 15:40:00 +00:00
lukem c293dd6128 Use "unsigned foo" instead of "u_foo".
Be consistent with tabs.
2008-03-07 10:38:31 +00:00
dholland 65900038ce Add a comment noting that the definition of __errno is now replicated in
signal.h. Per request of joerg@
2008-03-03 06:57:48 +00:00
christos c75e135b85 add RANDOM_MAX define from anon ymous 2008-02-28 16:13:35 +00:00
dholland 933ac46844 signal.h is not supposed to define errno, so use ___errno instead.
Adjust errno.h in a compatible fashion to avoid -Wredundant-decls issues.
I have run a build to check the tree for places where errno.h is missing,
and fixed the cases I found, but there might be more in MD code.
2008-02-24 23:01:19 +00:00
christos 5b9284aa07 GLOB_NO_DOTDIRS patch from mouse@
Fixes re-definition of GLOB_PERIOD.
2008-02-22 18:33:51 +00:00
matt 80d082b8df Change/fix tsptype to const char * const []; 2008-02-16 07:30:15 +00:00
christos b11674e1a4 move gettytab to paths.h 2008-02-04 15:27:20 +00:00
christos 0d149bc5fe Add csetexpandtc() 2008-02-02 20:56:46 +00:00