No subject
Tue Apr 3 04:48:41 UTC 2007
programming in general, the standard library functions are better. With
the exception of OS/2 Warp, the C standard library is standard across
platforms (meaing, yes there are platform-specific extensions, but the
stdlib functions will be the same/work the same)--especially platforms
billed as being POSIX-compliant.
Unix system calls may be a smidge quicker wrt execution time. However,
they are a pain to use in many cases, and in most cases, you're not
going to write code which is better written than the stdlib functions.
This is because the stdlib functions are basically wrappers around the
system calls. If you look at the glibc code for 'fopen()'--a stdlib
call, for example, you'll see that it eventually calls 'open()'--a
system call. Also, some (most?) of the stdlib I/O functions are
buffered--meaning less time spent bringing in the next chunk of data
from the file/device/socket/whatever.
IMHO, considering the various tradeoffs between using the stdlib vs.
system calls, there isn't really much difference as far as speed goes.
But the stdlib program will be a helluva lot easier to maintain and
port!
--
Matthew Vanecek
perl -e 'print
$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
********************************************************************************
For 93 million miles, there is nothing between the sun and my shadow
except me.
I'm always getting in the way of something...
More information about the linuxCprogramming
mailing list