Commit Graph

1119 Commits

Author SHA1 Message Date
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