Browse Source

Revert "posix: device_io: implement fdopen()"

This reverts commit 581a0f56e6.

PR #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
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
pull/75552/head
Alberto Escolar Piedras 1 year ago committed by Anas Nashif
parent
commit
a111cec63d
  1. 11
      lib/os/fdtable.c
  2. 7
      lib/posix/options/device_io.c

11
lib/os/fdtable.c

@ -403,17 +403,6 @@ int zvfs_close(int fd) @@ -403,17 +403,6 @@ int zvfs_close(int fd)
return res;
}
FILE *zvfs_fdopen(int fd, const char *mode)
{
ARG_UNUSED(mode);
if (_check_fd(fd) < 0) {
return NULL;
}
return (FILE *)&fdtable[fd];
}
int zvfs_fstat(int fd, struct stat *buf)
{
if (_check_fd(fd) < 0) {

7
lib/posix/options/device_io.c

@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
*/
#include <stddef.h>
#include <stdio.h>
#include <stdint.h>
#include <zephyr/posix/poll.h>
@ -14,7 +13,6 @@ @@ -14,7 +13,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_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);
@ -47,11 +45,6 @@ int close(int fd) @@ -47,11 +45,6 @@ int close(int fd)
FUNC_ALIAS(close, _close, int);
#endif
FILE *fdopen(int fd, const char *mode)
{
return zvfs_fdopen(fd, mode);
}
int open(const char *name, int flags, ...)
{
/* FIXME: necessarily need to check for O_CREAT and unpack ... if set */

Loading…
Cancel
Save