summaryrefslogtreecommitdiff
path: root/pfinet
diff options
context:
space:
mode:
Diffstat (limited to 'pfinet')
-rw-r--r--pfinet/io-ops.c4
-rw-r--r--pfinet/linux-src/include/linux/net.h1
-rw-r--r--pfinet/socket.c7
3 files changed, 9 insertions, 3 deletions
diff --git a/pfinet/io-ops.c b/pfinet/io-ops.c
index 4964c80a..b9c7de9d 100644
--- a/pfinet/io-ops.c
+++ b/pfinet/io-ops.c
@@ -303,7 +303,7 @@ S_io_stat (struct sock_user *user,
st->st_fstype = FSTYPE_SOCKET;
st->st_fsid = getpid ();
- st->st_ino = (ino_t) user->sock; /* why not? */
+ st->st_ino = user->sock->st_ino;
st->st_mode = S_IFSOCK | ACCESSPERMS;
st->st_blksize = 512; /* ???? */
@@ -471,7 +471,7 @@ S_io_identity (struct sock_user *user,
*idtype = MACH_MSG_TYPE_MAKE_SEND;
*fsys = fsys_identity;
*fsystype = MACH_MSG_TYPE_MAKE_SEND;
- *fileno = (ino_t) user->sock; /* matches S_io_stat above */
+ *fileno = user->sock->st_ino;
__mutex_unlock (&global_lock);
return 0;
diff --git a/pfinet/linux-src/include/linux/net.h b/pfinet/linux-src/include/linux/net.h
index 781b9453..b224c49e 100644
--- a/pfinet/linux-src/include/linux/net.h
+++ b/pfinet/linux-src/include/linux/net.h
@@ -69,6 +69,7 @@ struct socket
#ifdef _HURD_
uint_fast32_t refcnt; /* # of sock_user's pointing to this */
mach_port_t identity; /* for io_identity */
+ ino_t st_ino;
#else
struct fasync_struct *fasync_list; /* Asynchronous wake up list */
struct file *file; /* File back pointer for gc */
diff --git a/pfinet/socket.c b/pfinet/socket.c
index 82935a57..d56c1794 100644
--- a/pfinet/socket.c
+++ b/pfinet/socket.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1995,2000 Free Software Foundation, Inc.
+ Copyright (C) 1995,2000,02 Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -41,6 +41,7 @@ sock_register (struct net_proto_family *fam)
struct socket *
sock_alloc (void)
{
+ static ino_t nextino; /* locked by global_lock */
struct socket *sock;
struct condition *c;
@@ -55,6 +56,10 @@ sock_alloc (void)
sock->refcnt = 1;
sock->wait = (void *) c;
+ if (nextino == 0)
+ nextino = 2;
+ sock->st_ino = nextino++;
+
return sock;
}