Date: Fri, 19 Dec 2008 13:47:09 -0800 (PST)
From: "Roger A. Faulkner" <raf>
Subject: Re: PSARC/2008/778 - asprintf, vasprintf
To: psarc-ext at sac.sfbay.sun
Cc: james.d.carlson at sun.com, Daniel.Price at sun.com, Tim.Marsland at 
sun.com, 
Peter.Memishian at sun.com


> Date: Fri, 19 Dec 2008 09:10:20 -0500
> From: James Carlson <james.d.carlson at sun.com>
> Subject: Re: PSARC/2008/778 - asprintf, vasprintf
> To: "Roger A. Faulkner" <Roger.Faulkner at sun.com>
> Cc: psarc-ext at sac.sfbay.sun.com, Daniel.Price at sun.com, Tim.Marsland at 
> sun.com, 
Peter.Memishian at sun.com
> 
> Roger A. Faulkner writes:
> >     This case adds two new functions to the C library, asprintf()
> >     and vasprintf() as follows:
> > 
> >        int asprintf(char **ret, const char *format, ...);
> >        int vasprintf(char **ret, const char *format, va_list ap);
> > 
> >     The committment level of these interfaces is Committed.
> 
> +1 with the addition of the somewhat dubious EAGAIN from malloc(3C).
> 
> -- 
> James Carlson, Solaris Networking              <james.d.carlson at sun.com>

Here is the addemdum to the case, specifying the EAGAIN errno
for the failure case (diff of old vs new asprintf.3c):

@@ -653,10 +667,12 @@
 
 
-     The printf() and fprintf() functions may fail if:
+     The printf(), fprintf(), and asprintf() functions may fail
+     due to an underlying malloc(3C) failure:
 
      ENOMEM    Insufficient storage space is available.
 
+     EAGAIN    Storage space is temporarily unavailable.
 
 USAGE
      If the application calling the printf()  functions  has  any
@@ -798,14 +814,20 @@
 
 SEE ALSO
      exit(2), lseek(2), write(2), abort(3C), ecvt(3C),  exit(3C),
-     fclose(3C),  fflush(3C),  fputwc(3C),  putc(3C),  scanf(3C),
+     fclose(3C), fflush(3C), fputwc(3C), free(3C), malloc(3C),
+     putc(3C), scanf(3C),
      setlocale(3C),   stdio(3C),    vprintf(3C),    wcstombs(3C),
      wctomb(3C), attributes(5), environ(5), standards(5)



Reply via email to