This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/22753] New: preadv2/pwritev2 fallback code should handle offset=-1


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

            Bug ID: 22753
           Summary: preadv2/pwritev2 fallback code should handle offset=-1
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: njs at pobox dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Linux recently added preadv2/pwritev2 syscalls, in order to add a 'flags'
argument to preadv/pwritev. Currently glibc wraps this, or if they aren't
available, then it provides a fallback that checks that flags==0 and then calls
preadv/pwritev instead.

However, this is missing one bit of preadv2/pwritev2 semantics: as documented
in the man page, if you pass offset=-1, then they emulate readv/writev. (I
guess the kernel devs didn't want to add separate readv2/writev2 syscalls, so
they made preadv2/pwritev2 support both behaviors.)

The fallback in glibc should probably check for offset=-1, and in that case
fall back to readv/writev.

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]