Changeset 7602


Ignore:
Timestamp:
Nov 6, 2007, 6:35:23 PM (12 years ago)
Author:
gb
Message:

Split C_SOCKET in two; if we fail to get a socket fd because of file
table limitations, try to force GC, drain the termination queue, and
try again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0710/ccl/level-1/l1-sockets.lisp

    r7549 r7602  
    148148            "WITH-OPEN-SOCKET"))
    149149
    150 (eval-when (:compile-toplevel)
     150(eval-when (:compile-toplevel :execute)
    151151  #+linuxppc-target
    152152  (require "PPC-LINUX-SYSCALLS")
     
    11071107          (pref addr :in_addr.s_addr))))))
    11081108
    1109 (defun c_socket (domain type protocol)
     1109(defun c_socket_1 (domain type protocol)
    11101110  #-linuxppc-target
    11111111  (syscall syscalls::socket domain type protocol)
     
    11161116          (paref params (:* :unsigned-long) 2) protocol)
    11171117    (syscall syscalls::socketcall 1 params)))
     1118
     1119(defun c_socket (domain type protocol)
     1120  (let* ((fd (c_socket_1 domain type protocol)))
     1121    (when (or (eql fd (- #$EMFILE))
     1122              (eql fd (- #$ENFILE)))
     1123      (gc)
     1124      (drain-termination-queue)
     1125      (setq fd (c_socket_1 domain type protocol)))
     1126    fd))
     1127     
    11181128
    11191129(defun init-unix-sockaddr (addr path)
Note: See TracChangeset for help on using the changeset viewer.