From 8a492a675e566dc1e666df0a86cbf541442cb179 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 6 Jul 2010 07:48:23 -0700 Subject: [PATCH] Implement _PC_PIPE_BUF. Now that the kernel has appropriate support we can implement this fpathconf command correctly. --- ChangeLog | 5 +++++ sysdeps/unix/sysv/linux/fpathconf.c | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2bfc9122a4..946e9455ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-07-06 Ulrich Drepper + + * sysdeps/unix/sysv/linux/fpathconf.c (__fpathconf): Implement + _PC_PIPE_BUF using F_GETPIPE_SZ. + 2010-07-02 Ulrich Drepper * elf/Makefile: Fix linking for a few tests to make recent linker diff --git a/sysdeps/unix/sysv/linux/fpathconf.c b/sysdeps/unix/sysv/linux/fpathconf.c index 2701c9ec99..67dc3845f2 100644 --- a/sysdeps/unix/sysv/linux/fpathconf.c +++ b/sysdeps/unix/sysv/linux/fpathconf.c @@ -1,5 +1,6 @@ /* Get file-specific information about descriptor FD. Linux version. - Copyright (C) 1991,1995,1996,1998-2003,2008 Free Software Foundation, Inc. + Copyright (C) 1991,1995,1996,1998-2003,2008,2010 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,6 +18,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include "pathconf.h" static long int posix_fpathconf (int fd, int name); @@ -33,6 +35,7 @@ __fpathconf (fd, name) int name; { struct statfs fsbuf; + int r; switch (name) { @@ -48,6 +51,12 @@ __fpathconf (fd, name) case _PC_CHOWN_RESTRICTED: return __statfs_chown_restricted (__fstatfs (fd, &fsbuf), &fsbuf); + case _PC_PIPE_BUF: + r = fcntl (fd, F_GETPIPE_SZ); + if (r > 0) + return r; + /* FALLTHROUGH */ + default: return posix_fpathconf (fd, name); } -- 2.11.4.GIT