fam
[Top] [All Lists]

Re: [fam] fam-2.6.2 and gcc-2.95.2

To: fam@xxxxxxxxxxx
Subject: Re: [fam] fam-2.6.2 and gcc-2.95.2
From: "Rusty Ballinger" <rusty@xxxxxxx>
Date: Mon, 10 Apr 2000 19:18:48 -0700
In-reply-to: Raphael LANGELLA <raphael.langella@xxxxxxxxxxxxxx> "Re: [fam] fam-2.6.2 and gcc-2.95.2" (Apr 10, 5:27pm)
References: <20000410130021.A29945@xxxxxxxxxxxxxxxxxxxxxxxxx> <00041017312300.05927@xxxxxxxxxxxxxxxxxx>
Reply-to: rusty@xxxxxxx
Sender: owner-fam@xxxxxxxxxxx
> and I'm now getting strange compilation errors, but it's probably due to the
> missing header. In case it's not:

Here's a patch from Porter Schermerhorn for building fam with gcc 2.95.2
on Linux.  (It's not for IRIX; I'll add a test to the configure script to
check the arguments for accept().  Did the arguments to accept() change
at some point on Linux?  On RH6.1, its third argument is an int * in the
man page but a socklen_t * in sys/socket.h, which is an unsigned int, not
a size_t, in bits/socket.h.)

(Raphaël, note that Porter's patch doesn't #include bstring.h.)

Sumit, if you want to send your changes for IRIX 5.3 to the list, that
would be great; or, if they're big, you can send them just to me.  Either
way, I'll include them in fam-oss-2.6.3, which I should put out sometime
this week.

--Rusty


diff -rbc ./fam/IMonLinux.c++ ../fam-oss-2.6.2-new/fam/IMonLinux.c++
*** ./fam/IMonLinux.c++ Fri Mar 24 01:34:21 2000
--- ../fam-oss-2.6.2-new/fam/IMonLinux.c++      Fri Apr  7 13:52:41 2000
***************
*** 28,33 ****
--- 28,36 ----
  #include <fcntl.h>
  #include <stdlib.h>

+ #include <sys/types.h>
+ #include <sys/wait.h>
+
  #include <sys/ioctl.h>
  #include <sys/sysmacros.h>
  #include <linux/imon.h>
diff -rbc ./fam/Listener.c++ ../fam-oss-2.6.2-new/fam/Listener.c++
*** ./fam/Listener.c++  Thu Mar  2 00:51:19 2000
--- ../fam-oss-2.6.2-new/fam/Listener.c++       Fri Apr  7 12:46:42 2000
***************
*** 153,159 ****
      // Get the new socket.

      struct sockaddr_in addr;
!     int addrlen = sizeof addr;
      int client_fd = accept(rendezvous_fd, (struct sockaddr *) &addr,
&addrlen);
      if (client_fd < 0)
      {
--- 153,159 ----
      // Get the new socket.

      struct sockaddr_in addr;
!     socklen_t addrlen = sizeof addr;
      int client_fd = accept(rendezvous_fd, (struct sockaddr *) &addr,
&addrlen);
      if (client_fd < 0)
      {
***************
*** 272,278 ****
      // Get the new socket.

      struct sockaddr_un sun = { AF_UNIX, "" };
!     int sunlen = sizeof(sun);
      int client_fd = accept(ofd, (struct sockaddr *) &sun, &sunlen);
      if (client_fd < 0)
      {
--- 272,278 ----
      // Get the new socket.

      struct sockaddr_un sun = { AF_UNIX, "" };
!     socklen_t sunlen = sizeof(sun);
      int client_fd = accept(ofd, (struct sockaddr *) &sun, &sunlen);
      if (client_fd < 0)
      {
***************
*** 400,406 ****
      //  Accept a new ugly connection.

      struct sockaddr_un sun;
!     int sunlen = sizeof sun;
      int sock = accept(ugly, (struct sockaddr *)(&sun), &sunlen);
      if (sock < 0)
      {   Log::perror("accept");
--- 400,406 ----
      //  Accept a new ugly connection.

      struct sockaddr_un sun;
!     socklen_t sunlen = sizeof sun;
      int sock = accept(ugly, (struct sockaddr *)(&sun), &sunlen);
      if (sock < 0)
      {   Log::perror("accept");
diff -rbc ./fam/NFSFileSystem.c++ ../fam-oss-2.6.2-new/fam/NFSFileSystem.c++
*** ./fam/NFSFileSystem.c++     Thu Mar  2 00:51:19 2000
--- ../fam-oss-2.6.2-new/fam/NFSFileSystem.c++  Fri Apr  7 12:48:32 2000
***************
*** 26,31 ****
--- 26,32 ----
  #include <assert.h>
  #include <mntent.h>
  #include <stdlib.h>
+ #include <stdio.h>
  #include <string.h>

  #include "Log.h"
diff -rbc ./fam/Scheduler.c++ ../fam-oss-2.6.2-new/fam/Scheduler.c++
*** ./fam/Scheduler.c++ Thu Mar  2 00:51:20 2000
--- ../fam-oss-2.6.2-new/fam/Scheduler.c++      Fri Apr  7 13:51:42 2000
***************
*** 232,238 ****
  Scheduler::trim_fdinfo()
  {
      for (FDInfo *fp = &fdinfo[nfds - 1]; nfds > 0; --nfds, --fp)
!       if (fp->read.handler || fp->write.handler)
            break;

      if (!nfds)
--- 232,238 ----
  Scheduler::trim_fdinfo()
  {
      for (FDInfo *fp = &fdinfo[nfds - 1]; nfds > 0; --nfds, --fp)
!       if (fp->read.iohandler || fp->write.iohandler)
            break;

      if (!nfds)
***************
*** 249,256 ****
      assert(fd >= 0);
      assert(handler);
      FDInfo *fp = fd_to_info(fd);
!     IOHandler old_handler = (fp->*(iotype->iotype)).handler;
!     (fp->*(iotype->iotype)).handler = handler;
      (fp->*(iotype->iotype)).closure = closure;
      assert(!old_handler || FD_ISSET(fd, &iotype->fds));
      if (!FD_ISSET(fd, &iotype->fds))
--- 249,256 ----
      assert(fd >= 0);
      assert(handler);
      FDInfo *fp = fd_to_info(fd);
!     IOHandler old_handler = (fp->*(iotype->iotype)).iohandler;
!     (fp->*(iotype->iotype)).iohandler = handler;
      (fp->*(iotype->iotype)).closure = closure;
      assert(!old_handler || FD_ISSET(fd, &iotype->fds));
      if (!FD_ISSET(fd, &iotype->fds))
***************
*** 266,273 ****
  {
      assert(fd >= 0 && fd < nfds);
      FDInfo *fp = fd_to_info(fd);
!     IOHandler old_handler = (fp->*(iotype->iotype)).handler;
!     (fp->*(iotype->iotype)).handler = NULL;
      (fp->*(iotype->iotype)).closure = NULL;
      trim_fdinfo();
      assert(old_handler);
--- 266,273 ----
  {
      assert(fd >= 0 && fd < nfds);
      FDInfo *fp = fd_to_info(fd);
!     IOHandler old_handler = (fp->*(iotype->iotype)).iohandler;
!     (fp->*(iotype->iotype)).iohandler = NULL;
      (fp->*(iotype->iotype)).closure = NULL;
      trim_fdinfo();
      assert(old_handler);
***************
*** 311,317 ****
            if (FD_ISSET(fd, fds))
            {   FDInfo *fp = &fdinfo[fd];
                assert(iotype == &FDInfo::read || iotype == &FDInfo::write);
!               (fp->*iotype).handler(fd, (fp->*iotype).closure);
                // Remember, handler may move fdinfo array.
            }
  }
--- 311,317 ----
            if (FD_ISSET(fd, fds))
            {   FDInfo *fp = &fdinfo[fd];
                assert(iotype == &FDInfo::read || iotype == &FDInfo::write);
!               (fp->*iotype).iohandler(fd, (fp->*iotype).closure);
                // Remember, handler may move fdinfo array.
            }
  }
diff -rbc ./fam/Scheduler.h ../fam-oss-2.6.2-new/fam/Scheduler.h
*** ./fam/Scheduler.h   Thu Mar  2 00:51:24 2000
--- ../fam-oss-2.6.2-new/fam/Scheduler.h        Fri Apr  7 13:48:59 2000
***************
*** 91,100 ****

      //  Per-filedescriptor info is the set of three handlers and their
      //  closures.
-
      struct FDInfo {
        struct handler {
!           IOHandler handler;
            void *closure;
        } read, write;
      };
--- 91,99 ----

      //  Per-filedescriptor info is the set of three handlers and their
      //  closures.
      struct FDInfo {
          struct handler {
!             IOHandler iohandler;
              void *closure;
          } read, write;
      };
<Prev in Thread] Current Thread [Next in Thread>