aboutsummaryrefslogtreecommitdiff
path: root/pflocal/sock.h
diff options
context:
space:
mode:
Diffstat (limited to 'pflocal/sock.h')
-rw-r--r--pflocal/sock.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/pflocal/sock.h b/pflocal/sock.h
index f09e5ca8..6bad8af8 100644
--- a/pflocal/sock.h
+++ b/pflocal/sock.h
@@ -1,8 +1,8 @@
/* Internal sockets
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,99,2000,01 Free Software Foundation, Inc.
- Written by Miles Bader <miles@gnu.ai.mit.edu>
+ Written by Miles Bader <miles@gnu.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -23,13 +23,15 @@
#include <assert.h>
#include <cthreads.h> /* For mutexes */
+#include <sys/mman.h>
+#include <sys/types.h>
#include <hurd/ports.h>
struct pipe;
struct pipe_class;
-/* A port on SOCK. Multiple sock_user's can point to the same socket. */
+/* A port on SOCK. Multiple sock_user's can point to the same socket. */
struct sock_user
{
struct port_info pi;
@@ -59,6 +61,10 @@ struct sock
/* Last time the socket got frobbed. */
time_value_t change_time;
+ /* File mode as reported by stat. Usually this is S_ISOCK, but it
+ should be S_IFIFO for sockets (ab)used in a pipe. */
+ mode_t mode;
+
/* This socket's local address. Note that we don't hold any references on
ADDR, and depend on the addr zeroing our pointer if it goes away (which
is ok, as we can then just make up another address if necessary, and no
@@ -99,7 +105,8 @@ error_t sock_acquire_write_pipe (struct sock *sock, struct pipe **pipe);
error_t sock_connect (struct sock *sock1, struct sock *sock2);
/* Return a new socket with the given pipe class in SOCK. */
-error_t sock_create (struct pipe_class *pipe_class, struct sock **sock);
+error_t sock_create (struct pipe_class *pipe_class, mode_t mode,
+ struct sock **sock);
/* Free SOCK, assuming there are no more handle on it. */
void sock_free (struct sock *sock);
@@ -108,7 +115,7 @@ void sock_free (struct sock *sock);
void _sock_norefs (struct sock *sock);
/* Remove a reference from SOCK, possibly freeing it. */
-extern inline void
+static inline void __attribute__ ((unused))
sock_deref (struct sock *sock)
{
mutex_lock (&sock->lock);