linux程序打不开头文件
#include <fcnt1.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc,char *argv[])
{
int fd_open,fd_open_create,fd_create;
if((fd_open=open("/home/wang/test/hello.c",O_RDONLY))==-1)
{
perror("open");
exit(EXIT_FAILURE);
}
printf("the file's descriptor is:%d\n",fd_open);
if((fd_open_create==open("./tmp1",O_CREAT|O_EXCL,0644))==-1)
{
perrno("open");
exit(EXIT_FAILURE);
}
printf("the tmp1 file descriptor is:%d\n",fd_open_create);
if((fd_create=creat("./tem2",0644))==-1)
{
perrno("create");
exit(EXIT_FAILURE);
}
printf("the tmp2 file descriptor is:%d\n",fd_create);
close(fd_open);
close(fd_create);
close(fd_open_create);
return 0;
}
编译结果
wangjun@my-desktop:~/test$ gcc -ggdb3 -o open_example open_example.c
open_example.c:1:19: 错误: fcnt1.h:没有该文件或目录
open_example.c: 在函数‘main’中:
open_example.c:8:
相关问答:
目标:当网络中有数据到达或者超时,程序进入下一次循环。
问题:select()函数不起作用,程序不会在select的地方阻塞一秒,并且当网络上有数据的时候,select的返回值仍然小于0
#include <s ......
大家好,本人目前刚刚接触Linux。现在公司的项目需要缩减Linux的Kernel和APP部分的Code Size。目前我们使用的是Linux2.6.22.15版本,应用于ADSL Modem(家庭网关)。
1.我们产品应用是ADSL Gateway,Kernel部 ......
现在的做法是,通过crontab每分钟执行一个php,这个php负责从数据库中取出邮件,然后发送
问题是,如果邮件很多,每分钟执行不完,那会造成很多php进程
能不能实现等这个php执行完了立即启动一个新的?不用cr ......
我要修改一个Linux程序中的一个字符串,目的串比原来的长,所以直接替换程序无法运行,要怎么办才能使程序正常运行?
不明白你要干什么 改什么程序?
一个手机上的模拟器,本来是在/mmc/mmca1下创建Roms文件夹, ......
我现在用的是dpch 进行配置的
Perl code:
abc ~ # ifconfig
eth0 Link encap:Ethernet HWaddr 00:1e:ec:c1:94:75
inet addr:10.2.0.144 Bcast:10.2.1.255 Mask:255.255.254.0
......