标题:fcntl() function question?
取消只看楼主
Linux_good
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-6-21
 问题点数:0 回复次数:1 
fcntl() function question?
why? follow program output: fd = 0.

#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
int fd;

if ((fd = fcntl(STDOUT_FILENO, F_GETFD, 0)) == -1)
{
printf("fcntl error.\n");
}

printf("fd = %d\n", fd);

exit(0);
}

I think output: fd = 1. where error?
搜索更多相关主题的帖子: function question include follow 
2006-06-22 15:18
Linux_good
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-6-21
得分:0 
compiler cc or gcc
2006-06-22 16:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-74104-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.764551 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved