[#7055] More on VC++ 2005 — Austin Ziegler <halostatue@...>

Okay. I've got Ruby compiling. I'm attempting to get everything in

17 messages 2006/01/05
[#7058] Re: More on VC++ 2005 — nobuyoshi nakada <nobuyoshi.nakada@...> 2006/01/06

Hi,

[#7084] mathn: ugly warnings — hadmut@... (Hadmut Danisch)

Hi,

22 messages 2006/01/10
[#7097] Re: mathn: ugly warnings — Daniel Berger <Daniel.Berger@...> 2006/01/10

Hadmut Danisch wrote:

[#7098] Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/10

Daniel Berger wrote:

[#7118] Re: Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/12

*Dean Wampler *<deanwampler gmail.com> writes:

[#7226] Fwd: Re: Question about massive API changes — "Sean E. Russell" <ser@...>

Hello,

23 messages 2006/01/28
[#7228] Re: Question about massive API changes — Caleb Tennis <caleb@...> 2006/01/28

>

Re: 64-bit Solaris READ_DATA_PENDING Revisited

From: ville.mattila@...
Date: 2006-01-11 14:10:58 UTC
List: ruby-core #7106
Hello,

here is the updated patch. With ChangeLog entry. I've tested this with
amd64 and all may tests
passes. Yay!
BTW, Would samekind of bug be reason for MAC OS X drb hang? In other word
READ_PENDING gets
 defined uncorrectly?


(See attached file: solaris_64_bit.patch)



|---------+--------------------------->
|         |           "Berger, Daniel"|
|         |           <Daniel.Berger@q|
|         |           west.com>       |
|         |                           |
|         |           06.01.2006 20:36|
|         |           Please respond  |
|         |           to ruby-core    |
|         |                           |
|---------+--------------------------->
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                                  |
  |        To:      <ruby-core@ruby-lang.org>                                                                                                        |
  |        cc:                                                                                                                                       |
  |        Subject: Re: 64-bit Solaris READ_DATA_PENDING Revisited                                                                                   |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|




> -----Original Message-----
> From: ville.mattila@stonesoft.com
> [mailto:ville.mattila@stonesoft.com]
> Sent: Friday, January 06, 2006 9:57 AM
> To: ruby-core@ruby-lang.org
> Cc: ruby-core@ruby-lang.org
> Subject: Re: 64-bit Solaris READ_DATA_PENDING Revisited
>
>
>
> Hello,
>
>  This patch is quite clever! I've been struggling with 64 bit
> issue on amd64 and could not solve  the drb hang problem
> cleanly. I'll test this patch monday and will generate patch
> that works both sparc and amd64.  We have be very carefull if
> SUN will ever change internal FILE structures in 64 bit mode.
> Maybe we should as  nicely if SUN would implemented pending
> read version for our needs.
>
>   - Ville

You could probably get it into OpenSolaris.  Dunno about Solaris proper,
though.

- Dan




Attachments (1)

solaris_64_bit.patch (2.27 KB, text/x-diff)
Index: ChangeLog
===================================================================
RCS file: /src/ruby/ChangeLog,v
retrieving revision 1.2673.2.1470
diff -u -p -r1.2673.2.1470 ChangeLog
--- ChangeLog	10 Jan 2006 11:02:36 -0000	1.2673.2.1470
+++ ChangeLog	11 Jan 2006 14:03:35 -0000
@@ -1,3 +1,15 @@
+Tue Jan 11 15:00:00 2006  Ville Mattila  <mulperi@iki.fi>
+
+	* io.c (READ_PENDING*): Support solaris 64-bit enviroments.
+	  Solaris defines a opaque FILE struct when compiling 64 bit
+	  binaries. This means that we dont have access to _ptr etc.
+	  members anymore. The solution by Steven Lumos is to define
+	  FILE64 that has needed members available. I've modified
+	  the origanal patch a bit so that it compiles both with gcc
+	  and now free sun studio 11 compiler and both amd64 and sparc.
+	  NOTE! We have to 64 bit solaris FILE structure time to time
+	  otherwise we'll get breakage.
+
 Tue Jan 10 19:42:33 2006  Tanaka Akira  <akr@m17n.org>
 
 	* gc.c (garbage_collect): mark ruby_current_node.
Index: io.c
===================================================================
RCS file: /src/ruby/io.c,v
retrieving revision 1.246.2.94
diff -u -p -r1.246.2.94 io.c
--- io.c	19 Dec 2005 17:11:20 -0000	1.246.2.94
+++ io.c	11 Jan 2006 14:03:42 -0000
@@ -144,6 +144,19 @@ static VALUE lineno = INT2FIX(0);
 #    define READ_DATA_PENDING_COUNT(fp) ((fp)->_egptr - (fp)->_gptr)
 #    define READ_DATA_PENDING_PTR(fp) ((fp)->_gptr)
 #  endif
+#elif defined(_LP64) && (defined(__sun__) || defined(__sun))
+typedef struct _FILE64 {
+  unsigned char        *_ptr;  /* next character from/to here in buffer */
+  unsigned char        *_base; /* the buffer */
+  unsigned char        *_end;  /* the end of the buffer */
+  ssize_t      _cnt;   /* number of available characters in buffer */
+  int          _file;  /* UNIX System file descriptor */
+  unsigned int _flag;  /* the state of the stream */
+  char         __fill[80];     /* filler to bring size to 128 bytes */
+} FILE64;
+#  define READ_DATA_PENDING(fp) (((FILE64*)(fp))->_cnt > 0)
+#  define READ_DATA_PENDING_COUNT(fp) (((FILE64*)(fp))->_cnt)
+#  define READ_DATA_PENDING_PTR(fp) ((char *)((FILE64*)(fp))->_ptr)
 #elif defined(FILE_COUNT)
 #  define READ_DATA_PENDING(fp) ((fp)->FILE_COUNT > 0)
 #  define READ_DATA_PENDING_COUNT(fp) ((fp)->FILE_COUNT)

In This Thread

Prev Next