Skip to content

Commit

Permalink
posix: options: fs: move posix_fs_desc to fs_priv.h
Browse files Browse the repository at this point in the history
Move struct posix_fs_desc to fs_priv.h

Signed-off-by: Chris Friedt <[email protected]>
  • Loading branch information
cfriedt authored and kartben committed Jan 2, 2025
1 parent e967120 commit 00a8818
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/posix/options/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L

#include "fs_priv.h"

#include <errno.h>
#include <zephyr/kernel.h>
#include <limits.h>
Expand All @@ -21,15 +24,6 @@ int zvfs_fstat(int fd, struct stat *buf);

BUILD_ASSERT(PATH_MAX >= MAX_FILE_NAME, "PATH_MAX is less than MAX_FILE_NAME");

struct posix_fs_desc {
union {
struct fs_file_t file;
struct fs_dir_t dir;
};
bool is_dir;
bool used;
};

static struct posix_fs_desc desc_array[CONFIG_POSIX_OPEN_MAX];

static struct fs_dirent fdirent;
Expand Down
23 changes: 23 additions & 0 deletions lib/posix/options/fs_priv.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2018 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef ZEPHYR_LIB_POSIX_OPTIONS_FS_PRIV_H_
#define ZEPHYR_LIB_POSIX_OPTIONS_FS_PRIV_H_

#include <stdbool.h>

#include <zephyr/fs/fs.h>

struct posix_fs_desc {
union {
struct fs_file_t file;
struct fs_dir_t dir;
};
bool is_dir: 1;
bool used: 1;
};

#endif

0 comments on commit 00a8818

Please sign in to comment.