提交 235707bf 编写于 作者: C Caoruihong

chore: support turn off vfs

it will compile fail if vfs is turned off, we fixed it.
Signed-off-by: NCaoruihong <crh.cao@huawei.com>
Change-Id: If2de8c814541e39d491ea6189720aeb05a19e2e9
上级 b17cf305
......@@ -15,9 +15,14 @@ extern "C" {
#include <bits/alltypes.h>
#include <signal.h>
#ifdef LOSCFG_FS_VFS
#include "vfs_config.h"
/* FD_SETSIZE is defined in "vfs_config.h" */
#else
#define FD_SETSIZE 512
#define FD_SET_TOTAL_SIZE FD_SETSIZE
#endif
typedef unsigned long fd_mask;
......
......@@ -35,6 +35,7 @@
void _exit(int status) {
PRINT_ERR("%s NOT SUPPORT\n", __FUNCTION__);
errno = ENOSYS;
while (1);
}
void exit(int status) {
......
......@@ -2,6 +2,7 @@
#include <unistd.h>
#include <sys/types.h>
#include <dirent.h>
#ifdef LOSCFG_FS_VFS
#include <fs/fs.h>
static off64_t __stdio_lseek64(int fd, int offsetHigh, int offsetLow, off64_t *result, int whence)
......@@ -53,3 +54,4 @@ off_t __stdio_seek(FILE *f, off_t off, int whence)
off_t result = 0;
return __stdio_lseek64(f->fd, off>>32, off, &result, whence) ? -1 : result;
}
#endif
......@@ -3,8 +3,6 @@
#ifdef LOSCFG_LLTSER
#include "gcov_ser.h"
#endif
#include "fs/fs.h"
#include "fs/file.h"
static void dummy(FILE *f) { }
weak_alias(dummy, __unlist_locked_file);
......
......@@ -7,8 +7,6 @@
#ifdef LOSCFG_LLTSER
#include "gcov_ser.h"
#endif
#include "fs/fs.h"
#include "fs/file.h"
FILE *fopen(const char *restrict filename, const char *restrict mode)
{
......
......@@ -3,8 +3,6 @@
#ifdef LOSCFG_LLTSER
#include "gcov_ser.h"
#endif
#include "fs/fs.h"
#include "fs/file.h"
#define MIN(a,b) ((a)<(b) ? (a) : (b))
......
......@@ -2,8 +2,6 @@
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include "fs/fs.h"
#include "fs/file.h"
int remove(const char *path)
{
......
......@@ -448,6 +448,7 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg,
int t, pl;
wchar_t wc[2], *ws;
char mb[4];
#ifdef LOSCFG_FS_VFS
struct winsize wsz;
if (f && (f->write == __stdout_write) && !ioctl(f->fd, TIOCGWINSZ, &wsz)) {
......@@ -456,6 +457,7 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg,
f->wpos = f->wbase = f->buf;
f->wend = f->buf + f->buf_size;
}
#endif
for (;;) {
/* This error is only specified for snprintf, but since it's
* unspecified for other forms, do the same. Stop immediately
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册