Commit Graph

102 Commits

Author SHA1 Message Date
christos
58e21b67a6 Add a stubbed version of libwrap (tcpwrappers) 2021-03-09 00:06:44 +00:00
christos
bb0dab52f7 Add regcomp.c and regexec.c so that we get a version that does not use NLS
and brings in all the locale code.
2021-02-25 21:24:00 +00:00
jdolecek
ad81495fd9 include aligned_alloc(3), now needed for newfs and fsck_ffs 2020-04-17 14:55:24 +00:00
martin
fa0d5eae99 Extend the curses hack to terminfo - build selected parts of
libterminfo as part of libhack, so we can drop unwanted features
for small install media.
2020-04-05 11:18:02 +00:00
roy
1d37b848af libhack: revert prior, will be done per consumer instead. 2020-03-02 16:01:52 +00:00
roy
0d1a142685 libhack: build with -D_REENTRANT
Some tools that use libhack expect thread locking.
An example of this is zpool(8).

Without it, it randomly crashes. As such, force _REENTRANT to avoid
debugging future random crashes from any other applications which
rely on this.
2020-03-01 22:47:26 +00:00
christos
0287e63d96 use unsigned char to prevent sign extension. 2019-08-13 08:48:07 +00:00
martin
92d9c20449 Make this at least work for ASCII strings (there are way more users
than libcurses in various crunched environments, so the original assumption
of a very limited set of inputs was wrong).
2019-08-12 09:34:53 +00:00
martin
2f346b3370 Avoid using an unitialized variable 2019-08-01 12:28:53 +00:00
martin
5c19a89c12 Provide a way for crunched programs to use a non-WIDE_CHAR version of
libcurses by setting HACK_CURSES=yes before including this makefile.
2019-07-28 10:27:57 +00:00
martin
f3b7b31ee0 We (especially libcurses and nvi) use more multibyte character locale
related symbols nowadays. Update libhack to avoid pulling in full grown
multibyte locale support on small install media.
2019-07-28 10:21:18 +00:00
christos
d33bb7af26 Add an empty fmtcheck 2019-06-22 22:50:39 +00:00
roy
a876fb76fb Fix build with MKYP=no 2019-05-09 08:20:35 +00:00
christos
67177861a2 Dedup and add the small jemalloc implementation so our install media has
a chance to fit again.
2019-03-28 15:04:41 +00:00
manu
6a05c304af Make shared -DSMALL libc buildable without breaking libhack
We used -DSMALL to exclude code from libc in order to build
libhack. Introduce -DLIBHACK to do this without so that
-DSMALL does not remove code necessary for building a shared libc
2017-06-18 03:56:39 +00:00
htodd
685040dc40 Remove unused variable. 2014-11-15 19:15:51 +00:00
christos
c94539ae6b handle the "special" wc NULL case. 2014-11-15 17:49:19 +00:00
christos
386021af1d Use .PATH because the newmake does not apply pattern rules to sources in
other directories. Leave the comment and the old code for now so people
are aware that this might not work.
2014-08-25 14:11:51 +00:00
christos
73e8f5b689 refer to our own h_errno so we don't fetch the libc one 2013-12-21 20:10:02 +00:00
christos
27af00aa70 avoid copying most of libc (except gethostent_r, which unfortunately
adds a resolver dependency) by callling the internal nsswitch functions.
2013-08-27 09:53:33 +00:00
christos
5f8c91aab5 provide the symbols sethostent.c in libc is missing. 2013-08-25 08:46:34 +00:00
christos
f5cfca3b2e modernize, comment out dead code, amend gethostbyaddr prototype. 2013-08-20 15:44:17 +00:00
joerg
ed6b016ecc More locale hacks. 2013-04-19 18:45:03 +00:00
joerg
ddb0cef57c Override localeconv_l as well, when providing an alternative
implementation of localeconv.
2013-04-18 16:25:55 +00:00
christos
f6e747aed2 make libhack's syslog.c produce exactly the same symbols as libc's syslog.c,
so that in the future we can keep them synced. Avoid strong_alias since it
does not play well with symbol renaming.
2012-10-11 17:11:16 +00:00
abs
d149c09c58 Add a check hack to ensure %m causes error message string to be shown 2012-07-14 20:32:39 +00:00
joerg
840ff94b9f Fix the weak aliases to match the libc version and not leave unresolved
symbols around.
2011-01-12 23:34:00 +00:00
tnozaki
068f43028d fix build breakage by multiple definition of __mb_cur_max. 2010-06-08 17:12:32 +00:00
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