diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-08-16 15:55:19 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-08-16 15:55:19 -0400 |
commit | e223e635cc53fa11e473cdbc864eb69a3da5f290 (patch) | |
tree | d481ca6fb0b7f4184f3ec259a6f9c37d76e56a26 /src/stdio/fopen_s.c | |
parent | 700fbd205a1a428677876d322606b9a354221892 (diff) |
add skeleton of symbols from C11 LIB_EXT1
Diffstat (limited to 'src/stdio/fopen_s.c')
-rw-r--r-- | src/stdio/fopen_s.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/stdio/fopen_s.c b/src/stdio/fopen_s.c new file mode 100644 index 00000000..59385515 --- /dev/null +++ b/src/stdio/fopen_s.c @@ -0,0 +1,55 @@ +#include "stdio.h" +#include "__stdio.h" +#include <string.h> +#include <stdlib.h> +#include <fcntl.h> +#include <unistd.h> + +/** open a file stream **/ +errno_t fopen_s(FILE * restrict * restrict streamptr, + const char * restrict filename, + const char * restrict mode); +{ + __C_EXT(1, 201112L); + return 0; +} + +/*** +The fn(fopen) function opens a file stream associated with the file +arg(filename). + +The type of file and allowed operations are determined by arg(mode): + +string(r) text file; read-only +string(w) text file; write-only; truncate to 0 bytes +string(a) text file; append +string(rb) binary file; read-only +string(wb) binary file; write-only; truncate to 0 bytes +string(ab) binary file; append +string(r+) text file; update (read and write) +string(w+) text file; update (read and write); truncate to 0 bytes +string(a+) text file; update (read and write); append data to end of file +string(r+b) binary file; update (read and write) +string(rb+) binary file; update (read and write) +string(w+b) binary file; update (read and write); truncate to 0 bytes +string(wb+) binary file; update (read and write); truncate to 0 bytes +string(a+b) binary file; update (read and write); append data to end of file +string(ab+) binary file; update (read and write); append data to end of file + +File streams are opened in fully buffered mode if and only if arg(filename) is +not an interactive device. + +The error and end-of-file indicators are cleared. +***/ + +/* UNSPECIFIED: - */ +/* UNDEFINED: - */ +/* IMPLEMENTATION: - */ +/* LOCALE: - */ + +/* RETURN(NULL): failure */ +/* RETURN: a pointer to the new file stream */ + +/* +CEXT1(201112) +*/ |