Welcome to the Builder Academy

Question Dealing with the rlimit boot error on OS X

More
02 Jan 2014 22:05 - 25 Feb 2020 16:53 #4610 by Kyle
There is some discussion of the issue here:
old.tbamud.com/forum/thread/873

I have been playing around, and the following seems to avoid the issue and to work just fine.

In sysdep.h
Code:
+ #ifndef MAC_OS_X /* Guess if we have the getrlimit()/setrlimit() functions */ #if defined(RLIMIT_NOFILE) || defined (RLIMIT_OFILE) #define HAS_RLIMIT #if !defined (RLIMIT_NOFILE) # define RLIMIT_NOFILE RLIMIT_OFILE #endif #endif + #endif /*MAC_OS_X*/

Then I add the following compiler flag to Makefile.in
Code:
# Any special flags you want to pass to the compiler - MYFLAGS = @MYFLAGS@ + MYFLAGS = @MYFLAGS@ -DMAC_OS_X

Does anyone with more knowledge of the rlimit code have any comments or see any problems with this?
Last edit: 25 Feb 2020 16:53 by Kyle. Reason: This is an ancient post, but nonetheless it might as well be fixed.

Please Log in or Create an account to join the conversation.

More
03 Jan 2014 01:17 - 03 Jan 2014 01:20 #4611 by Kyle
I am convinced this is the better solution. By virtue of not defining HAS_RLIMIT, then the OPEN_MAX is automatically used, which is the same as what is accomplished in the older solution linked above. Of course this goes without saying: don't add this compiler flag unless you are actually on OS X. It seems that the ./configure script correctly determines whether you have the rlimit functions on other platforms.
Last edit: 03 Jan 2014 01:20 by Kyle.

Please Log in or Create an account to join the conversation.

More
03 Jan 2014 13:28 #4616 by Rumble
Thanks, I'll add when I get home. Do you think we need a /doc/README.OSX ?

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

Please Log in or Create an account to join the conversation.

More
03 Jan 2014 21:02 - 03 Jan 2014 21:03 #4618 by Kyle
According to README, OS X is considered a UNIX platform, so I think we should just edit README.unix

Also, CircleMUD uses the naming convention CIRCLE_<platform> for these type of #defines, so
the name I chose before should follow this. With this in mind, I think the following is
sufficient:

In README.unix, the following step should be added (after decompression and before configuring)
Code:
3) If you are not compiling on a version of Macintosh OS X, skip this step. Open the file Makefile.in which is located in the src directory. Make the following change: Fine the line: MYFLAGS = @MYFLAGS@ Replace it with: MYFLAGS = -DCIRCLE_OS_X

In sysdep.h
Code:
+ #ifndef CIRCLE_OS_X /* Guess if we have the getrlimit()/setrlimit() functions */ #if defined(RLIMIT_NOFILE) || defined (RLIMIT_OFILE) #define HAS_RLIMIT #if !defined (RLIMIT_NOFILE) # define RLIMIT_NOFILE RLIMIT_OFILE #endif #endif + #endif /*CIRCLE_OS_X*/
Last edit: 03 Jan 2014 21:03 by Kyle.

Please Log in or Create an account to join the conversation.

More
03 Jan 2014 21:33 #4620 by Rumble
Added, thanks.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

Please Log in or Create an account to join the conversation.

More
12 Feb 2015 16:42 #5230 by brmud
A /doc/README.OSX will be really nice! =)


Another error:
./sysdep.h:154:10: fatal error: 'crypt.h' file not found
#include <crypt.h>
^
1 error generated.


FIX: the crypt.h is obsolet on Mac (im using Mavericks), just change the line 154 on sysdep.h to:

#include <unistd.h>


=)
The following user(s) said Thank You: Kyle

Please Log in or Create an account to join the conversation.

Time to create page: 0.197 seconds