From 9f95554e24f24a5a545f6811b10a749bfbd8b645 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 19 Sep 1995 18:12:36 +0000 Subject: (S_io_pathconf): New function. --- pflocal/io.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'pflocal/io.c') diff --git a/pflocal/io.c b/pflocal/io.c index 53e20c3d..faf47c58 100644 --- a/pflocal/io.c +++ b/pflocal/io.c @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include /* For bzero() */ -#include /* For getpid() */ +#include #include #include #include @@ -416,6 +416,25 @@ S_io_restrict_auth (struct sock_user *user, *new_port_type = MACH_MSG_TYPE_MAKE_SEND; return sock_create_port (user->sock, new_port); } + +error_t +S_io_pathconf (struct sock_user *user, int name, int *value) +{ + if (user == NULL) + return EOPNOTSUPP; + else if (name == _PC_PIPE_BUF) + { + mutex_lock (&user->sock->lock); + if (user->sock->write_pipe == NULL) + *value = 0; + else + *value = user->sock->write_pipe->write_atomic; + mutex_unlock (&user->sock->lock); + return 0; + } + else + return EINVAL; +} /* Stubs for currently unsupported rpcs. */ -- cgit v1.2.3