为什么cc编译通过而CC编译通不过
Dlf 2002-03-07 05:41:27 #include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
int main()
{
int fd = shm_open("/SCADA", O_RDWR | O_CREAT, (mode_t)0x740);
if(fd < 0)
return -1;
ftruncate(fd, 1024);
void* ptr = mmap(NULL, 1024, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
}
/*
[sunwsa]CC shm.cpp -o shm -lrt
"shm.cpp", line 7: Error: The function "shm_open" must have a prototype.
1 Error(s) detected.
[sunwsa]
*/
用cc编译通过,CC编译出现上述错误,why?
环境:Sun solaris 7