[libc][Obvious] Fix typo in struct rlimit name - remove the "_t" suffix.

This commit is contained in:
Siva Chandra Reddy 2022-09-16 20:54:57 +00:00
parent 10378c4505
commit 9050a59c66
10 changed files with 20 additions and 20 deletions

View File

@ -272,7 +272,7 @@ def UniStdAPI : PublicAPI<"unistd.h"> {
}
def SysResourceAPI : PublicAPI<"sys/resource.h"> {
let Types = ["rlim_t", "struct rlimit_t"];
let Types = ["rlim_t", "struct rlimit"];
}
def SysStatAPI : PublicAPI<"sys/stat.h"> {

View File

@ -211,7 +211,7 @@ add_gen_header(
.llvm_libc_common_h
.llvm-libc-macros.sys_resource_macros
.llvm-libc-types.rlim_t
.llvm-libc-types.struct_rlimit_t
.llvm-libc-types.struct_rlimit
)
add_gen_header(

View File

@ -32,7 +32,7 @@ add_header(pthread_mutex_t HDR pthread_mutex_t.h DEPENDS .__futex_word .__mutex_
add_header(pthread_t HDR pthread_t.h DEPENDS .__thread_type)
add_header(pthread_mutexattr_t HDR pthread_mutexattr_t.h)
add_header(rlim_t HDR rlim_t.h)
add_header(struct_rlimit_t HDR struct_rlimit_t.h DEPENDS .rlim_t)
add_header(struct_rlimit HDR struct_rlimit.h DEPENDS .rlim_t)
add_header(ssize_t HDR ssize_t.h)
add_header(struct_dirent HDR struct_dirent.h DEPENDS .ino_t .off_t)
add_header(struct_sigaction HDR struct_sigaction.h)

View File

@ -1,4 +1,4 @@
//===-- Definition of type rlimit_t ---------------------------------------===//
//===-- Definition of type struct rlimit ----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@ -6,14 +6,14 @@
//
//===----------------------------------------------------------------------===//
#ifndef __LLVM_LIBC_TYPES_RLIMIT_T_H__
#define __LLVM_LIBC_TYPES_RLIMIT_T_H__
#ifndef __LLVM_LIBC_TYPES_STRUCT_RLIMIT_H__
#define __LLVM_LIBC_TYPES_STRUCT_RLIMIT_H__
#include <llvm-libc-types/rlim_t.h>
struct rlimit_t {
struct rlimit {
rlim_t rlim_cur;
rlim_t rlim_max;
};
#endif // __LLVM_LIBC_TYPES_RLIMIT_T_H__
#endif // __LLVM_LIBC_TYPES_STRUCT_RLIMIT_H__

View File

@ -466,13 +466,13 @@ def POSIX : StandardSpec<"POSIX"> {
>;
NamedType RLimTType = NamedType<"rlim_t">;
NamedType StructRLimitTType = NamedType<"struct rlimit_t">;
PtrType StructRLimitPtr = PtrType<StructRLimitTType>;
ConstType ConstStructRLimitPtr = ConstType<StructRLimitTType>;
NamedType StructRLimitType = NamedType<"struct rlimit">;
PtrType StructRLimitPtr = PtrType<StructRLimitType>;
ConstType ConstStructRLimitPtr = ConstType<StructRLimitType>;
HeaderSpec SysResource = HeaderSpec<
"sys/resource.h",
[], // Macros
[RLimTType, StructRLimitTType], // Types
[RLimTType, StructRLimitType], // Types
[], // Enumerations
[
FunctionSpec<

View File

@ -13,7 +13,7 @@
namespace __llvm_libc {
int getrlimit(int resource, struct rlimit_t *lim);
int getrlimit(int resource, struct rlimit *lim);
} // namespace __llvm_libc

View File

@ -12,12 +12,12 @@
#include "src/__support/common.h"
#include <errno.h>
#include <sys/resource.h> // For struct rlimit_t
#include <sys/resource.h> // For struct rlimit
#include <sys/syscall.h> // For syscall numbers.
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(int, getrlimit, (int res, struct rlimit_t *limits)) {
LLVM_LIBC_FUNCTION(int, getrlimit, (int res, struct rlimit *limits)) {
long ret = __llvm_libc::syscall(SYS_prlimit64, 0, res, nullptr, limits);
if (ret < 0) {
errno = -ret;

View File

@ -12,12 +12,12 @@
#include "src/__support/common.h"
#include <errno.h>
#include <sys/resource.h> // For struct rlimit_t
#include <sys/resource.h> // For struct rlimit
#include <sys/syscall.h> // For syscall numbers.
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(int, setrlimit, (int res, const struct rlimit_t *limits)) {
LLVM_LIBC_FUNCTION(int, setrlimit, (int res, const struct rlimit *limits)) {
long ret = __llvm_libc::syscall(SYS_prlimit64, 0, res, limits, nullptr);
if (ret < 0) {
errno = -ret;

View File

@ -13,7 +13,7 @@
namespace __llvm_libc {
int setrlimit(int resource, const struct rlimit_t *lim);
int setrlimit(int resource, const struct rlimit *lim);
} // namespace __llvm_libc

View File

@ -40,7 +40,7 @@ TEST(LlvmLibcResourceLimitsTest, SetNoFileLimit) {
ASSERT_THAT(__llvm_libc::close(fd1), Succeeds(0));
ASSERT_THAT(__llvm_libc::close(fd2), Succeeds(0));
struct rlimit_t limits {
struct rlimit limits {
4, 4
};
ASSERT_THAT(__llvm_libc::setrlimit(RLIMIT_NOFILE, &limits), Succeeds(0));
@ -69,7 +69,7 @@ TEST(LlvmLibcResourceLimitsTest, SetNoFileLimit) {
ASSERT_THAT(__llvm_libc::unlink(TEST_FILE1), Succeeds(0));
ASSERT_THAT(__llvm_libc::unlink(TEST_FILE2), Succeeds(0));
struct rlimit_t current_limits;
struct rlimit current_limits;
ASSERT_THAT(__llvm_libc::getrlimit(RLIMIT_NOFILE, &current_limits),
Succeeds(0));
ASSERT_EQ(current_limits.rlim_cur, rlim_t(4));