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
10 ;;;; $Id: file-socket.cl,v 1.2 2002/08/02 14:39:11 kevin Exp $
12 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
14 ;;;; UFFI users are granted the rights to distribute and use this software
15 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
16 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
17 ;;;; *************************************************************************
22 (uffi:def-constant PF_UNIX 1)
23 (uffi:def-constant SOCK_STREAM 1)
25 (uffi:def-function ("socket" c-socket)
31 (uffi:def-function ("connect" c-connect)
33 (serv-addr :void-pointer)
37 (defun connect-to-file-socket (filename)
38 (let ((socket (c-socket PF_UNIX SOCK_STREAM 0)))
40 (let ((stream (c-connect socket filename (length filename))))
42 (error "Unable to create socket"))))