The appended small patch fixed the oopses for me.

1. current->files->open_fds and current->files-> close_on_exec are pointers since 
2.2.12.
2. changed NR_OPEN to current->files->max_fdset at some places.

Christian.

--
*  Christian A. Lademann, ZLS Software GmbH               mailto:[EMAIL PROTECTED]
*  ZLS Software GmbH
*  Frankfurter Strasse 59       Postfach 1628             mailto:[EMAIL PROTECTED]
*  D-65779 Kelkheim             D-65766 Kelkheim          http://www.zls.de
*  Telefon +49-6195-9902-0      Telefax +49-6195-900600
*  Gesch�ftsf�hrer John A. Shuter     -     Amtsgericht K�nigstein HRB 3105


diff -ruN ibcs-2.1-981105/iBCSemul/ioctl.c ibcs/iBCSemul/ioctl.c
--- ibcs-2.1-981105/iBCSemul/ioctl.c    Thu Nov  5 22:50:29 1998
+++ ibcs/iBCSemul/ioctl.c       Fri Jan  7 17:58:00 2000
@@ -222,11 +222,19 @@
 {
        switch (func) {
                case BSD__IOV('f', 1): case BSD__IO('f', 1): /* FIOCLEX */
+#if LINUX_VERSION_CODE < 0x02020c    /* less than 2.2.12 */
                        FD_SET(fd, &current->files->close_on_exec);
+#else
+                       FD_SET(fd, current->files->close_on_exec);
+#endif
                        return 0;
 
                case BSD__IOV('f', 2): case BSD__IO('f', 2): /* FIONCLEX */
+#if LINUX_VERSION_CODE < 0x02020c    /* less than 2.2.12 */
                        FD_CLR(fd, &current->files->close_on_exec);
+#else
+                       FD_CLR(fd, current->files->close_on_exec);
+#endif
                        return 0;
 
                case BSD__IOV('f', 3): case BSD__IO('f', 3): { /* FIORDCHK */
diff -ruN ibcs-2.1-981105/iBCSemul/open.c ibcs/iBCSemul/open.c
--- ibcs-2.1-981105/iBCSemul/open.c     Sun Aug 16 18:34:08 1998
+++ ibcs/iBCSemul/open.c        Fri Jan  7 17:28:58 2000
@@ -554,8 +554,13 @@
                 */
                case  8: /* F_GETHFDO */
                        if (arg1 == -1)
+#if LINUX_VERSION_CODE < 0x02020c    /* less than 2.2.12 */
                                return find_first_zero_bit(&current->files->open_fds,
                                                        NR_OPEN);
+#else
+                               return 
+find_first_zero_bit(current->files->open_fds->fds_bits,
+                                                       current->files->max_fdset);
+#endif
                        /* else fall through to fail */
 #else
                /* The following are defined but reserved and unknown. */
diff -ruN ibcs-2.1-981105/iBCSemul/socksys.c ibcs/iBCSemul/socksys.c
--- ibcs-2.1-981105/iBCSemul/socksys.c  Thu Nov  5 22:50:29 1998
+++ ibcs/iBCSemul/socksys.c     Fri Jan  7 17:58:58 2000
@@ -409,7 +409,11 @@
         */
        if (ino && !ino->i_sock) {
                int fd;
+#if LINUX_VERSION_CODE < 0x02020c      /* less than 2.2.12 */
                for (fd=0; fd<NR_OPEN; fd++) {
+#else
+               for (fd=0; fd<current->files->max_fdset; fd++) {
+#endif
                        if (fcheck(fd) == filep) {
                                int error;
                                error = ibcs_socksys_fd_init(fd, 0, NULL, NULL);
@@ -438,7 +442,11 @@
         */
        if (ino && !ino->i_sock) {
                int fd;
+#if LINUX_VERSION_CODE < 0x02020c      /* less than 2.2.12 */
                for (fd=0; fd<NR_OPEN; fd++) {
+#else
+               for (fd=0; fd<current->files->max_fdset; fd++) {
+#endif
                        if (fcheck(fd) == filep) {
                                int error;
                                error = ibcs_socksys_fd_init(fd, 1, buf, &count);

Reply via email to