diff --git a/components/libc/getline/README.md b/components/libc/getline/README.md index 8f52898c82..3ba5a96b3d 100644 --- a/components/libc/getline/README.md +++ b/components/libc/getline/README.md @@ -1,4 +1,4 @@ -# getline/getdelim for RT-Thread POSIX +# getline/getdelim for RT-Thread POSIX(IEEE Std 1003.1-2008) [![Build Status](https://travis-ci.org/ivanrad/getline.svg?branch=master)](https://travis-ci.org/ivanrad/getline) diff --git a/components/libc/getline/posix_getline.c b/components/libc/getline/posix_getline.c index d4a7d3fce6..9853d09439 100644 --- a/components/libc/getline/posix_getline.c +++ b/components/libc/getline/posix_getline.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream) { char *cur_pos, *new_lineptr; diff --git a/include/libc/libc_limits.h b/include/libc/libc_limits.h new file mode 100644 index 0000000000..c2129e5343 --- /dev/null +++ b/include/libc/libc_limits.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : libc_limits.h + * + * Change Logs: + * Date Author Notes + * 2020-09-05 Meco Manthe first version + */ + +#ifndef __LIBC_LIMITS_H__ +#define __LIBC_LIMITS_H__ + +#include + +#ifndef SSIZE_MAX +# define SSIZE_MAX LONG_MAX +#endif + +#endif diff --git a/include/rtlibc.h b/include/rtlibc.h index b3a548beb1..73d735250f 100644 --- a/include/rtlibc.h +++ b/include/rtlibc.h @@ -20,6 +20,7 @@ #include "libc/libc_dirent.h" #include "libc/libc_signal.h" #include "libc/libc_fdset.h" +#include "libc/libc_limits.h" #if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__) typedef signed long off_t;