Commit Graph

1408 Commits

Author SHA1 Message Date
kristerw 1ef79ebc7d Do not include SSP files unless _FORTIFY_SOURCE > 0. 2007-08-02 21:49:09 +00:00
pooka b50bf77666 _PATH_PUFFS 2007-07-17 10:14:33 +00:00
pooka 060d8639e3 add estrndup() 2007-07-01 21:41:16 +00:00
rmind 597004aa18 Fix the C99 restrict keyword with array defintion in prototype problem.
http://mail-index.netbsd.org/tech-userlevel/2007/06/17/0004.html
Closes PR/36451.
2007-06-30 16:36:35 +00:00
christos 2b3b97e3ff - Misc cleanups to make the code more readable.
- Detect if we are compiling in libc and provide the appropriate name.
2007-06-03 17:41:19 +00:00
tls dc99372be9 Match usage of FORTIFY_SOURCE on other platforms by not requiring special
include path: the normal header files now include the "SSP" ones (which one
should note are not really named right: SSP and FORTIFY_SOURCE are independent
features).

Disable USE_SSP on targets where the compiler doesn't support it at all
(mips, alpha) or it's known broken (sh3).  But enable FORTIFY_SOURCE,
without SSP, on those platforms -- tested on mipsel.
2007-05-30 21:14:35 +00:00
tls 2368dc663d Move FORTIFY_SOURCE implementation from the somewhat ill-named "libssp"
(what other systems keep in libssp, we already have in libc) into libc
to match what other systems with FORTIFY_SOURCE do.  Goodbye, libssp
dependency in libraries and executables.  Discussed with christos and
mrg; Christos will merge the headers to get us the rest of the way to a
FORTIFY_SOURCE implementation that works as others' code expects.
2007-05-30 01:13:14 +00:00
christos 2f776ce02e Move .db files for services and netgroup to /var/db per gimpy's request. 2007-05-10 17:45:50 +00:00
rmind f867968153 - Add linkage for C++
- KNF

Patch from <ad>, thanks!
2007-05-03 21:22:33 +00:00
rmind 0994dd0691 - Create sysctl nodes for AIO.
- Add POSIX defined system variables and constants of AIO_LISTIO_MAX and
  AIO_MAX values.  Both with _POSIX_ASYNCHRONOUS_IO, provide them in
  sysconf(3) and getconf(1) interfaces.
- Clean up sysconf(3) for handling sysctl nodes dynamically.
2007-05-01 01:01:25 +00:00
rmind 67d703cf25 Import of POSIX Asynchronous I/O.
Seems to be quite stable. Some work still left to do.

Please note, that syscalls are not yet MP-safe, because
of the file and vnode subsystems.

Reviewed by: <tech-kern>, <ad>
2007-04-30 14:44:28 +00:00
ragge 98e922db67 The alloca() arg type check is broken (cpp do not do string comparisions)
so make it marginally less broken so that it works with other compilers
than gcc.
Probably the check can be removed, I doubt anyone will try to use gcc1
anymore.
2007-04-22 08:21:50 +00:00
ghen f0e38187bd Resolve conflicts. 2007-03-30 19:57:16 +00:00
drochner 7161d089aa -get cabs() and cabsf() out of public view - these are historical and
conflict with C99 functions which are builtins in newer gcc
 (actually, the old cabs() is ABI compatible with the new _complex one
  on i386, but this is purely accidental)
 remove public prototypes and manpages, move the code into a compat
 subdirectory as libc does so that binary compatibility is kept
-add a manpage for the isgreater() etc macros, borrowed from FreeBSD
2007-02-22 22:08:17 +00:00
ad f8e00f41e6 Change _lwp_unpark_all() to return a 'ssize_t'. 2007-02-09 22:54:19 +00:00
ad 34eaab26b0 Sync with changes introduced by merging the newlock2 branch. 2007-02-09 22:13:31 +00:00
drochner a981c4eb78 add the isgreater() at al. comparision macros defined in C99 and SUSv3;
use just the primitive macros for now (identical to FreeBSD/DragonFly)
which don't use gcc internals, the rest can go in after some testing;
addresses PR standards/25520
2007-02-06 17:29:37 +00:00
christos fc500ab7fb Add macros for overflow detection 2007-02-03 23:48:21 +00:00
christos a12ac1f620 remove __SAFE 2007-02-02 23:00:53 +00:00
christos b5861ff385 another merge botch. 2007-01-28 01:48:03 +00:00
christos 9567c94af3 Fix merge botch 2007-01-27 22:33:03 +00:00
christos 0d808c59ee Merge back all our changes. 2007-01-27 21:25:23 +00:00
christos 7315c1563a import files from bind-9-4-0-rc2 2007-01-27 19:49:27 +00:00
ad 4fa8fcbfe1 Add: _lwp_kill, _lwp_detach, _lwp_park, lwp_unpark, _lwp_unpark_all. 2007-01-16 01:36:50 +00:00
christos 33d6b113f2 moved string_to_flags and flags_to_string from ls to libutil. 2006-12-14 19:18:01 +00:00
bjh21 2f3712dfa1 defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.
2006-12-09 19:33:42 +00:00
christos 1665d5e960 fix spelling of accommodate; from Zapher. 2006-11-24 19:46:58 +00:00
christos 4ca73ce810 Don't expose _ss functions for 4.0. Requested by core. 2006-11-22 17:23:24 +00:00
christos ab56b9a702 getdate -> parsedate 2006-11-20 20:33:33 +00:00
christos 37568978dc constify getdate 2006-11-17 22:44:40 +00:00
christos ba26b607a4 add getdate. 2006-11-17 22:10:23 +00:00
yamt c59a65e2fe add comments. 2006-11-09 10:04:40 +00:00
mjf a2be0ed655 Revert the changes I introduced trying to solve tmpfs' NFS export problem.
Requested by yamt@
2006-10-31 08:12:46 +00:00
christos 11c53ad61c kill crypto/rmd160.h and crypto/sha2.h, and instead make symlinks to
/usr/include from /usr/include/sys. This makes all the one way hash
header handling identical.
2006-10-30 20:22:53 +00:00
christos 1e468fbf99 - flags should be unsigned short instead of short.
- add __SAFE flag, to indicate that we want async-signal-safe functionality
  only.
- add snprintf_ss, and vsnprintf_ss; these are undocumented on purpose.
2006-10-27 20:03:21 +00:00
mjf 84bd46b9f9 Add support to allow a file system to not permit being exported over NFS.
Approved by elad@ and wrstuden@
2006-10-24 21:53:10 +00:00
christos fb9bdae14a add MOPT_NULL 2006-10-16 03:31:27 +00:00
christos 1d0c670b9c add a NULL callback initializer 2006-10-15 16:10:38 +00:00
christos 3600b1e75a Add run level messages. 2006-09-22 21:31:55 +00:00
christos e72710e561 Add efun(3) 2006-08-26 18:11:12 +00:00
christos 54097ce7af PR/34238: Aleksey Cheusov: add wcsdup, wcscasecmp and wcsncasecmp functions 2006-08-22 20:50:46 +00:00
thorpej b4bbe79968 Use __GNUC_PREREQ__() for the GCC 4 test, too. 2006-08-21 16:58:29 +00:00
christos 93e48bdb1e __offsetof__ is a builtin, so we need __GNU_PREREQ 2006-08-21 15:31:18 +00:00
christos a162f659c6 gcc-3.3 does not have __offsetof__, but gcc-3.4 eems to require it:
From the redhat web page:

http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gcc/offsetof.html

__offsetof__ (expression)
    is equivalent to the parenthesized expression, except that the
    expression is considered an integral constant expression even if
    it contains certain operators that are not normally permitted in
    an integral constant expression. Users should never use __offsetof__
    directly; the only valid use of __offsetof__ is to implement the
    offsetof macro in <stddef.h>.
2006-08-21 15:26:49 +00:00
christos a4f92031c6 g++-4 does not like &0->member, so we have to use the built-in offsetof().
g++-3 does not have a built-in offsetof(), but we cannot use the c version,
      otherwise we break with -Wold-style-cast.
Inspired by the DF version, but a bit different.
2006-08-21 15:02:23 +00:00
skd 21f8ec95d5 Use gcc's builtin function. This permits c++ compiliation of const
expressions using offsetof.  Boost-python relies on this, for example.
2006-08-21 14:09:43 +00:00
christos f4254d2cef Add stresep and strndup. 2006-08-12 23:50:13 +00:00
christos b9c41df004 add services.db 2006-07-27 18:29:01 +00:00
christos 20248fa84b forgot to commit this. 2006-07-27 18:10:45 +00:00
christos a14221d559 fts_number is a quad; bump version. 2006-07-27 15:47:09 +00:00
christos 11d8439430 add sl_delete 2006-07-27 15:37:19 +00:00
christos eadd73deca Centralize the TCP_NODELAY handling as discussed in tech-net. 2006-06-22 19:35:34 +00:00
mrg db19e89e04 remove support for building (with) GCC 2.95. also:
- always install <stdbool.h>
- don't generate a fake one for vax / gettext.
2006-06-02 22:16:18 +00:00
christos 54595e9946 rename dd_rewind to dd_internal so that it can be re-used to implement
telldir/seekdir/rewinddir differently. While there change the prototype
to telldir to take a non-const DIR, per:
http://www.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html
2006-05-17 20:32:19 +00:00
mrg 9f88f12295 add __BEGIN_DECLS/__END_DECLS around snprintf() & vsnprintf() prototypes. 2006-05-10 21:09:45 +00:00
thorpej 66574ac8a6 Install proplib include files. 2006-04-27 23:42:08 +00:00
snj a640fe8c43 It's "its." 2006-04-24 19:00:29 +00:00
salo 2118fde310 Add setttyentpath(), functionally equivalent to setttyent() but takes an
additional argument to read the ttys information from an alternate path
istead of _PATH_TTYS.

Required for upcoming init(8) changes.

Mostly from <apb>.

Bump libc minor.
2006-04-17 23:29:21 +00:00
tnozaki f9de1ba57e add c99 wcstof(3) and wcstold(3).
requested by skrll AT netbsd DOT org, thanks.

bump libc minor 138 -> 139.
2006-04-15 12:17:22 +00:00
mrg 0db1500b43 retire HAVE_GCC3/HAVE_GCC4 and introduce HAVE_GCC that is set to 2, 3 or 4. 2006-04-07 19:38:58 +00:00
christos 8d5214b18a PR/33163: Auster Vl.: fts: cant allocate memory | filename too long
Change the ftp_pathlen and fts_namelen to u_int from u_short so that
pathnames > 32K work.
2006-03-30 01:23:50 +00:00
christos fb11ba2dc5 PR/33124: Murray Armfield: readdir_r is missing a restrict qualifier.
http://www.opengroup.org/onlinepubs/000095399/basedefs/dirent.h.html
2006-03-26 18:22:40 +00:00
christos 3b6811d33b PR/33123: Murray Armfield: standards compliance & glob.h
Certain fields in glob.h need to be size_t; fix this and version glob(3).
    http://www.opengroup.org/onlinepubs/000095399/basedefs/glob.h.html
2006-03-26 18:11:22 +00:00
xtraeme f1336fbda3 Add trunc() and truncf() C99 functions, from FreeBSD. 2006-03-25 16:41:11 +00:00
kleink d66de2df34 Add nan(3), nanf(3), and nanl(3); welcome libm.so.0.4. 2006-03-23 16:55:42 +00:00
kleink bc89c06cbf Add strtof(3) and strtold(3); welcome libc 12.137. 2006-03-15 17:35:17 +00:00
wiz 1ad8067cb3 Fix typos, reported by Alexey Dobriyan ("Gathered from Linux"),
forwarded by jmc@openbsd.
2006-02-25 00:58:34 +00:00
elad cf6eceb4e7 Don't expose struct pw_policy and use pw_policy_t, use malloc, man-page
fixups.

As discussed on source-changes@.

Okay yamt@, thorpej@.
2006-02-18 16:32:45 +00:00
elad f4ce06ccf2 Add the struct pw_policy forgotten in previous commit. 2006-02-18 10:53:33 +00:00
ginsbach e0882f7342 Add EAI_OVERFLOW as specified in RFC3493, POSIX and XPG6. 2006-02-17 15:55:01 +00:00
chs 899d1b31b2 convert "magiclinks" from a per-fs mount option to a system-wide sysctl.
as discussed on tech-kern quite some time ago.
2006-02-12 01:32:06 +00:00
christos 6d2fba90fb remove functions that we should not be exposing. 2006-01-24 19:33:35 +00:00
christos 4787e0f575 PR/32615: Yves-Emmanuel JUTARD: Add missing telopts extern variable. 2006-01-24 17:13:59 +00:00
christos decae1574c PR/32614: Yves-Emmanuel JUTARD: Typing error in some comment ;-) 2006-01-24 17:08:58 +00:00
christos 964e09988d expose unlocked versions of readdir and telldir. 2006-01-24 13:58:58 +00:00
uwe 211efb2fb0 Fix comment indentation after __P was deleted. 2006-01-11 22:50:35 +00:00
kleink 5af00b0b39 pthread_sigmask(): Add restrict qualifier to set, oset args. 2006-01-07 20:10:29 +00:00
agc 740a95c15f Add Todd Miller's ftw(3) and nftw(3) file-tree walking functionality,
from OpenBSD.

Bump libc minor to 136.
2005-12-30 23:07:31 +00:00
yamt 354b4aa135 put back inline to __inline, as it's a user-visible header. 2005-12-28 15:26:06 +00:00
perry e67ad767f5 inline -> __inline for selected things (specifically, the header
file is POSIX visible and the usage isn't #ifdef _KERNEL)

Discussed with core. I may need to go farther than this but for now
compilations done with gcc -ansi (i.e. firefox) will be okay.
2005-12-27 17:21:28 +00:00
perry 5f65228b74 u_intN_t -> uintN_t 2005-12-26 19:01:47 +00:00
perry 971a8b8cc7 __const__ -> const
This is in an __attribute__ so it isn't really necessary, but it gets
it out of the listing of __keyword__s...
2005-12-24 23:04:05 +00:00
perry a2cd732268 Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 19:12:23 +00:00
christos 724f51cbd9 expose setuserpath and setuserenv, now used by xdm. 2005-12-20 21:31:27 +00:00
yamt 347f995cea - constify and remove __UNCONST from caller of clnt_call().
- use __UNCONST where approproate.
2005-12-03 15:16:19 +00:00
christos 1f2f080275 sprinkle __UNCONST 2005-11-29 03:12:58 +00:00
christos 8e7266788d PR/32108: Greg Oster: fpgetmask() linking failure with g++ on macppc
Missing __{BEGIN,END}_DECLS.
2005-11-18 20:02:59 +00:00
kleink 34ef731cb3 Change the sched_*() functions to return -1 and set errno to ENOSYS
(per the standard) instead of returning ENOSYS.  Noted by Ian Zagorskih
in PR kern/30970.
2005-10-09 11:17:28 +00:00
rpaulo 35d2bef12a Add a comment asking to update sysexits(3) when adding more entries. 2005-09-30 20:56:19 +00:00
kleink 21ef7cfd14 Move ttyname_r() to the 1003.1c-1995 section. 2005-09-26 12:52:42 +00:00
kleink ffff20ba60 Move getenv_r() to the local section. 2005-09-26 12:51:34 +00:00
christos 2b46305054 ttyname_r returns int. 2005-09-25 20:28:56 +00:00
christos e86a6cb1b4 Add getenv_r and ttyname_r 2005-09-25 20:08:15 +00:00
xtraeme af4a812af1 Add missing prototype for the MD5FileChunk() function. (hi elad!) 2005-09-25 00:48:21 +00:00
elad b8cc6b61c3 Fix prototype. 2005-09-24 22:08:30 +00:00
elad 8b546d68f7 Define MD2_DIGEST_LENGTH and MD2_DIGEST_STRING_LENGTH.
Noted by xtraeme@.
2005-09-24 21:30:38 +00:00
elad 8c28d108b5 Use new location.
XXX This is left here for backwards compatibility.
2005-09-24 18:35:42 +00:00
christos c4445bc71c rename osockaddr to talkd_sockaddr and use that instead. 2005-09-24 16:40:01 +00:00
drochner ccaf4d6706 use __inline as before, otherwise "gcc -ansi" blows up 2005-09-15 13:44:41 +00:00
christos 9d2cc4eaf5 Fix opendir30 screwup and sort the compat defs for clarity. 2005-09-14 20:20:15 +00:00
elad b86ce3e403 Forgot these when imported pw_policy(3).
Thanks to Hisashi T Fujinaka for noticing.
2005-09-14 15:59:10 +00:00
christos 66412e7240 compat code reorg 2005-09-13 01:44:32 +00:00
christos 99c8f5662d Change ino_t to u_int32_t for compatibility with the current dump/restore
format. Unfortunately this means that all dumps taken from the time of
the 64 bit inode changes (August 16th) will become unreadable with this
commit. To make them readable again, you can back-out this commit temporarily.
Please note, that I am not adding 64 bit inode support to the format on
purpose right now, because supporting 64 bit inodes on-disk will require
additional changes, and it is more appropriate to add such support then.
2005-09-06 17:03:59 +00:00
uwe b2822da5b4 Get rid of the #if !HAVE_NBTOOL_CONFIG_H kludge. None of host tools
uses this header now.
2005-08-27 22:55:54 +00:00
christos 3303764533 64 bit inode changes 2005-08-19 02:04:54 +00:00
christos b43b0b010f Add strerror_r. 2005-07-28 16:26:53 +00:00
christos 1f35645781 Add log2f 2005-07-21 12:56:29 +00:00
christos 76e7e3ea51 Cast large constant to int. 2005-07-16 17:20:12 +00:00
drochner ecef4b3d3f The source array of lsearch() shouldn't be "const".
Being here, cleanup the const castaway stuff.
2005-07-06 15:47:15 +00:00
he 8d673b50bf Add const to the tsptype array, compiled under TSPTYPES.
Found while building for vax.
2005-07-05 21:57:08 +00:00
thorpej 65412a2710 Implement expansion of special "magic" strings in symlinks into
system-specific values.  Submitted by Chris Demetriou in Nov 1995 (!)
in PR kern/1781, modified only slighly by me.

This is enabled on a per-mount basis with the MNT_MAGICLINKS mount
flag.  It can be enabled at mountroot() time by building the kernel
with the ROOTFS_MAGICLINKS option.

The following magic strings are supported by the implementation:

	@machine	value of MACHINE for the system
	@machine_arch	value of MACHINE_ARCH for the system
	@hostname	the system host name, as set with sethostname()
	@domainname	the system domain name, as set with setdomainname()
	@kernel_ident	the kernel config file name
	@osrelease	the releaes number of the OS
	@ostype		the name of the OS (always "NetBSD" for NetBSD)

Example usage:

	mkdir /arch/i386/bin
	mkdir /arch/sparc/bin
	ln -s /arch/@machine_arch/bin /bin
2005-06-23 00:30:28 +00:00
dyoung a37289db57 Make disklabel(8) and fdisk(8) into "host tools " last step: build
and install ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-disklabel,
${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk by "reaching over" to
the sources in ${NETBSDSRCDIR}/sbin/{disklabel fdisk}/.

To avoid clashes with a build-host's header files, especially on
*BSD, the host-tools versions of fdisk and disklabel search for
#includes such as disklabel.h, disklabel_acorn.h, disklabel_gpt.h,
and bootinfo.h in a new #includes namespace, nbinclude/.  That is,
they #include <nbinclude/sys/disklabel.h>, <nbinclude/machine/disklabel.h>,
<nbinclude/sparc64/disklabel.h>, instead of <sys/disklabel.h> and
such.  I have also updated the system headers to #include from
nbinclude/-space when HAVE_NBTOOL_CONFIG_H is #defined.
2005-06-12 19:46:15 +00:00
christos 08cd5f47c8 Add a macro __MKTEMP_OK__ that renames mktemp() to _mktemp() for uses that
have been checked, so that the linker does not warn us. There are valid
uses for mktemp() such as for creating filenames that are going to be
targets of the rename system call. Discussed with lukem.
2005-06-11 22:58:42 +00:00
christos 5b18fe838f PR/30503: Nicolas Joly: swapctl(2) prototype does not match corresponding
syscall
2005-06-11 22:54:43 +00:00
kleink 926eae7f66 Include <sys/ansi.h> after <sys/cdefs.h>; from Neil Booth in PR lib/30072. 2005-05-25 20:45:38 +00:00
kleink 691c56aa2e Belatedly move snprintf() and vnsnprintf() into the XPG4.2/C99 section. 2005-05-25 19:35:07 +00:00
kleink 13034da908 Add restrict qualifiers to fopen()/freopen() arguments. 2005-05-25 16:01:24 +00:00
kleink abf1d9c9d1 Make namespace protection feature tests for reentrant functions more
accurate (and actually less restrictive).
2005-05-24 17:36:29 +00:00
kleink 484c40cd9f Remove the compatibility select() prototype. Going back to Lite2 select(2)
has also mandated <sys/time.h> to be included, which is now sufficient
for the prototype and all related declarations; thus the local duplicate
of the prototype can be removed.  Approved by Christos.
2005-05-22 19:10:15 +00:00
christos cf3e6ebd2b add t_putws 2005-05-15 21:10:52 +00:00
thorpej f2b0a44663 u_short -> uint16_t 2005-05-15 21:01:34 +00:00
dsl 54cc3da266 Make the arg to getnetconfigent const char * to match the man page (and
likely calling code).
2005-05-15 20:54:41 +00:00
christos 75b76923c6 Wide stdio functions. 2005-05-14 23:51:42 +00:00
kleink 9020a25f08 Instead of pulling in all of <wchar.h>, just define wchar_t here.
Addresses PR lib/29987.
2005-04-18 19:47:51 +00:00
kleink 4e3cae58ff Move the (at this time private) get{proto,serv}ent_r() prototypes and
data structures into the libc sources until the interface gets redone.
Approved by christos.
2005-04-18 19:39:45 +00:00
rillig 7f8368c35e Replaced the macro name "notyet" with a 0. There's always the possibility
that a strictly conforming C program uses that name itself, so it had to
be removed. Also put the long comment above the #if 0, because it describes
the #if, not the isblank() macro. Added two blank lines to make the grouping
clear. Approved by kleink.
2005-04-15 23:46:07 +00:00
christos 9f184f48a4 Add no-return attribute to all longjmp flavors. Approved by kleink. 2005-04-15 16:58:13 +00:00
christos ada3b096d0 Add FreeBSD's strfmon(3). From Rui Paulo. No bump this time. Take advantage
of the getpwent_r bump.
2005-04-03 20:09:29 +00:00
christos a4d6d34976 Add getpwent_r, getgrent_r 2005-04-02 04:54:35 +00:00
christos eb808713b7 PR/29826: J. T. Conklin: Add wcsftime(3) (from FreeBSD) 2005-03-30 03:47:11 +00:00
kleink b9a719ae1e Add restrict qualifiers to remaining <signal.h> function arguments. 2005-03-22 20:25:31 +00:00
kleink 98061f1fca * Add restrict qualifiers to tdelete() function arguments.
* Const-poison tfind()'s rootp argument, per SVID Issue 1 and later.
2005-03-22 20:13:42 +00:00
kleink 53b42c4e52 Add restrict qualifiers to getaddrinfo() and getnameinfo() arguments. 2005-03-21 13:30:50 +00:00
kleink d5d8554049 Add restrict qualifiers to dlsym() (XSI) and dladdr() arguments. 2005-03-21 13:25:22 +00:00
kleink f62b22c92b Remove already #if 0'ed getipnode*() prototypes and related definitions;
we are not going to ship those.
2005-03-17 10:16:14 +00:00
perry 93c3898449 Add prototype for memmem(3). It is API compatible with the version in Linux. 2005-03-13 15:09:50 +00:00
kleink 1c7e2b47c4 Provide select() and pselect() prototypes in <sys/select.h>, per
1003.1-2001, and leave the select() prototype in <unistd.h> for
compatibility.  To allow for transition, reorganization of this is
deferred until netbsd-3 gets branched.
2005-03-05 19:48:38 +00:00
dsl d4ffd091c4 Change __aconst to const so I can compile systat and vmstat with WARNS=3 2005-02-26 21:16:35 +00:00
christos 1f09c87798 Add newer constants from FreeBSD and constify. 2005-02-19 21:57:19 +00:00
kleink fd5cb0acea A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
  fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
  uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.
2005-02-09 21:35:46 +00:00
perry fc7ef6c165 remove obsolete register declarations. 2005-02-06 04:41:40 +00:00
perry bbac53bdab Remove "register" from a comment. Kind of silly for it to have been
listed as a parameter for a function anyway...
2005-02-06 04:40:51 +00:00
perry ee5442c7d9 remove obsolete "register" declarations 2005-02-06 04:38:18 +00:00
perry 19b7469a00 de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.
2005-02-03 04:39:32 +00:00
drochner e3842bbd8e Remove the remains of "struct sigcontext" and sigreturn() from the
user visible namespace.
These weren't supported interfaces for a while (it just happened to
work with COMPAT_16 kernels).
There are still internal uses in compat code and as jmp_buf format,
but this is all md code which uses <machine/signal.h>.
with christos' agreement
2005-01-20 20:42:05 +00:00
christos 4f49701cc6 modify footprint of pw_gensalt(). 2005-01-12 03:33:32 +00:00
christos ce097a4b71 add pw_getpwconf() 2005-01-12 03:33:11 +00:00
christos a2bc0c9d37 Add pw_gensalt, remove bcrypt_gensalt. 2005-01-11 22:41:50 +00:00
lukem 1e281ed227 Only #define HAVE_IPV6 if ${USE_INET6} != "no". 2005-01-10 03:11:17 +00:00
lukem a3665ef9cf Implement getgroupmembership(3). This is similar to getgrouplist(3), except
that the "int maxgroups" and "int *ngroups" parameters are separated into
two separate parameters which makes it possible to call multiple nsswitch
back-ends and have the results correctly merged.
getgrouplist(3) is now implemented using getgroupmembership(3).

Proposed on tech-userlevel on December 1, 2004.
2005-01-06 15:10:45 +00:00
christos 0e466f4a8a Provide forward struct declarations for struct sigcontext*; this will allow
us to get rid of them in the machine/signal.h files.
2004-12-31 18:06:16 +00:00
christos 0e1ce86abc cast 1 to size_t 2004-12-30 04:58:40 +00:00
atatat 2803cf768c Add a function called getdevmajor().
It tells you the major device number for whatever character or block
device you ask it.  This is sort of the inverse of devname(3) but not
quite, since it's backed by the kernel (sysctl's kern.drivers
information) and not a database cobbled together from the contents of
the filesystem.
2004-12-16 03:54:56 +00:00
nathanw 5229c9f993 Nuke threadlib.h. Library defensive threading is now provided through the
normal pthread.h interface.
Move stubs for libc back into a libc-internal header.
2004-12-14 00:23:19 +00:00
nathanw 30b299d965 __libc_thr_yield() signature now matches sched_yield().
Pointed out by Kouichirou Hiratsuka on current-users.
2004-12-13 16:08:12 +00:00
christos 402493043d Sprinkle const. 2004-12-11 06:41:57 +00:00
christos 678d9ffc1a Add _PATH_FTPUSERS; sort. 2004-12-11 06:01:33 +00:00
nathanw 0eaa8971b7 Use CPP macros to cause many libpthread functions used by applications
to be transformed into the do-nothing-when-libpthread-isn't-linked libc
stub names. This will permit library code that uses <pthread.h> and pthread
functions "defensively" to not need to link against libpthread and not need
to be patched to the threadlib.h API.
2004-12-10 16:40:40 +00:00
christos 36b10a0f21 Add _PATH_BPF 2004-12-01 22:51:50 +00:00
christos 52dcabadf5 Add sockaddr_snprintf() 2004-11-19 21:39:03 +00:00
itojun 384b8c15c2 remove NI_WITHSCOPEID 2004-11-16 06:00:51 +00:00
christos bcec1bd48c Add _PATH_DEV_PTS 2004-11-11 03:10:57 +00:00
lukem 5994f053ec * Improve the comments in <nsswitch.h>
* Provide some more useful default ns_src arrays.
2004-11-10 07:23:32 +00:00
lukem 246f6fd919 Implement sysconf(3) _SC_GETGR_R_SIZE_MAX and _SC_GETPW_R_SIZE_MAX for
the 1003.1-2001 Thread Safe Functions (TSF) getgrnam_r(3) and getpwnam_r(3).

These are not implemented in sysctl(3) "user.*", since that adds a lot
of complexity in the implementation for no real benefit.
2004-11-10 04:02:52 +00:00
christos 88ae7d9d8f Resolve conflicts. 2004-11-07 01:48:01 +00:00
christos 98e5db9d1f Re-import these. I imported the old ones accidentally. 2004-11-07 01:28:27 +00:00
dsl 96a5d45d4c Remove the (int) cast from the array subscript of the ctype #defines.
The cast just stops gcc detecting places where the functions are
passed a 'char' variable - and will index off the array for byte values
0x80 to 0xff.
All (I hope) of the places in the netbsd sources where this was a
potential problem have had an (unsigned char) cast applied.
Christos said he'll fix any fallout I've missed.
2004-11-05 22:55:19 +00:00
lukem 45a7a69275 Overhaul the use of nsdispatch(3) by public APIs so that the back-end
methods use va_list in a manner that is directly related to the public API.
This makes it much easier to write dynamic nsswitch backends for getpwent(3).
Per my proposal on tech-userlevel.

Implement getpwgid_r() and getpwnam_r() APIs per the POSIX 1003.1, 2004 Ed.
These aren't fully reentrant or threadsafe yet, because the compat stuff
currently uses non-reentrant data sources (getnetgrent(3), getpwent(3)),
and there is probably some locking to be improved in the backends.
This will be fixed in the near future.
We also need to add _SC_GETPW_R_SIZE_MAX to sysconf(3).

Fix the compat `+' prototype override so getpwnam(3) and getpwuid(3) DTRT.

Improve the description of pw_class and pw_gecos.
2004-10-05 04:45:54 +00:00
lukem c54f283e46 Overhaul the use of nsdispatch(3) by public APIs so that the back-end
methods use va_list in a manner that is directly related to the public API.
This makes it much easier to write dynamic nsswitch backends for getgrent(3).
Per my proposal on tech-userlevel.

Implement getgrgid_r() and getgrnam_r() APIs per the POSIX 1003.1, 2004 Ed.
These aren't fully reentrant or threadsafe yet, because the compat stuff
currently uses non-reentrant data sources (getnetgrent(3), getgrent(3)),
and there is probably some locking to be improved in the backends.
This will be fixed in the near future.
We also need to add _SC_GETGR_R_SIZE_MAX to sysconf(3).
2004-10-04 04:11:33 +00:00
lukem 25d91a60fb * Re-number NS_FORCEALL from 1<<7 to 1<<8, moving it out of the "public"
bitrange for nsdispatch(3) return values.
* Tweak documentation comments in nsswitch.h
* Ensure the result from the back-end method is masked with
  NS_STATUSMASK before nsdispatch(3) returns it.
2004-10-04 04:02:27 +00:00
kent 4a79196841 correct the return value type of _lwp_self() 2004-10-02 07:59:11 +00:00
lukem e775b9e35a Implement NS_FORCEALL, which may be set in defaults[0].flags by a caller of
nsdispatch(3) to indicate that all available database methods for a source
will be invoked.  This is useful for functions such as endgrent(3).
2004-09-29 02:47:32 +00:00
lha 22aae06570 update heimdal version to Heimdal 0.6.3 2004-09-14 20:30:57 +00:00
lha 2c875217bb Merge in changes between 0.6.2 and 0.6.3 2004-09-14 08:08:19 +00:00
thorpej de1dfb1250 DCE 1.1 RPC compatible UUID routines for libc, adapted from FreeBSD.
Encode/decode to big/little endian binary blob routines adapted from
kernel.

PR 23470.
2004-09-13 21:44:54 +00:00
christos 458810afd4 Typo... 2004-08-19 23:10:40 +00:00
christos 44a8d4af42 Rescue for _PATH_STDPATH 2004-08-19 23:07:01 +00:00
jmc a2d438e65c Fix proto for gethostent to match reality (takes void args) 2004-08-17 04:24:16 +00:00
ginsbach 30ef75e3f4 Restore gethostent() as a supported interface. Yes, it maybe obsolete
but it is specified by IEEE Std 1003.1, 2004 Edition (POSIX) and
the X/Open standards (Issue 6 and XNS 5.2).

* revert change removing gethostent() from gethostbyname(3) man page
* delete kruft from gethnamaddr.c leaving only gethostent() as a
  wrapper around _gethtent().
* revert recent changes to <netdb.h>
  + restore gethostent() prototype
  + restore freehostent() prototype; handle similar to non-shipped
    getipnodby*() prototypes
  + use correct XOPEN_SOURCE version (520 not 500) for freeaddrinfo()
    prototype; interface specified by XNS5.2 not XNS5

Reviewd by <christos> and <drochner>.
2004-08-17 02:29:56 +00:00
ginsbach ebcc92c100 * add const qualifier making getrpcbyname() and getrpcbyname_r()
prototypes match those used in latest Sun RPC code (TI-RPC 2.3)
* modify function getrpcbyname() definition as appropriate
2004-08-16 02:47:54 +00:00
drochner e6dd3245b7 Delete prototypes for gethostent() and freehostent();
there functions don't exist in libc.
2004-08-11 16:13:00 +00:00
thorpej 7c161da819 - Rename pw_copy() to pw_copyx(), make it return a success/failure code,
and add "errbuf" and "errbufsz" parameters so that errors can be handled
  gracefully, rather than simply exiting the process.
- Add a pw_copy() wrapper around pw_copyx() to preserve old behavior for
  apps that use it.
- Bump shlib version to 7.4.
2004-08-03 23:29:04 +00:00
tshiozak f7d656a488 revert the last all changes related to iconv(3). 2004-08-02 13:38:21 +00:00
tshiozak ab8d4be7c6 make sure that the iconv(3) follows the POSIX specification;
change the 2nd argument from "const char ** restrict" to "char ** restrict".
2004-08-01 16:40:58 +00:00
thorpej 43d6d8d887 Add support for dynamically loading nsswitch modules on ELF platforms.
Adapted from FreeBSD.  Maintains full backward API / ABI compatbility
with built-in-only nsdispatch().

While here, also make nsdispatch() itself thread-safe.
2004-07-24 18:42:51 +00:00
seb 2f8bbc118e Add wordexp(3). The wordexp function performs shell-style word expansions.
This implementation is wrapper around the undocumented wordexp sh(1)
built-in command.

From FreeBSD.
Provided in PR lib/26123.
Approved by kleink@.
2004-07-13 15:42:03 +00:00
kleink 2284f27adc Move round() to the C99 section. 2004-07-12 23:44:52 +00:00
kleink cceefa7be9 Move the strcasestr() prototype to the local extensions section.
Also __P() it; this should be consistent within a single header.
2004-07-12 23:35:14 +00:00
junyoung bc836a3102 lib/24252: Add C99 functions round(3) and roundf(3).
libm minor unchanged; ride a recent bump.

From FreeBSD.
2004-07-10 13:49:09 +00:00
junyoung 74d67c3551 Add strcasestr(3), case insensitive version of strstr(3).
Bump libc minor.

From FreeBSD.
2004-07-03 08:27:25 +00:00
kleink 7e47c9f64e Resolve some namespace protection confusion between XPG4.2 and 5/1003.1b,
making _XOPEN_SOURCE_EXTENDED work again.  Fixes PR lib/26077.
2004-07-01 23:46:07 +00:00
kleink 11f7fb5f29 Tidy up the namespace: lint -> __lint__. 2004-07-01 22:31:28 +00:00
drochner 147d852dbc being here, add the (l)lround(f) functions to libm
(almost the same like lrint)
2004-07-01 16:09:21 +00:00
drochner b6fcfe5309 shut up lint's "long long" warnings 2004-06-30 17:51:09 +00:00
drochner 737ab05bf9 Add (l)lrint(f).
Being here, move some C99 function declarations into the appropriate
section (as discussed with kleink).
2004-06-30 15:11:05 +00:00
jmc b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
christos e89baaa3bf Provide an ifdef so that we can define an old style _res if we need to. 2004-06-09 18:04:05 +00:00
mrg 5fb3053fed add $NetBSD$ 2004-06-06 06:58:50 +00:00
he 726e232131 Removr parameter names from __h_errno_set() function declaration.
Without this the vax port fails to compile the okheaders regression
test, because the "err" parameter name shadows a global variable.
2004-06-04 09:54:03 +00:00
kleink a95e31fea6 Move declaration of closefrom(3) to local extensions. 2004-06-01 16:10:29 +00:00
itojun 56c1b44159 implement closefrom(3). 2004-05-31 05:06:51 +00:00
christos 388c103e83 PR/25003: John Kohl: File is missing a copyright. 2004-05-28 14:38:53 +00:00
christos 58fadb2d69 Add unix/98 pty function prototypes. 2004-05-27 02:58:14 +00:00
christos 5fec60124f PR/25707: Love: remove _LIBC from res_state as suggested, so that res_ninit
calls in userland don't trash memory.
2004-05-26 01:08:50 +00:00
christos afa83b513a notyet is in the users namespace as pointed out by klaus. 2004-05-25 14:49:38 +00:00
christos fdaf51dfc9 we don't implement getipnode*(), so don't define their flags for now. It
confuses some software (ntpd).
2004-05-25 13:55:48 +00:00
lha 76164d845a Now that we have res_nsearch, use it. Thanks christos for adding it. 2004-05-25 11:15:43 +00:00
yamt 7ca373cce9 remove a duplicated prototype of getprotoent_r. 2004-05-24 12:34:28 +00:00
kleink c3d77c559b Implement sigemptyset() and sigfillset() not as macros but as inline
functions, just like the rest of the sigsetops.  From J.T.Conklin
in PR lib/25627; originally prompted to work around problems with
an application but also fixing one important bug: per POSIX, these
functions may be additionally implemented as macros, iff they evaluate
their macros only once.  This was not the case.
2004-05-23 23:03:24 +00:00
christos cad3251cd9 Provide access to the 5 symbols the bind8 resolver libc did. 2004-05-22 23:46:16 +00:00
christos c5167ccf84 provide unconditional access to _res via __res_state(). This will abort
for multi-threaded programs.
2004-05-22 15:42:17 +00:00
christos a39aed56f5 install new files. 2004-05-21 02:27:35 +00:00
christos b74cd7536f resolve conflicts. 2004-05-21 02:25:10 +00:00
christos d922106ab4 import new and changed files from bind9 2004-05-21 02:17:49 +00:00
christos 3bffc96400 Import selected changes from bind9. Follow the copyright structure there. 2004-05-21 02:14:39 +00:00
christos ad7bdf9185 add 2 new functions from bind9 2004-05-21 01:53:17 +00:00
kleink 867f8a88f2 Make it possible to use <stdbool.h> in C++ applications.
Fixes PR lib/25597 from Takuya SHIOZAKI.
2004-05-20 17:49:32 +00:00
kleink 3788baa149 Remove _assert() again. As has been noted by Ben Harris, this had been
removed already in rev. 1.4 and was subsequently reinstated by the
Lite-2 import.  Nothing uses it, and it pollutes user namespace.
2004-05-18 21:03:08 +00:00
kleink 8df3999b0c While I'm at it: add restrict qualifiers to readlink(2). 2004-05-10 22:33:08 +00:00
kleink 43b7ae77fa POSIX-2001: Change readlink(2)'s return type from int to ssize_t. 2004-05-10 22:28:23 +00:00
drochner 4bf1529244 remove fgetstr() from public sight 2004-05-10 16:53:56 +00:00
kleink c19ffd7809 C99: Provide WCHAR_{MAX,MIN} via <machine/wchar_limits.h> (we'll also
provide WINT_{MAX,MIN} along with it).
Fixes PR standards/24040 from Masao Uebayashi.
2004-05-08 21:57:05 +00:00
kleink 5f2ea73659 * __sparc64__ -> __sparc__ && _LP64,
* add a comment on the purpose of __ai_pad0.
Both suggested by mrg.
2004-05-08 18:55:23 +00:00
kleink 8d54bc1847 struct netnet.n_net used to be an unsigned long integer.
In XNS5, and subsequently in POSIX-2001 it was changed to socklen_t.

To accomodate for this while preserving binary compatibility with the
old interface, prepend or append 32 bits of padding, depending on
the (LP64 data model) architecture's endianness.  Fixes PR
standards/21411 from Ben Harris.

This should be deleted the next time the libc major number is
incremented.

Also, update getnetbyaddr(3)'s `net' argument accordingly.
2004-05-08 18:52:15 +00:00
lha bba70dc29c Merge changes between Heimdal 0.6.1 and 0.6.2 2004-05-08 13:27:58 +00:00
kleink dbfbef898d XPG4.2: Change member `dsize' of struct datum from int to size_t.
Version dbm_{delete,fetch,firstkey,nextkey,store}() accordingly.
Fixes PRs standards/21402 from Ben Harris and standards/25343 from
Murray Armfield.
2004-04-28 00:10:52 +00:00
kleink cd7b32a9cf Un-__P(). 2004-04-27 20:59:43 +00:00
kleink 22c4c0ea8f Remove declaration of dbm_forder(), which is not implemented. 2004-04-27 20:13:46 +00:00
christos fe069d7c1f more const sprinkling on cget* suggested by kleink. 2004-04-23 14:44:54 +00:00
christos e1beeda0ae constify the db name vector argument. 2004-04-23 14:37:42 +00:00
christos 3b237aad69 constify setdisktab() 2004-04-23 14:37:12 +00:00
christos 63f41ce367 add fgetstr 2004-04-21 00:05:05 +00:00
itojun 0fc4d34dfc fix comment (there could be more than 3 AI_xxx) 2004-04-14 04:37:59 +00:00
itojun a1b7e86ab4 implement AI_NUMERICSERV (as defined in RFC3493) 2004-04-14 04:37:06 +00:00
lha 4d21efe5f7 Merge changes between heimdal-0.6 and heimdal-0.6.1 2004-04-02 14:59:46 +00:00
joda d3dc070ae7 turbo-upgrade to Heimdal 0.6 (this was somehow missed when 0.6 was imported) 2004-03-24 20:48:34 +00:00
christos 639e111c0e Do not expose the current implementation of the serv*_r proto*_r functions,
since this is not how we will implement them when we do. From discussions
with Brian Ginsbach and Soda-san.
2004-03-20 18:22:22 +00:00
kleink 8e54f10bf7 * Turn isinf(3) and isnan(3) into C99-style macros.
* Make it possible for ports to override these (i.e., VAX).
* Remove isnanl(), which was internal to libc only.
2004-03-04 23:42:38 +00:00
kleink 642c4f3f10 Make lint happy for __fpmacro_unary_floating() users. 2004-03-04 00:17:44 +00:00
christos a2ef38401f in servent and protent data:
- add a dummy field for extensions.
- add a line field to keep the current line buffer.
2004-02-23 16:05:19 +00:00
christos 885e0fc7f3 protoent_r/servent_r 2004-02-19 19:30:30 +00:00
kleink 15afe0b4fc Move FP_ROP and FP_DIRTYZERO from <math.h> to <vax/math.h> (where they
would have ended up if I hadn't missed the latter file in the commit).
2004-01-20 19:52:40 +00:00
matt 20fe2d9da9 Add FP_ROP and FP_DIRTYZERO to MD range for VAX. 2004-01-20 19:26:53 +00:00
yamt eecd1e664f explicitly cast langinfo constants to nl_item. 2004-01-18 09:07:07 +00:00
uwe 11b19038f9 Close the comment after #endif. 2004-01-17 01:04:46 +00:00
kleink d82e732345 Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros. 2004-01-15 19:43:44 +00:00
cl 90e89977d4 - libc.so.12.109 and libpthread.so.0.4
- add ssize_t stackinfo_offset argument to sa_register syscall
- remove sa_unblockyield syscall
- make __sigprocmask14 syscall weak
- in pthread__sa_start: catch up with 4-argument sa_register syscall
2004-01-02 18:56:39 +00:00
kleink 413b3367fe Do a little const cleanup, for consistency with std interfaces. 2003-12-21 23:19:02 +00:00
agc 7db1d33cba Modify the licences of code written by Theo De Raadt from a 4-clause
to a 2-clause licence (retaining UCB clauses (1) and (2)), per PR
22409 from Joel Baker, approved by Theo de Raadt, and ratified by
myself - the only discrepancy being the handling of the original
clause 3 in src/usr.sbin/yppoll/yppoll.c.
2003-12-10 12:06:25 +00:00
thorpej 137c808bb8 Userland portion of fsync_range(2), written by Bill Studenmund, and
contributed by Wasabi Systems, Inc.
2003-11-18 00:56:56 +00:00