改用io.h,如果有的话。
Low-level I/O
These functions invoke the operating system directly for lower-level operation than that provided by stream I/O. Low-level input and output calls do not buffer or format data.
Low-level routines can access the standard streams opened at program startup using the following predefined handles:
Stream Handle
stdin 0
stdout 1
stderr 2
Low-level I/O routines set the errno global variable when an error occurs. You must include STDIO.H when you use low-level functions only if your program requires a constant that is defined in STDIO.H, such as the end-of-file indicator (EOF).
Low-Level I/O Functions
Function Use
_close Close file
_commit Flush file to disk
_creat, _wcreat Create file
_dup Return next available file handle for given file
_dup2 Create second handle for given file
_eof Test for end of file
_lseek, _lseeki64 Reposition file pointer to given location
_open, _wopen Open file
_read Read data from file
_sopen, _wsopen Open file for file sharing
_tell, _telli64 Get current file-pointer position
_umask Set file-permission mask
_write Write data to file
_dup and _dup2 are typically used to associate the predefined file handles with different files.
编译信息如下
[LD] Bin_R2_M10_ATV_ZUI_MM_64/AP.elf
/home/mstar/opt/aeon/bin/../lib/gcc/aeon/4.1.2/../../../../aeon/lib/aeonR2/el/libc.a(glue.o): In function `_sbrk':
/home/ahsieh/aeon/build-aeon-gcc-4.1.2/aeon/aeonR2/el/newlib/libc/sys/aeonsim/../../../../../../../../gcc-4.1.2/newlib/libc/sys/aeonsim/glue.c:144: undefined reference to `___stack_base'
/home/ahsieh/aeon/build-aeon-gcc-4.1.2/aeon/aeonR2/el/newlib/libc/sys/aeonsim/../../../../../../../../gcc-4.1.2/newlib/libc/sys/aeonsim/glue.c:144: undefined reference to `___stack_base'
/home/ahsieh/aeon/build-aeon-gcc-4.1.2/aeon/aeonR2/el/newlib/libc/sys/aeonsim/../../../../../../../../gcc-4.1.2/newlib/libc/sys/aeonsim/glue.c:144: undefined reference to `___stack_size'
/home/ahsieh/aeon/build-aeon-gcc-4.1.2/aeon/aeonR2/el/newlib/libc/sys/aeonsim/../../../../../../../../gcc-4.1.2/newlib/libc/sys/aeonsim/glue.c:144: undefined reference to `___stack_size'
/home/ahsieh/aeon/build-aeon-gcc-4.1.2/aeon/aeonR2/el/newlib/libc/sys/aeonsim/../../../../../../../../gcc-4.1.2/newlib/libc/sys/aeonsim/glue.c:140: undefined reference to `_end'
/home/ahsieh/aeon/build-aeon-gcc-4.1.2/aeon/aeonR2/el/newlib/libc/sys/aeonsim/../../../../../../../../gcc-4.1.2/newlib/libc/sys/aeonsim/glue.c:140: undefined reference to `_end'
collect2: ld returned 1 exit status
make: *** [Bin_R2_M10_ATV_ZUI_MM_64/AP.elf] Error 1
改用io.h,如果有的话。
Low-level I/O
These functions invoke the operating system directly for lower-level operation than that provided by stream I/O. Low-level input and output calls do not buffer or format……
[/Quote]