public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/12723] New: pathconf for a FIFO returns a different value than fpathconf
@ 2011-05-02 13:32 stewb at linuxfoundation dot org
  2011-05-03  1:01 ` [Bug libc/12723] " drepper.fsp at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: stewb at linuxfoundation dot org @ 2011-05-02 13:32 UTC (permalink / raw)
  To: glibc-bugs

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 <drepper@redhat.com>
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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/12723] pathconf for a FIFO returns a different value than fpathconf
  2011-05-02 13:32 [Bug libc/12723] New: pathconf for a FIFO returns a different value than fpathconf stewb at linuxfoundation dot org
@ 2011-05-03  1:01 ` drepper.fsp at gmail dot com
  2012-04-25 18:07 ` stewb at linuxfoundation dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: drepper.fsp at gmail dot com @ 2011-05-03  1:01 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12723

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Ulrich Drepper <drepper.fsp at gmail dot com> 2011-05-03 01:01:18 UTC ---
Fixed in git.

-- 
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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/12723] pathconf for a FIFO returns a different value than fpathconf
  2011-05-02 13:32 [Bug libc/12723] New: pathconf for a FIFO returns a different value than fpathconf stewb at linuxfoundation dot org
  2011-05-03  1:01 ` [Bug libc/12723] " drepper.fsp at gmail dot com
@ 2012-04-25 18:07 ` stewb at linuxfoundation dot org
  2013-03-01 13:29 ` siddhesh at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: stewb at linuxfoundation dot org @ 2012-04-25 18:07 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12723

Stew Benedict <stewb at linuxfoundation dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #2 from Stew Benedict <stewb at linuxfoundation dot org> 2012-04-25 18:07:15 UTC ---
For some reason this fix has never manifested itself out to the distros.
glibc-2.15 still has both of these tests failing.

-- 
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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/12723] pathconf for a FIFO returns a different value than fpathconf
  2011-05-02 13:32 [Bug libc/12723] New: pathconf for a FIFO returns a different value than fpathconf stewb at linuxfoundation dot org
  2011-05-03  1:01 ` [Bug libc/12723] " drepper.fsp at gmail dot com
  2012-04-25 18:07 ` stewb at linuxfoundation dot org
@ 2013-03-01 13:29 ` siddhesh at redhat dot com
  2013-03-07  6:47 ` siddhesh at redhat dot com
  2014-06-27 13:27 ` fweimer at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: siddhesh at redhat dot com @ 2013-03-01 13:29 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12723

Siddhesh Poyarekar <siddhesh at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |siddhesh at redhat dot com
         AssignedTo|drepper.fsp at gmail dot    |siddhesh at redhat dot com
                   |com                         |

-- 
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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/12723] pathconf for a FIFO returns a different value than fpathconf
  2011-05-02 13:32 [Bug libc/12723] New: pathconf for a FIFO returns a different value than fpathconf stewb at linuxfoundation dot org
                   ` (2 preceding siblings ...)
  2013-03-01 13:29 ` siddhesh at redhat dot com
@ 2013-03-07  6:47 ` siddhesh at redhat dot com
  2014-06-27 13:27 ` fweimer at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: siddhesh at redhat dot com @ 2013-03-07  6:47 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12723

Siddhesh Poyarekar <siddhesh at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Siddhesh Poyarekar <siddhesh at redhat dot com> 2013-03-07 06:46:43 UTC ---
Fixed in master.  I've reverted {f}pathconf to returning PIPE_BUF since
F_GETPIPE_SZ is not the size of an atomic write; that remains at page size or
PIPE_BUF (which is currently the same at 4K).

-- 
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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/12723] pathconf for a FIFO returns a different value than fpathconf
  2011-05-02 13:32 [Bug libc/12723] New: pathconf for a FIFO returns a different value than fpathconf stewb at linuxfoundation dot org
                   ` (3 preceding siblings ...)
  2013-03-07  6:47 ` siddhesh at redhat dot com
@ 2014-06-27 13:27 ` fweimer at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: fweimer at redhat dot com @ 2014-06-27 13:27 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12723

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-27 13:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-02 13:32 [Bug libc/12723] New: pathconf for a FIFO returns a different value than fpathconf stewb at linuxfoundation dot org
2011-05-03  1:01 ` [Bug libc/12723] " drepper.fsp at gmail dot com
2012-04-25 18:07 ` stewb at linuxfoundation dot org
2013-03-01 13:29 ` siddhesh at redhat dot com
2013-03-07  6:47 ` siddhesh at redhat dot com
2014-06-27 13:27 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).