Commit Graph

74 Commits

Author SHA1 Message Date
he c35e4870f2 Add some more weak aliases for versioned library calls, to prevent
that we try to link in objects from libc.a where we also provide our
own replacements here, leading to multiple definitions during linking.

OK'ed by christos@
2009-01-16 14:48:04 +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
sborrill 8e03e5a4c8 Add cut-down getpwent_r() to join existing getpwent() and friends. This
fixes PR 40003
2008-11-28 19:39:00 +00:00
tnozaki 727a7567f1 install/39193, fix signedness problem of converting char -> wchar_t. 2008-07-29 13:46:16 +00:00
dsl cc5a3a76ba mbrtowc() gets called to initialise the mbstate from libcurses.
Don't access address 0 and core dump when it does!
Fixes sysinst, the install ramdiskbin gets built against the standard
archive libraries (at least on amd64) which are build with HAVE_WCHAR.
2008-07-12 19:20:03 +00:00
martin 6c62888809 Compile a special version of the default locale into libhack - we can
not use real locales, but this at least allows single byte character
locales to work as expected (i.e. the existing translations for sysinst).
Once we get a sysinst translation that needs more, we'll have to drop this
and the castrated setlocale(), and go for a real solution.
2007-11-06 19:27:07 +00:00
he 2f140cf7fe Undo the #if 0 for the multibyte functions we now need to build
ramdisks, and provide untested minimal implementations of mbsrtowcs()
and wcsrtombs().
Verified to fix build problems for at least the amd64 and hp300 ramdisks.
2007-05-29 17:46:44 +00:00
christos e3845a8924 Merge the multibyte routines into one file, and add stub implementations
for one more that is needed, and commented out partial implementations for
the test of the functions. This should stop the re-defined symbol errors
for now.
2007-04-02 15:53:25 +00:00
christos 32b2149aa4 we need wcrtomb now too. 2007-02-03 19:55:51 +00:00
christos 288e2b48f6 add prototypes for the _ss functions. 2007-02-03 19:49:21 +00:00
he 9fdd864183 Implement mostly-stub versions of the new syslog functions
({v,}syslog_{r,ss}) and the corresponding openlog_r/setlogmask_r/closelog_r
functions.

This should allow sparc64 to build its ramdiskbin again.

Reviewed by christos@
2006-11-06 17:33:56 +00:00
drochner a8675b3763 emulate getgrouplist() directly, no need to pull in
the wrapper from libc
2005-09-14 15:54:53 +00:00
he ea19769e49 pty.o in libutil.a wants to call getgrent_r(), so provide a cheesy
non-reentrant version here in order to avoid linker conflicts when
the rest of this file is attempted linked together with libc's
getgrent.o.

Reviewed by christos.
2005-09-14 15:31:18 +00:00
dsl 148ea12326 Stub out mbrtowc(), removes all the citrus_xxx stuff from libc.
rescue_tiny fits again...
2005-05-15 10:15:47 +00:00
he 3fdfdbed08 Include <unistd.h> to get the getgroupmembership() prototype. 2005-04-01 13:11:12 +00:00
he 97b59ebcdc Return 0xff from setlogmask() instead of falling off the end of
the int-returning function without returning a value.  The 0xff
value is taken from the C library and is the default log mask.
2005-03-31 13:03:34 +00:00
he fca2c8bedd Provide weak aliases for the newly added getpwuid_r() and getpwnam_r()
functions in order to fix link-time conflicts with the C library.
2005-03-31 12:56:49 +00:00
christos 57b822fef8 Add re-entrant versions of the password routines. Well, not really, but close. 2005-03-31 04:14:42 +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
dsl 300c56aef2 Add a newline to the end of the 'syslog' output when writing it to stderr.
(affects output of dhclient when run from sysinst)
2004-10-17 11:57:14 +00:00
christos cdc016624f add an empty setlogmask() 2004-06-06 18:13:45 +00:00
christos 0f6740656b Include a fake syslog that does only printf; saves 4K. 2004-06-06 07:03:53 +00:00
sommerfeld faa802158e Change hack getnetbyaddr to match new system prototype. 2004-05-09 01:49:56 +00:00
christos 6101c5d9b5 arrange for libc's getcap to be used instead of a local copy. 2004-04-25 06:45:02 +00:00
matt e0aa03fd40 Adapt to stdlib.h/libc changes. 2004-04-25 04:35:36 +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
agc 9f1aac5bb3 Move Jason Downs's code from a 4-clause to a 3-clause licence by
removing the advertising clause.  Diffs provided in PR 22410 by Joel
Baker, confirmed to the board by Jason Downs.

With additional thanks to Jason Thorpe.
2003-10-13 15:36:33 +00:00
agc 74b7d6e9f2 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22268, verified by myself.
2003-08-07 09:27:56 +00:00
itojun ac9d94f21a use bounded string op and strdup 2003-08-06 13:43:31 +00:00
salo 8d1781e39d netbsd.org->NetBSD.org 2003-07-26 17:06:22 +00:00
elric bbf4f2d867 Sync this file up with its counterpart in libc,
src/lib/libc/gen/getgrent.c
Patch and PR provided by: FUKAUMI Naoki

Addresses PR lib/20365
2003-02-19 08:04:29 +00:00
chris e1f2f4db9e As sys/locale.h no longer includes some extraneous headers, localeconv.c
needs to include limits.h itself.
2002-11-19 23:15:59 +00:00
itojun 9b10247223 have setloginx() and friends to avoid linking *.o from libutil. PR 17820 2002-08-03 11:37:17 +00:00
elric 7836706b6a Modified pwmatchline to return the value to pw_class. This is not
strictly necessary for the install floppy, but it enables one to
build a rescue floppy with ssh(1) on it.  ssh dereferences pw->pw_class
and will therefore core dump if it is not set to something.

Reviewed By: simonb@NetBSD.ORG
2002-05-13 06:38:14 +00:00
tsutsui b85c5addbb Don't override DBG here. It should be defined in parent Makefiles. 2002-04-06 18:12:50 +00:00
lukem 484f8db2eb - Be consistent how libhack is used: If extra HACKOBJS (e.g., gethost.o) are
required, define them before pulling in libhack/Makefile.inc so that the
  dependencies work correctly.
- Other minor cleanups
2002-03-28 04:33:21 +00:00
lukem 25c4cc30b2 Disable libhack's gethost.o (replacement gethostby{name,addr}()) by default,
as they only support reading /etc/hosts, and its the "least useful" of
the libhack routines.  Add gethost.o back to Really Small media which
appears to need the space savings.
2002-03-25 07:43:39 +00:00
lukem a23934fd2a permanently disable opendir.o until its link bugs (on ELF platforms
only?) are sorted out.  speculation (based on some analysis by simonb)
is that it's because fts calls _opendir2 directly, which forces both
the libhack and the libc versions of opendir.o to be linked in.
in any case, there's space saves to be had elsewhere...
2002-02-03 22:39:52 +00:00
lukem 3ec71ac24d replace previous "cut down" getpwent.c with a version which is closer
to libc/gen/getpwent.c.  this version reads from master.passwd instead
of passwd  (thus removing the need to keep both in the mini file system
and having to run pwd_mkdb to generate the latter)
2002-02-02 15:57:54 +00:00
lukem d50281b041 sync closer to libc version 2002-02-02 15:31:58 +00:00
lukem 6d6c0437fa ansify 2002-02-02 15:08:06 +00:00
tv 7ec460046d Major readability cleanup; nuke redundancies; MKfoo=no -> NOfoo=. 2001-12-12 00:05:09 +00:00
jmc 0eadbed94d Change all COPTS+=-Os to DBG=-Os as that var actually controls the optimization
levels
2001-10-05 01:17:27 +00:00
martin c45ea630d3 Drop ``-Os'' on sparc64 due to toolchain issues.
The same change has already been applied on the 1.5 branch. The problems
(i.e. ifconfig not showing IP addresses) have been verified to still exist
with the new toolchain.
2001-08-20 12:19:43 +00:00
tsutsui f768d0ff1a Add definitions for weak aliases so that libhack functions
are actually linked instead of libc ones on ELF systems.
Fixes install/13050 and install/13153.
2001-06-15 17:26:50 +00:00
kleink 8a9b17ef14 Sync with gethostbyaddr() declaration change in <netdb.h> rev. 1.21;
from <lha@stacken.kth.se> in PR misc/12775.
2001-04-28 14:56:42 +00:00
abs bd9b9e0b4c Shave another few bytes here and there - compile with -Os 2000-08-22 14:06:37 +00:00
tshiozak 2ef55c239a Add __mb_cur_max and rename setlocale function.
(Lack of __mb_cur_max causes to import setlocale.o in libc.a
and causes conflict of symbol, pointed out by Johan Danielsson.)
2000-08-11 19:58:34 +00:00
matt e123fd0f5a Compile things with -Os. I wonder if compiling -Mno-pic for mips and vax
would shrink them even more?
2000-05-18 00:43:05 +00:00
pk e42055a6de Deal with name space issues after libc/net updates. 2000-01-14 13:52:13 +00:00