易截截图软件、单文件、免安装、纯绿色、仅160KB

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:


相关问答:

linux环境下gethostbyname函数问题 - C/C++ / C语言

写了个测试程序如下
   
  struct hostent *hp; 
char AlarmDevIP[20];  
  int x2;

hp = gethostbyname("www.google.com");
if (hp)
{ ......

Web工程放到linux服务器上出现错误

出现这个错误。不知道是我代码的问题还是服务器的问题。
javax.servlet.ServletException: unable to create new native thread
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageConte ......

linux redhat怎么重装服务

我在安装redhat9的时候有些服务没选,比如samba,http,ntfs,telnet现在不想重装系统了,请问该怎么做?
我在添加/删除应用程序中装了samba,但是重启之后,在“系统设置-服务器设置”中怎么还没出现samba服务器 ......

linux c语言中的chmod函数

chmod中的mode_t参数,如何动态的传入值,例如 我要传入0777或0444,但我输入的是字符串 怎么转化为8进制
每个模式均预定义有宏,又因为其实可选分支有限,你可以判断输入得字符串,使用swicth之类得办法,给一临时 ......

linux 下 mysql 数据库删除命令

mysqladmin -u root  drop 数据库名
这样删除会要求按y 确定
有没有参数加在后面 让我不用按y确认也可以删除
mysql -u root -e "drop databse 数据库名"

SQL code:
mysql> drop datab ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号