Skip to content

Commit

Permalink
detect the size of rlim_t
Browse files Browse the repository at this point in the history
  • Loading branch information
jan@mysql.com committed Nov 5, 2009
1 parent 15a52b9 commit 15bc348
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Expand Up @@ -206,6 +206,13 @@ IF(${HAVE_SYS_SOCKET_H})
SET(CMAKE_EXTRA_INCLUDE_FILES )
ENDIF(${HAVE_SYS_SOCKET_H})


IF(${HAVE_SYS_RESOURCE_H})
SET(CMAKE_EXTRA_INCLUDE_FILES sys/resource.h)
CHECK_TYPE_SIZE(rlim_t SIZEOF_RLIM_T)
SET(CMAKE_EXTRA_INCLUDE_FILES )
ENDIF(${HAVE_SYS_RESOURCE_H})

IF(EVENT_LIBRARY_DIRS)
FIND_LIBRARY(EVENT_LIBRARIES
NAMES event
Expand Down
2 changes: 1 addition & 1 deletion config.h.cmake
Expand Up @@ -36,4 +36,4 @@

#cmakedefine HAVE_GTHREAD
#cmakedefine HAVE_GTHREAD_H

#define SIZEOF_RLIM_T @SIZEOF_RLIM_T@
5 changes: 5 additions & 0 deletions src/chassis-limits.c
Expand Up @@ -36,6 +36,11 @@
* the size of rlim_t depends on arch and large-file-support
*/
#if SIZEOF_RLIM_T == 8
/* on MacOS X rlim_t is a __uint64_t which is a unsigned long long (which is a 64bit value)
* GUINT64 is on 64bit a unsigned long ... well ...
*
* even if they are the same size, gcc still spits out a warning ... we ignore it
*/
#define G_RLIM_T_FORMAT G_GUINT64_FORMAT
#else
#define G_RLIM_T_FORMAT G_GUINT32_FORMAT
Expand Down

0 comments on commit 15bc348

Please sign in to comment.