add posix 2008 limit.h

This commit is contained in:
mysterywolf 2020-09-05 16:14:21 +08:00
parent a41ebbb697
commit 74ab1551fd
4 changed files with 27 additions and 2 deletions

View File

@ -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) [![Build Status](https://travis-ci.org/ivanrad/getline.svg?branch=master)](https://travis-ci.org/ivanrad/getline)

View File

@ -12,7 +12,7 @@
#include <posix_getline.h> #include <posix_getline.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <limits.h> #include <rtlibc.h>
ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream) { ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream) {
char *cur_pos, *new_lineptr; char *cur_pos, *new_lineptr;

View File

@ -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 <limits.h>
#ifndef SSIZE_MAX
# define SSIZE_MAX LONG_MAX
#endif
#endif

View File

@ -20,6 +20,7 @@
#include "libc/libc_dirent.h" #include "libc/libc_dirent.h"
#include "libc/libc_signal.h" #include "libc/libc_signal.h"
#include "libc/libc_fdset.h" #include "libc/libc_fdset.h"
#include "libc/libc_limits.h"
#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__) #if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__)
typedef signed long off_t; typedef signed long off_t;