1
0
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:
Olaf Barthel
2005-05-08 16:27:25 +00:00
parent 89b568bcb8
commit 2be60de3e7
4 changed files with 58 additions and 8 deletions

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.68k,v 1.5 2005-03-03 15:12:18 obarthel Exp $
# $Id: GNUmakefile.68k,v 1.6 2005-05-08 16:27:25 obarthel Exp $
#
# :ts=8
#
@ -47,11 +47,11 @@ LIBS = -lm -lc -lgcc
##############################################################################
all: test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test \
translate_test strtok_test uname simple
translate_test strtok_test uname simple fstat_stdout_test
clean:
$(DELETE) #?.o #?.map test fgets_test iotest sscanf_test printf_test sprintf_test \
stack_size_test translate_test strtok_test uname simple
stack_size_test translate_test strtok_test uname simple fstat_stdout_test
##############################################################################
@ -99,6 +99,10 @@ simple : simple.o
@echo "Linking $@"
$(CC) $(CFLAGS) -o $@ simple.o $(LIBS) -Wl,--cref,-M,-Map=$@.map
fstat_stdout_test : fstat_stdout_test.o
@echo "Linking $@"
$(CC) $(CFLAGS) -o $@ fstat_stdout_test.o $(LIBS) -Wl,--cref,-M,-Map=$@.map
##############################################################################
mkid:

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.os4,v 1.5 2005-03-03 15:12:18 obarthel Exp $
# $Id: GNUmakefile.os4,v 1.6 2005-05-08 16:27:25 obarthel Exp $
#
# :ts=8
#
@ -39,11 +39,11 @@ LIBS = -lm -lc
##############################################################################
all: test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test \
translate_test strtok_test uname simple
translate_test strtok_test uname simple fstat_stdout_test
clean:
$(DELETE) *.o *.map test fgets_test iotest sscanf_test printf_test sprintf_test \
stack_size_test translate_test strtok_test uname simple
stack_size_test translate_test strtok_test uname simple fstat_stdout_test
##############################################################################
@ -90,3 +90,7 @@ uname : uname.o
simple : simple.o
@echo "Linking $@"
$(CC) $(CFLAGS) -o $@ simple.o $(LIBS) -Wl,--cref,-M,-Map=$@.map
fstat_stdout_test : fstat_stdout_test.o
@echo "Linking $@"
$(CC) $(CFLAGS) -o $@ fstat_stdout_test.o $(LIBS) -Wl,--cref,-M,-Map=$@.map

View 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);
}

View File

@ -1,5 +1,5 @@
#
# $Id: smakefile,v 1.5 2005-03-03 15:12:18 obarthel Exp $
# $Id: smakefile,v 1.6 2005-05-08 16:27:25 obarthel Exp $
#
# :ts=8
#
@ -65,7 +65,8 @@ AFLAGS = \
all: \
setup \
test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test translate_test strtok_test uname simple \
test fgets_test iotest sscanf_test printf_test sprintf_test \
stack_size_test translate_test strtok_test uname simple fstat_stdout_test \
cleanup
clean:
@ -138,6 +139,11 @@ simple: simple.o
@slink $(LIB)startup.o simple.o to $@ lib $(LIB)c.lib addsym \
map $@.map,fhx fwidth 32 pwidth 32 swidth 32
fstat_stdout_test: fstat_stdout_test.o
@echo "Linking $@"
@slink $(LIB)startup.o fstat_stdout_test.o to $@ lib $(LIB)c.lib addsym \
map $@.map,fhx fwidth 32 pwidth 32 swidth 32
##############################################################################
mkid: