From a6888a2b3a918920fe27133308c820e78dcecf16 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Wed, 2 Aug 2000 20:19:45 +0000 Subject: Add `magic' protocols to specify the file type of a sockets. This allows implementation of POSIX pipes by using a S_IFSOCK protocol. * sock.h: Include . (struct sock): Add new member `mode'. (sock_create): Add new parameter `mode'. * sock.c (sock_create): Initialize `mode' member of struct sock, with new parameter. * pf.c (S_socket_create): Pass file type/mode to sock_create based on PROTOCOL. * io.c (S_io_stat): Use new member of `struct sock' to set ST->st_mode. --- pflocal/io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pflocal/io.c') diff --git a/pflocal/io.c b/pflocal/io.c index 133c75c9..dca24876 100644 --- a/pflocal/io.c +++ b/pflocal/io.c @@ -1,6 +1,6 @@ /* Socket I/O operations - Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc. Written by Miles Bader @@ -287,7 +287,7 @@ S_io_stat (struct sock_user *user, struct stat *st) bzero (st, sizeof (struct stat)); st->st_fstype = FSTYPE_SOCKET; - st->st_mode = S_IFSOCK; + st->st_mode = sock->mode; st->st_fsid = getpid (); st->st_ino = sock->id; /* As we try to be clever with large transfers, ask for them. */ -- cgit v1.2.3