Skip to content

Commit

Permalink
Revert "posix: device_io: implement fileno()"
Browse files Browse the repository at this point in the history
This reverts commit 48dff55.

PR zephyrproject-rtos#73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
zephyrproject-rtos#75205

Signed-off-by: Alberto Escolar Piedras <[email protected]>
  • Loading branch information
aescolar authored and nashif committed Jul 3, 2024
1 parent ade54b3 commit 9f38377
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
10 changes: 0 additions & 10 deletions lib/os/fdtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,6 @@ FILE *zvfs_fdopen(int fd, const char *mode)
return (FILE *)&fdtable[fd];
}

int zvfs_fileno(FILE *file)
{
if (!IS_ARRAY_ELEMENT(fdtable, file)) {
errno = EBADF;
return -1;
}

return (struct fd_entry *)file - fdtable;
}

int zvfs_fstat(int fd, struct stat *buf)
{
if (_check_fd(fd) < 0) {
Expand Down
6 changes: 0 additions & 6 deletions lib/posix/options/device_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
/* prototypes for external, not-yet-public, functions in fdtable.c or fs.c */
int zvfs_close(int fd);
FILE *zvfs_fdopen(int fd, const char *mode);
int zvfs_fileno(FILE *file);
int zvfs_open(const char *name, int flags);
ssize_t zvfs_read(int fd, void *buf, size_t sz, size_t *from_offset);
ssize_t zvfs_write(int fd, const void *buf, size_t sz, size_t *from_offset);
Expand Down Expand Up @@ -53,11 +52,6 @@ FILE *fdopen(int fd, const char *mode)
return zvfs_fdopen(fd, mode);
}

int fileno(FILE *file)
{
return zvfs_fileno(file);
}

int open(const char *name, int flags, ...)
{
/* FIXME: necessarily need to check for O_CREAT and unpack ... if set */
Expand Down

0 comments on commit 9f38377

Please sign in to comment.