1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: file-socket.cl
6 ;;;; Purpose: UFFI Example file to get a socket on a file
7 ;;;; Programmer: Kevin M. Rosenberg
8 ;;;; Date Started: Jul 2002
12 ;;;; This file, part of UFFI, is Copyright (c) 2002-2005 by Kevin M. Rosenberg
14 ;;;; *************************************************************************
19 (uffi:def-constant PF_UNIX 1)
20 (uffi:def-constant SOCK_STREAM 1)
22 (uffi:def-function ("socket" c-socket)
28 (uffi:def-function ("connect" c-connect)
30 (serv-addr :void-pointer)
34 (defun connect-to-file-socket (filename)
35 (let ((socket (c-socket PF_UNIX SOCK_STREAM 0)))
37 (let ((stream (c-connect socket filename (length filename))))
39 (error "Unable to create socket"))))