Get a copy of K&R's The C Programming Language while you're at it, since it helps a lot with understanding how standard string and IO functions work.
So what C Library are you trying to port? There's several open source implementations out there, and they shouldn't be expected to work if you mix code from them.
EDIT: Oh, Linux. So you're probably trying to port glibc. You can find the full source code via anonymous FTP at ftp://ftp.gnu.org/gnu/glibc/ or HTTP at http://ftp.gnu.org/gnu/glibc/
The latest release is: http://ftp.gnu.org/gnu/glibc/glibc-2.3.5.tar.bz2
And the Porting guide: http://www.gnu.org/software/libc/manual/html_node/Porting.html
Consider trying newlib while you're at it:
http://sourceware.org/newlib/
It's a much smaller standard C library implementation designed for use with GCC and embedded systems.
So what C Library are you trying to port? There's several open source implementations out there, and they shouldn't be expected to work if you mix code from them.
EDIT: Oh, Linux. So you're probably trying to port glibc. You can find the full source code via anonymous FTP at ftp://ftp.gnu.org/gnu/glibc/ or HTTP at http://ftp.gnu.org/gnu/glibc/
The latest release is: http://ftp.gnu.org/gnu/glibc/glibc-2.3.5.tar.bz2
And the Porting guide: http://www.gnu.org/software/libc/manual/html_node/Porting.html
Consider trying newlib while you're at it:
http://sourceware.org/newlib/
It's a much smaller standard C library implementation designed for use with GCC and embedded systems.