Changes in uspace/lib/posix/stdio.c [9b1503e:ab547063] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/stdio.c
r9b1503e rab547063 1 1 /* 2 2 * Copyright (c) 2011 Jiri Zarevucky 3 * Copyright (c) 2011 Petr Koupy4 3 * All rights reserved. 5 4 * … … 34 33 */ 35 34 36 #define LIBPOSIX_INTERNAL35 #define POSIX_INTERNAL 37 36 38 37 #include <assert.h> 39 #include <errno.h> 40 41 #include "internal/common.h" 38 #include "errno.h" 39 #include "common.h" 42 40 #include "stdio.h" 43 41 #include "string.h" 44 45 42 /* not the best of solutions, but freopen will eventually 46 * need to be implemented in libc anyway 47 */ 43 need to be implemented in libc anyway */ 48 44 #include "../c/generic/private/stdio.h" 49 45 50 /** 51 * 52 * @param c 53 * @param stream 54 * @return 55 */ 56 int posix_ungetc(int c, FILE *stream) 57 { 58 // TODO 59 not_implemented(); 60 } 61 62 /** 63 * 64 * @param filename 65 * @param mode 66 * @param stream 67 * @return 68 */ 69 FILE *posix_freopen( 70 const char *restrict filename, 71 const char *restrict mode, 72 FILE *restrict stream) 46 FILE *posix_freopen(const char *restrict filename, 47 const char *restrict mode, 48 FILE *restrict stream) 73 49 { 74 50 assert(mode != NULL); … … 79 55 80 56 /* print error to stderr as well, to avoid hard to find problems 81 * with buggy apps that expect this to work 82 */ 83 fprintf(stderr, 84 "ERROR: Application wants to use freopen() to change mode of opened stream.\n" 85 " libposix does not support that yet, the application may function improperly.\n"); 57 with buggy apps that expect this to work */ 58 fprintf(stderr, "ERROR: Application wants to use freopen() to change mode of opened stream.\n" 59 " libposix does not support that yet, the application may function improperly.\n"); 86 60 errno = ENOTSUP; 87 61 return NULL; … … 94 68 } 95 69 memcpy(copy, stream, sizeof(FILE)); 96 fclose(copy); /* copy is now freed */70 fclose(copy); /* copy is now freed */ 97 71 98 copy = fopen(filename, mode); /* open new stream */72 copy = fopen(filename, mode); /* open new stream */ 99 73 if (copy == NULL) { 100 74 /* fopen() sets errno */ … … 113 87 } 114 88 115 /**116 *117 * @param s118 */119 89 void posix_perror(const char *s) 120 {121 // TODO122 not_implemented();123 }124 125 /**126 *127 * @param stream128 * @param offset129 * @param whence130 * @return131 */132 int posix_fseeko(FILE *stream, posix_off_t offset, int whence)133 {134 // TODO135 not_implemented();136 }137 138 /**139 *140 * @param stream141 * @return142 */143 posix_off_t posix_ftello(FILE *stream)144 {145 // TODO146 not_implemented();147 }148 149 /**150 *151 * @param s152 * @param format153 * @param ...154 * @return155 */156 int posix_sprintf(char *s, const char *format, ...)157 {158 // TODO159 not_implemented();160 }161 162 /**163 *164 * @param s165 * @param format166 * @param ...167 * @return168 */169 int posix_sscanf(const char *s, const char *format, ...)170 90 { 171 91 // TODO … … 175 95 /** @} 176 96 */ 97
Note:
See TracChangeset
for help on using the changeset viewer.