[PATCH 0/7][CFT] Add and use generic (config-)file parser
Bernhard Reutner-Fischer
rep.dot.nop at gmail.com
Fri Apr 16 09:35:48 UTC 2010
Hi,
This series would add a generic config-parser (initially based off the
config-parser that we have in busybox).
This parser is used to handle files like:
/etc/hosts
/etc/networks
/etc/protocols
/etc/services
I think i've broken locking though, so it would be great if somebody who uses
threads could have a look..
The statistics below are a bit misleading since:
- it adds sysconf _SC_NPROCESSORS_CONF, _SC_NPROCESSORS_ONLN
- adds netent reentrant versions
function old new delta
getnetent_r - 431 +431
getnetbyname_r - 225 +225
getnetbyaddr_r - 189 +189
setusershell 30 206 +176
sysconf 343 473 +130
endusershell 34 141 +107
.rodata 12011 12072 +61
gethostbyaddr_r 796 805 +9
sethostent 77 84 +7
gethostent 62 59 -3
setservent 135 130 -5
setprotoent 135 130 -5
setnetent 135 130 -5
getusershell 60 54 -6
getnetbyaddr 91 71 -20
gethostent_r 193 171 -22
endhostent 109 70 -39
getnetbyname 122 68 -54
getprotoent_r 508 351 -157
getservent_r 547 376 -171
getnetent 527 65 -462
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 6/12 up/down: 1335/-949) Total: 386 bytes
Bernhard Reutner-Fischer (7):
add config parser
sysconf: implement _SC_NPROCESSORS_CONF, _SC_NPROCESSORS_ONLN
switch getservice to config parser
usershell: switch to config parser
getproto: switch to config parser
getnet: switch to config parser
resolver: switch to config parser
Makefile.in | 1 +
include/internal/parse_config.h | 50 +++++
include/netdb.h | 11 +-
include/sys/sysinfo.h | 6 +-
libc/inet/Makefile.in | 2 +-
libc/inet/getnet.c | 217 ++++++++++++++++++++++
libc/inet/getnetbyad.c | 37 ----
libc/inet/getnetbynm.c | 45 -----
libc/inet/getnetent.c | 139 --------------
libc/inet/getproto.c | 349 ++++++++++++++----------------------
libc/inet/getservice.c | 351 ++++++++++++++----------------------
libc/inet/resolv.c | 255 ++++++++++++--------------
libc/misc/internals/Makefile.in | 8 +-
libc/misc/internals/parse_config.c | 268 +++++++++++++++++++++++++++
libc/unistd/sysconf.c | 85 ++++++++--
libc/unistd/usershell.c | 172 ++++++------------
test/inet/getnetent.c | 17 ++
test/unistd/tst-getconf.sh | 2 +
18 files changed, 1092 insertions(+), 923 deletions(-)
create mode 100644 include/internal/parse_config.h
create mode 100644 libc/inet/getnet.c
delete mode 100644 libc/inet/getnetbyad.c
delete mode 100644 libc/inet/getnetbynm.c
delete mode 100644 libc/inet/getnetent.c
create mode 100644 libc/misc/internals/parse_config.c
create mode 100644 test/inet/getnetent.c
More information about the uClibc
mailing list