;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Jul 2002
;;;;
-;;;; $Id: file-socket.cl,v 1.1 2002/07/31 20:59:06 kevin Exp $
+;;;; $Id: file-socket.cl,v 1.2 2002/08/02 14:39:11 kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(in-package :cl-user)
+;; Values for linux
+(uffi:def-constant PF_UNIX 1)
+(uffi:def-constant SOCK_STREAM 1)
+
(uffi:def-function ("socket" c-socket)
((family :int)
(type :int)
(addr-len :int))
:returning :int)
+(defun connect-to-file-socket (filename)
+ (let ((socket (c-socket PF_UNIX SOCK_STREAM 0)))
+ (if (plusp socket)
+ (let ((stream (c-connect socket filename (length filename))))
+ stream)
+ (error "Unable to create socket"))))