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/22347] New: getrandom() returns the number of bytes that were copied to the buffer even though the comments say "Return 0 on success and -1 on failure."


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

            Bug ID: 22347
           Summary: getrandom() returns the number of bytes that were
                    copied  to the buffer even though the comments say
                    "Return 0 on success and -1 on failure."
           Product: glibc
           Version: 2.26
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: eero+sourceware at vuojolahti dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

This is the current comment on line 25 sysdeps/unix/sysv/linux/getrandom.c:

/* Write LENGTH bytes of randomness starting at BUFFER.  Return 0 on
   success and -1 on failure.  */

It could be changed to:

/* Write LENGTH bytes of randomness starting at BUFFER.  Return number of
   bytes that were copied to the BUFFER on success and -1 on failure.  */

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