stdlib: add fileno (DONE)

This commit is contained in:
Lephenixnoir 2022-09-07 21:02:01 +02:00
parent 26e54af8e0
commit 95e33092ec
Signed by untrusted user: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
4 changed files with 9 additions and 0 deletions

View File

@ -112,6 +112,7 @@ set(SOURCES
src/stdio/fgetc.c
src/stdio/fgetpos.c
src/stdio/fgets.c
src/stdio/fileno.c
src/stdio/fileutil.c
src/stdio/fopen.c
src/stdio/fprintf.c

1
STATUS
View File

@ -99,6 +99,7 @@ TEST: Function/symbol/macro needs to be tested
7.19.5.4 freopen -
7.19.5.5 setbuf -
7.19.5.6 setvbuf -
(EXT) fileno -
7.19.6.1 fprintf -
7.19.6.2 fscanf TODO

View File

@ -187,6 +187,7 @@ extern void setbuf(FILE * __restrict__ __fp, char * __restrict__ __buf);
extern int setvbuf(FILE * __restrict__ __fp, char * __restrict__ __buf,
int __mode, size_t __size);
/* Return the file descriptor associated with __fp. */
extern int fileno(FILE *__fp);
/*

6
src/stdio/fileno.c Normal file
View File

@ -0,0 +1,6 @@
#include <stdio.h>
int fileno(FILE *fp)
{
return fp->fd;
}