anchor.diff:         (with-foreign-objects ((a :uint8 +sockaddr-storage+)
   			      (alen :uint32))
   	 (setf (mem-aref alen :uint32) +sockaddr-storage+)
  -	 (let ((sts (with-funcall-else-socket-error
  -			(%recvfrom fd (inc-pointer buffer start) count 0 a alen))))
  +	 (let ((sts (with-syscall-else-error
  +			(%recvfrom fd (inc-pointer buffer start) count 0 a alen) +socket-error+)))
   	   (values sts (translate-sockaddr-from-foreign a))))))
       (can-packet
        (with-foreign-object (frame '(:struct can-frame))
          (with-foreign-object (sockaddr '(:struct sockaddr-can))
   	 (with-foreign-object (len 'socklen_t)	   
   	   (setf (mem-aref len 'socklen_t) (foreign-type-size '(:struct sockaddr-can)))
  -	   (let ((sts (with-funcall-else-socket-error
  +	   (let ((sts (with-syscall-else-error
   			  (%recvfrom
   			   fd frame (foreign-type-size '(:struct can-frame))
  -			   0 sockaddr len))))
  +			   0 sockaddr len) +socket-error+)))
   	     ;; todo: make function to avoid copy-paste
   	     (with-foreign-slots ((can_id can_dlc data) frame (:struct can-frame))
   	       (let* ((ptr-data (foreign-slot-pointer frame '(:struct can-frame) 'data))
  
positive.code: 		  (setf (foreign-slot-value sockaddr '(:struct sockaddr-can) 'can_ifindex) 0)
  		  (progn
  		    (lisp-string-to-foreign n (foreign-slot-value ifr '(:struct ifreq) 'name) (1+ n-size))
  		    (%ioctl fd +siocgifindex+ ifr)
  		    (setf (foreign-slot-value sockaddr '(:struct sockaddr-can) 'can_family) +pf-can+)
  		    (let* ((ifrdata (foreign-slot-value ifr '(:struct ifreq) 'data))
  			   (index (foreign-slot-value ifrdata '(:union ifreq-data) 'ifindex)))      
  
negative.code:     (error 'posix-error :code code)))
  
  (defconstant +socket-error+ -1)
  (defconstant +syscall-error+ -1)
  
  (defmacro with-syscall-else-error (syscall error)
    (let ((sts (gensym)))
      `(let ((,sts ,syscall))
         (if (= ,sts ,error)
  	   (get-last-error)	   
  	   ,sts))))
  ;; --------------------------------------
  