Changeset 76d6169 in mainline
- Timestamp:
- 2011-08-18T16:05:58Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cdc8ee2d
- Parents:
- 221ab41a
- Location:
- uspace/lib/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/io.c
r221ab41a r76d6169 104 104 { 105 105 if (filc > 0) { 106 stdin = f open_handle(0);106 stdin = fdopen(0, "r"); 107 107 } else { 108 108 stdin = &stdin_null; … … 111 111 112 112 if (filc > 1) { 113 stdout = f open_handle(1);113 stdout = fdopen(1, "w"); 114 114 } else { 115 115 stdout = &stdout_klog; … … 118 118 119 119 if (filc > 2) { 120 stderr = f open_handle(2);120 stderr = fdopen(2, "w"); 121 121 } else { 122 122 stderr = &stderr_klog; … … 285 285 } 286 286 287 FILE *fopen_handle(int fd)288 {289 /* Open file. */290 FILE *stream = malloc(sizeof(FILE));291 if (stream == NULL) {292 errno = ENOMEM;293 return NULL;294 }295 296 stream->fd = fd;297 stream->error = false;298 stream->eof = false;299 stream->klog = false;300 stream->sess = NULL;301 stream->need_sync = false;302 _setvbuf(stream);303 304 list_append(&stream->link, &files);305 306 return stream;307 }308 309 287 int fclose(FILE *stream) 310 288 { -
uspace/lib/c/include/vfs/vfs.h
r221ab41a r76d6169 52 52 extern int unmount(const char *); 53 53 54 extern FILE *fopen_handle(int);55 54 extern int fhandle(FILE *, int *); 56 55
Note:
See TracChangeset
for help on using the changeset viewer.