|
From: Stephen M.
|
>>>>> "NN" == Nicholas Nethercote <nj...@cs...> writes: NN> On Fri, 24 Feb 2006, Stephen McCamant wrote: SMcC> One potentially significant difference is that we still link SMcC> with glibc (I get the impression that's discouraged, but we're SMcC> loathe to give up fprintf() and friends), now statically. NN> What does fprintf() do that you need that VG_(printf)() doesn't? The usual, printing to file descriptors other than 2. So, you might ask, what does fprintf() do that VG_(sprintf)() and VG_(write)() don't? Buffering, though we haven't actually measured the speed difference. In general, there's nothing we're currently getting from glibc that couldn't be reimplemented on top of the primitives Valgrind provides, and we'd like to go in that direction eventually, but we're waiting for a reason that makes it worth the effort, and we haven't found one yet. In fact, I just checked now the list of symbols we're using from glibc (shown below). It's even longer than I'd remembered, and it includes a number of functions that have perfectly good VG_()() versions. (Many of them probably come from the readelf code that we've assimilated without much editing.) _IO_putc __assert_fail __ctype_b_loc __errno_location _exit abort atoi calloc close dup dup2 execv fclose fcntl fdopen fflush fgets fopen fopen64 fork fprintf fputc fputs fread free fscanf fseek ftell fwrite getenv getopt_long gmtime mkdir mkfifo open64 optarg pipe printf putchar puts remove setvbuf sprintf stat stderr stdout strerror strncpy strstr strtok strtoul tfind tsearch vfprintf waitpid -- Stephen |