From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32486 invoked by alias); 2 May 2011 13:32:38 -0000 Received: (qmail 32475 invoked by uid 22791); 2 May 2011 13:32:37 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 02 May 2011 13:32:23 +0000 From: "stewb at linuxfoundation dot org" To: glibc-bugs@sources.redhat.com Subject: [Bug libc/12723] New: pathconf for a FIFO returns a different value than fpathconf X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: stewb at linuxfoundation dot org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: drepper.fsp at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 02 May 2011 13:32:00 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00003.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12723 Summary: pathconf for a FIFO returns a different value than fpathconf Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: libc AssignedTo: drepper.fsp@gmail.com ReportedBy: stewb@linuxfoundation.org If one calls pathconf of a FIFO, you get a different value than you do from fpathconf: int fd151, fd152, fd161, fd162; long p151, p152, p161, p162; const char f15[15] = "fpathconf-t.15"; const char f16[15] = "fpathconf-t.16"; const char dot[2] = "."; fd151 = open(f15, O_RDONLY|O_NONBLOCK); p151 = fpathconf(fd151, _PC_PIPE_BUF); p152 = pathconf(f15, _PC_PIPE_BUF); if(p151 != p152) { printf("test15 FAIL - fpathconf for '%s' (%ld) does not equal pathconf for '%s' (%ld) \n", f15, p151, f15, p152); } else { printf("test15 PASS - fpathconf for '%s' (%ld) equals pathconf for '%s' (%ld) \n", f15, p151, f15, p152); } test15 FAIL - fpathconf for 'fpathconf-t.15' (65536) does not equal pathconf for 'fpathconf-t.15' (4096) This would seem to have started about the time of this change: commit 8a492a675e566dc1e666df0a86cbf541442cb179 Author: Ulrich Drepper Date: Tue Jul 6 07:48:23 2010 -0700 Implement _PC_PIPE_BUF. Now that the kernel has appropriate support we can implement this fpathconf command correctly. Also, according to SUSv3, the result from fpathconf for a directory should be the same as for a FIFO in that directory. This also seems to have changed: "6. If path refers to a FIFO, or fildes refers to a pipe or FIFO, the value returned shall apply to the referenced object. If path or fildes refers to a directory, the value returned shall apply to any FIFO that exists or can be created within the directory. If path or fildes refers to any other type of file, it is unspecified whether an implementation supports an association of the variable name with the specified file." fd161 = open(dot, O_RDONLY); fd162 = open(f16, O_RDONLY|O_NONBLOCK); p161 = fpathconf(fd161, _PC_PIPE_BUF); p162 = fpathconf(fd162, _PC_PIPE_BUF); if(p161 != p162) { printf("test16 FAIL - fpathconf for '%s' (%ld) does not equal fpathconf for '%s' (%ld) \n", dot, p161, f16, p162); } else { printf("test16 PASS - fpathconf for '%s' (%ld) equals fpathconf for '%s' (%ld) \n", dot, p161, f16, p162); } test16 FAIL - fpathconf for '.' (4096) does not equal fpathconf for 'fpathconf-t.16' (65536) -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.