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 ;;;; This file, part of UFFI, is Copyright (c) 2002-2010 by Kevin M. Rosenberg
12 ;;;; *************************************************************************
17 (uffi:def-constant PF_UNIX 1)
18 (uffi:def-constant SOCK_STREAM 1)
20 (uffi:def-function ("socket" c-socket)
26 (uffi:def-function ("connect" c-connect)
28 (serv-addr :void-pointer)
32 (defun connect-to-file-socket (filename)
33 (let ((socket (c-socket PF_UNIX SOCK_STREAM 0)))
35 (let ((stream (c-connect socket filename (length filename))))
37 (error "Unable to create socket"))))