Annotation of dietlibc/CHANGES, revision 1.53

1.34      fefe        1: 0.7.3:
                      2:   vsnprintf(0,...) estimated the length of strings with a padding width
                      3:     incorrectly.
1.35      fefe        4:   new reboot() from Olaf.
1.36      fefe        5:   added prototypes for getsockopt and setsockopt.
1.39      fefe        6:   added experimental sem* and shm*
1.38      fefe        7:   define EXIT_SUCCESS and EXIT_FAILURE
1.40      fefe        8:   added setvbuf (only changes mode, not buffer)
1.41      fefe        9:   added dietwarning.h (woohoo, linker warnings!) and used it to warn of
                     10:     insecurity (system, sprintf) or bloat (printf and stdio).
1.42      fefe       11:   added qsort() and bsearch().  Benchmark on 1000 random ints:
                     12:     glibc: 679414 cycles qsort and 3352 cycles bsearch
                     13:     diet libc: 300010 cycles qsort, 553 cycles bsearch
                     14:     I have no idea why glibc is so slow.
1.43      fefe       15:   added __isnan (references by libm.a from glibc).
                     16:   added popen() and pclose().  Now the diet libc can link slsh (from
                     17:     S-Lang!)
1.44      fefe       18:   corrected usleep.  It was more of an msleep until now.
1.45      fefe       19:   corrected __dtostr (it looped when trying to format "0.0").
                     20:   several fixes to stdio (thanks to S-Lang's excellent test suite!)
1.46      fefe       21:   added ungetc (does it work?)
1.47      fefe       22:   added inet_aton (yuck!)
1.50      fefe       23:   added gethostbyname, gethostbyaddr, gethostbyname_r and gethostbyaddr_r
1.48      fefe       24:   added h_errno and __h_errno_location
                     25:   added inet_ntoa
1.49      fefe       26:   added setpgrp and getpgrp, strsignal and execv (thanks, Olaf)
1.51      fefe       27:   add bcopy, index, rindex macros
                     28:   add isgraph and isxdigit
1.52      fefe       29:   add strftime (ugh!!!)
1.53    ! olaf       30:   Olaf fixed strftime, gmtime_r leap year bug.
1.34      fefe       31: 
1.21      fefe       32: 0.7.2:
                     33:   added several prototypes to already implemented functions and
                     34:     <sys/reboot.h>.  Thanks for Abraham for pointing this out.
1.22      fefe       35:   added prototypes for process group and dup syscalls.  Thanks to
                     36:     Abraham again.  He also contributed an implementation for daemon(),
                     37:     an ugly BSD hack.  I decided to diversify the lib/ directory a
                     38:     little and now created a libugly/ directory for stuff like system()
                     39:     and daemon() ;-)
                     40:   added libstdio and moved all that stdio crap from lib/ there.  The
                     41:     idea is to start separating now what we will separate for shared
                     42:     libraries anyway.
1.26      fefe       43:   optimized x86 unified-syscall by Olaf.
1.27      fefe       44:   added limits.h, removed __ARCHBITS from endian.h (use __WORDSIZE from
                     45:     limits.h instead)
                     46:   added remove.c and enough cruft to limits.h to make it compile lzo,
                     47:     lzop and bzip2.
1.28      fefe       48:   added mktime, asctime_r, asctime and ctime (needed for gzip).
                     49:   Someone will need to implement a reader for the glibc localtime file
1.31      fefe       50:     format some day (man tzfile, ugh!) :-(
1.29      fefe       51:   added unlink prototype to unistd.h.
                     52:   added gmtime and gmtime_r.
1.31      fefe       53:   fixed sparc unified syscall error handling (please upgrade!).
1.30      fefe       54:   removed readdir glibc compatibility cruft.
1.31      fefe       55:   removed stat glibc compatibility cruft.
1.32      fefe       56:   oops, my fread was broken for pipes.
1.33      fefe       57:   Olaf found a bug in pipe() for sparc, too.
1.21      fefe       58: 
1.9       fefe       59: 0.7.1:
1.11      fefe       60:   optimized away the static arrays from __ltostr and __lltostr.
                     61:   optimized away the static arrays (and more!) from strtoul and strtoull.
                     62:   added system (by Olaf).
1.12      fefe       63:   added tolower and toupper
1.13      fefe       64:   added getopt from Olaf (~600 bytes on x86!)
1.14      fefe       65:   added clone for mips (by Olaf).
                     66:   fixed longjmp and setjmp on sparc not to require glibc include files.
1.15      olaf       67:   added pause for all (by Olaf).
1.17      fefe       68:   added __attribute__ ((__const__)) to ctype.h
1.16      fefe       69:   added isupper and islower.
                     70:   added putc and putchar as macros.
1.17      fefe       71:   added strcasecmp and strncasecmp (thanks to Abraham vd Merwe for
                     72:     insightful discussions and patches I partially used for the last three)
1.18      fefe       73:   added getpriority and setpriority (also by Abraham)
1.19      fefe       74:   oops, I broke strtoul in a recent optimization attempt.
1.20      fefe       75:   oi, setjmp and longjmp were broken on other platforms, too!
                     76:     Thanks to Sébastien Côté for reporting this.
1.9       fefe       77: 
                     78: 0.7:
1.6       olaf       79:   clone support for i386,alpha,arm and sparc by Olaf.
1.1       cvs        80:   Initial dynamic loading glue for i386, also by Olaf.
                     81:   We don't have a dynamic loader yet, so this is not yet usable.
                     82:   added readv, sigdelset, sigaltstack, sigfillset, sigismember, usleep,
                     83:     vsprintf, writev, all by Olaf.
1.2       fefe       84:   imported readdir fix from Guillaume.  Mhh, can the kernel interface
                     85:     really be this broken?
1.3       fefe       86:   Found a kludgy way to detect whether the kernel includes define struct
                     87:     stat64 (they also define STAT64_HAS_BROKEN_ST_INO).  If this does
                     88:     not work for you, please tell me!
1.4       fefe       89:   Removed bogus __seek_types enum, it's a bunch of #defines now.
1.7       fefe       90:   Fixed stdio line buffering.  The code was already there but I forgot
                     91:     to mark stdio and stdout as line buffered.  This should really be
                     92:     done dynamically using isatty, though.
1.8       fefe       93:   Removed superfluous "if (1)" in execvp.c
1.1       cvs        94: 
                     95: 0.6.14:
                     96:   *scanf did not append the 0 byte for %s.
                     97:   added creat and changed creat to call open directly instead of open64.
                     98:   did for fread what 0.6.10 did for fwrite.
                     99:   repaired buffered stdio a little (line buffering is still not
                    100:     supported).
                    101:   [All of these bugs have been reported by Guillaume.  Thanks!]
                    102:   added __pure__ to strchr and strrchr in <string.h>
                    103: 
                    104: 0.6.13:
                    105:   included COPYING to make clear that the diet libc is covered by the
                    106:     GNU General Public License (and _not_ the LGPL).  That means that
                    107:     you need to obtain a license from me if you want to use the diet
                    108:     libc in a proprietary program that you want to distribute.
                    109:   The x86 unified syscall swapped arguments #4 and #5 and noone
                    110:     noticed until now!  Thanks to Guillaume Cottenceau for reporting
                    111:     this!
                    112:   The malloc had a subtle bug with small allocations that could cause
                    113:     segfault.  Guillaume reported it, Olaf fixed it.
                    114: 
                    115: 0.6.12:
                    116:   added assert, statfs and fstatfs
                    117:   added include/net/if.h so fget compiles again.
                    118: 
                    119: 0.6.11:
                    120:   added putenv.
                    121: 
                    122: 0.6.10:
                    123:   fixed fwrite.  It returned the number of bytes written, not the number
                    124:     of records.  Thanks to Albert D. Cahalan for pointing this out.
                    125:   fixed fgets.  It returned EOF on empty lines.  Thanks, Erik Frey.
                    126:   added brk and sbrk.  harold@nb.com.sg made me do it.
                    127: 
                    128: 0.6.9:
                    129:   fixed execvp not to return on ENOENT
                    130:   did for {open|read|close|seek|tell}dir what I did for stat before.
                    131:     The glibc compatibility part is currently non-functional.
                    132:   fixed white space handling in sscanf " (" would not match " (".
                    133:   fixed printf to accept 'l' flag.
                    134:   fixed getpwuid (ignored last line)
                    135: 
                    136: 0.6.8:
                    137:   Olaf contributed initial thread-safe syscalls for i386, alpha, sparc,
                    138:     mips and arm.  I did the one for ppc.  They can be enabled in dietfeatures.h.
                    139:   added strlcpy and strlcat from OpenBSD.
                    140:   added stat64, fstat64 and lstat64.
                    141:   added endian.h and made ending of strlen.c endianness-aware
                    142:   added string routines size tweak to dietfeatures.h.  Most of the
                    143:     string routines have been unrolled.  This is up to three times as
                    144:     fast but creates up to three times larger code.  Now you can disable
                    145:     the unrolling.
                    146:   added sendfile.
                    147:   I also added pread.  It works on x86 and sparc but not on ppc and mips.
                    148:     I have no idea what's going on.  strace disagrees with the kernel.
                    149:     Can anyone help?  I asked the Linux kernel mailing list for help, too.
                    150:   added a few aliases of the type __libc_open for open.  nm on
                    151:     libpthreads.so indicates that we will need them.
                    152: 
                    153: 0.6.7:
                    154:   the sources now compile without warnings with -Wall.
                    155:   printf now prints "(null)" when %s is passed NULL.  This can be
                    156:     removed with WANT_NULL_PRINTF in dietfeatures.h
                    157:   added vfprintf, execl, ttyname.
                    158:   stat, lstat and fstat are now #defined to __dietstat, __dietlstat and
                    159:     __dietfstat so they can use the normal kernel struct stat.
                    160:     stat, lstat and fstat are now C wrappers that convert to the glibc
                    161:     struct stat.  So we can avoid that overhead for programs that use
                    162:     dietlibc headers.
                    163: 
                    164: 0.6.6:
                    165:   changed the Makefiles so you can now set CFLAGS on the command line
                    166:   added memccmp (analogous to memccpy) and strncmp.
                    167:   Olaf fixed another bug in the sparc unified syscall.
                    168:   Paul Clifford contributed a C version of his strlen.S that is much
                    169:     more efficient than the previous strlen on all platforms!  It also
                    170:     looks like technology from Roswell. ;-}
                    171:   added a "real" stdio.  Well, almost.  Please contribute!
                    172:   added dietfeatures.h so you can remove features you don't need.
                    173:   removed debug code from vsnprintf that changed \0 to ' ' (argh!).
                    174:   stdio now works with simple programs and minigzip from libz.
                    175:   stdio uses some major trickery to avoid linking the stdio, stderr and
                    176:     stdout (and reserving space for them) when they are not used.
                    177: 
                    178: 0.6.5:
                    179:   Red Plait <redplait@ixcelerator.com> found several bugs in diet libc,
                    180:     most of them bugs in the new header files, but also missing sigset
                    181:     functions.
                    182:   Paul Clifford contributed an assembly strlen.S for ARM and fixed
                    183:     several bugs.
                    184:   Fixed ppc/setjmp and mips/pipe.
                    185:   Olaf contributed a new sparc unified syscall.
                    186: 
                    187: 0.6.4:
                    188:   declared is* static inline in getservent.
                    189:   added assert_fail, strtoul, isalpha, isdigit, isalnum, isascii.
                    190:   changed strlen to return 0 when passed NULL.
                    191:   new, much smaller unified syscall for MIPS.  Thanks to Olaf the Mad
                    192:     Scientist who actually implemented this without access to a MIPS
                    193:     box, just from reading the architecture manual.  And it worked out
                    194:     of the box.
                    195:   started a set of system includes, mainly so that I can use lcc and
                    196:     my alpha-linux cross compiler (which is unable to cross-compile
                    197:     glibc).  diet libc can now be compiled without any include files
                    198:     from a normal libc.  The includes do declare more than diet libc
                    199:     currently delivers and they are still far from complete for real
                    200:     applications.
                    201:   I will only add assembly versions that are smaller _and_ faster than
                    202:     the C version.  Larger routines are only accepted if they are called
                    203:     very often and are substantially faster.
                    204:   added i386 assembly strchr, which is smaller and faster than the old
                    205:     version.  It is, however, larger than the version contributed by
                    206:     proton (thanks, anyway).
                    207:   added i386 strlen (31% faster, 14% smaller)
                    208:   "make t" will now create a map file called "mapfile".
                    209: 
                    210: 0.6.3:
                    211:   added sys_errlist, strerror and perror
                    212:   added isblank
                    213:   added atol
                    214: 
                    215: 0.6.2:
                    216:   mmap for ARM didn't compile.  Thanks, Paul!
                    217: 
                    218: 0.6.1:
                    219:   split mmap into the architecture specific subdirectories.
                    220:   getenv now copes with environ==NULL, thanks Paul Clifford.
                    221:   Paul also contributed a smaller ARM startup code.
                    222: 
                    223: 0.6:
                    224:   strcat returned the wrong result.  Thanks, Dietz Pröpper.
                    225:   strtod now understands a negative exponent (oops, thanks Bertram Barth)
                    226:   Port to arm-linux-gnu, but on the Netwinder I use for testing the
                    227:     __dtostr does not work (I have no idea why!)
                    228:   The MIPS port now uses (much smaller) non-PIC code.  That means that
                    229:     the applications you link against diet libc also have to be compiled
                    230:     non-PIC.  I suggest copying the CFLAGS from the diet libc Makefile.
                    231:     Thanks to Ralf Bächle for helping me with this!
                    232:   I made subdirectories for the architectures and use VPATH to override
                    233:     VPATH so that make finds the source file automatically.  That should
                    234:     simplify the sources greatly.
                    235:   Olaf Dreesen contributed Alpha support including setjmp and longjmp!
                    236:   ARM and MIPS now also have setjmp and longjmp
                    237:   "compile" and "load" are now make targets.  Use them for djb programs.
                    238:   added contrib/elftrunc.c which will remove unnecessary ELF headers.
                    239:     Again, contributed from Olaf.  Great work!
                    240: 
                    241: 0.5.12:
                    242:   printf also does signed numbers.
                    243:   If you don't use atexit, dietlibc now does not link exit, only _exit.
                    244:   *printf now correctly returns the number of bytes written.
                    245:   Olaf contributed experimental sscanf and vsscanf implementations.
                    246:   If passed NULL as buffer, snprintf will not write anything but still
                    247:     return the number of bytes it would have written.
                    248:   Initial MIPS port!   (Oh, the agony!)
                    249:     No setjmp and longjmp support yet!  Please contribute!
                    250:   I even implemented unified syscalls for MIPS.  Still, MIPS code is
                    251:     almost twice the size of SPARC code.  If anyone knows why: please
                    252:     tell me!
                    253: 
                    254: 0.5.11:
                    255:   I implemented new unified syscalls for x86, sparc and ppc, this time based
                    256:     on .s files and not .c files, and I moved the syscalls into
                    257:     subdirectores to clean the dietlibc sources up a little.
                    258:   A binary consisting of printf("%s is %d\n","olaf",23) is now
                    259:     2864 bytes on sparc
                    260:     2488 bytes on intel
                    261:   I kludgily implemented fprintf(stdout,... and fprintf(stderr,...
                    262:     to make a few more applications work.
                    263:   Olaf Dreesen also implemented some unified syscall stuff for x86.
                    264:   He discovered that with our unified syscall interface it actually
                    265:     costs <10 bytes total to make all system calls thread safe!
                    266:   I implemented atexit() (can register up to 4 callbacks).
                    267:   I implemented strtod and __dtostr (the opposite).  Now we can add
                    268:     floating point support to vsnprintf and sscanf!
                    269: 
                    270: 0.5.10:
                    271:   I actually saw that I can not only merge the errno handling code of
                    272:     the system calls on x86, I can also merge the rest (including the
                    273:     arguments) except for setting the system call number.  All those
                    274:     system calls are now just a jump to a unified system call handler.
                    275:     I got rid of x86openclose again.  The savings are substantial:
                    276:     chown from embutils went from 7664 to 7184 bytes!
                    277:     If I'd move the system call wrappers to assembly language, I could
                    278:     even reduce the alignment (does not matter since it's just a jump
                    279:     anyway) and get rid of the "ret" behind each jump (one byte per
                    280:     system call!)
                    281: 
                    282: 0.5.9:
                    283:   added memchr, strpbrk, strstr, strtol, isspace (hehe)
                    284:   fixed strdup
                    285:   fixed return values for strcpy and strcat (thanks to Norbert Berzen)
                    286:   Olaf Dreesen contributed a strtol and initial {sn|vsn|}printf implementation
                    287:     (no signed integers, only strings and unsigned integers (but
                    288:     supporting octal, hex and decimal).  Thanks, Olaf!  (by the way:
                    289:     that code must be wonderful, I don't understand it at all *bg*)
                    290:     Olaf's printf does understand padding like in "%08d" and "%8d" and
                    291:     automatically pads pointers with '0'.
                    292:   Rewrote the x86 start code, old: 22 instructions, new: 12 instructions.
                    293:   Thanks to proton for inspiration on this.
                    294:   The new x86 start code also does not reference exit any more, thus saving
                    295:   64 bytes for executables that don't call exit explicitly.
                    296:     [insert maniacal laughter] EVERY BYTE COUNTS!1!! ;-)
                    297:   Moved errno and environ to start.S, saving no byte binary size but
                    298:     speeding up compilation and slightly shortening dietlibc.a ;-)
                    299:   For x86: joined open and close into one assembler file, sharing the
                    300:     errno handling.  This is a feasibility test and it actually saves a
                    301:     few bytes.  I think I will reimplement the _syscall[1-6] macros on
                    302:     all platforms now to share the errno handling code for them.
                    303: 
                    304: 0.5.8:
                    305:   fixed strchr to be able to look for 0.
                    306: 
                    307:   added _llseek, ftruncate, getpgid, getresgid, getresuid, getsid,
                    308:   memccpy, memmove, mprotect, setregid, setresgid, setresuid, setreuid,
                    309:   strncpy, swapon, truncate, strtok, strtok_r, strspn, strcspn (all
                    310:   contributed by Olaf Dreesen)
                    311: 
                    312:   added execvp, getcwd
                    313: 
                    314:   fixed __xmknod
                    315: 
                    316:   Note: can it be that the ftw interface really is so broken that I
                    317:   cannot implement it without having to implement some searching data
                    318:   structure?  I included an experimental ftw implementation that will
                    319:   not follow symlinks.
                    320: 
                    321: 0.5.7:
                    322:   oops, if_nametoindex was broken!
                    323: 
                    324: 0.5.6:
                    325:   ported to ppc-linux.
                    326:   fixed i386 sigsetjmp (I mistyped the function name)
                    327:   included sigjmp.c
                    328: 
                    329: 0.5.5:
                    330:   added wait, sys_siglist, longjmp/setjmp/sigsetjmp for i386 and sparc
                    331:   actually, it wasn't fork that wasn't working for sparc, it was pipe.
                    332:   I fixed it now.
                    333:   dietlibc/SPARC assumes -msupersparc (does not provide div, mul, etc)
                    334:   fixed readdir to use getdents and not the intel inline asm
                    335: 
                    336: 0.5.4:
                    337:   ported to sparclinux (sparc32 only).  Beware: does not work yet.
                    338:   added raise, abort, readlink, strcat, geteuid, geteuid, wait3, access
                    339: 
                    340: 0.5.3:
                    341:   added tcsetattr and getenv to compile e3
                    342: 
                    343: 0.5.2:
                    344:   added vhangup, tcgetattr, isatty and memcmp for fgetty
                    345:     (http://www.fefe.de/fgetty/)
                    346:   added localtime from uC-libc.
                    347: 
                    348: 0.5.1:
                    349:   stat and friends actually work now.  Yuck!  Another case of
                    350:     translation between kernel and userland.  Why can't the kernel
                    351:     people and the libc people simply agree on a standard?
                    352:   removed many unnecessary includes to speed up compilation.
                    353:   added -fomit-frame-pointer and i386 compilation target to reduce code size.
                    354:   inlined socketcall to reduce code size.
                    355:   "load" and "compile" are examples for djb code.
                    356: 
                    357: 0.5:
                    358:   Olaf Dreesen contributed a much smaller implementation of malloc and friends.
                    359:   each object file is now treated with "strip -x -R .note -R .comment"
                    360:   split each system call into a separate object file
                    361:   added ntohs, htons, alarm, if_indextoname and if_nametoindex
                    362: 
                    363: 0.4.1:
                    364:   oops, the strchr implementation was wrong.  Thanks Jens Laas!
                    365: 
                    366: 0.4:
                    367:   copied opendir and friends from uC-libc.
                    368:   added getservent and getservby* in gerservent.c
                    369: 
                    370: 0.3:
                    371:   remove readdir system call
                    372:   added getdents system call
                    373:   added getpwnam/getpwuid implementation in getpwnam.c
                    374:   added a few string functions (in str*.c)
                    375: 

LinuxTV legacy CVS <linuxtv.org/cvs>