mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Added "fstat_stdout_test".
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14939 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
36
test_programs/fstat_stdout_test.c
Normal file
36
test_programs/fstat_stdout_test.c
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* $Id: fstat_stdout_test.c,v 1.1 2005-05-08 16:27:25 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*/
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
int
|
||||
main(int argc,char ** argv)
|
||||
{
|
||||
struct stat st;
|
||||
int fd;
|
||||
|
||||
fd = dup(STDOUT_FILENO);
|
||||
if(fd < 0)
|
||||
{
|
||||
perror("dup(STDOUT_FILENO)");
|
||||
return(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if(fstat(fd,&st) < 0)
|
||||
{
|
||||
perror("fstat(fd,&st)");
|
||||
return(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
Reference in New Issue
Block a user