truncate can do inplace trimming and has a better syntax than dd. An old implementation is here: http://svn0.us-west.freebsd.org/base/head/usr.bin/truncate/truncate.c It is based on the POSIX function "ftruncate" http://pubs.opengroup.org/onlinepubs/009695399/functions/ftruncate.html
GNU coreutils provides truncate and has for a while now. its interface: http://www.gnu.org/software/coreutils/truncate
the applet was added since v1.24.0, but the current implementation is missing the "-r RFILE" switch and does not support size prefixes like "-20" (= reduce by 20 bytes) that are quite useful imo (you can still workaround that using command substitutions btw).