libc: Add definition for ssize_t
Add definition for ssize_t that may be useful to represent sizes with variables that also need to be able to have negative values (e.g. to represent errors). Change-Id: I52ec69591ccfd760021dad38f5ba1b1ebe707ea5 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
ccab7d0d6f
commit
da1552a923
35
lib/libc/minimal/include/bits/ssize_t.h
Normal file
35
lib/libc/minimal/include/bits/ssize_t.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2016 Intel Corporation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief ssize_t definition
|
||||
*/
|
||||
|
||||
#if !defined(__ssize_t_defined)
|
||||
#define __ssize_t_defined
|
||||
|
||||
#ifdef __i386
|
||||
typedef long int ssize_t;
|
||||
#elif defined(__ARM_ARCH)
|
||||
typedef int ssize_t;
|
||||
#elif defined(__arc__)
|
||||
typedef int ssize_t;
|
||||
#else
|
||||
#error "The minimal libc library does not recognize the architecture!\n"
|
||||
#endif
|
||||
|
||||
#endif
|
22
lib/libc/minimal/include/sys/types.h
Normal file
22
lib/libc/minimal/include/sys/types.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2016 Intel Corporation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __INC_sys_types_h__
|
||||
#define __INC_sys_types_h__
|
||||
|
||||
#include <bits/ssize_t.h>
|
||||
|
||||
#endif /* __INC_sys_types_h__ */
|
Loading…
Reference in a new issue