ASPRINTF(3) Linux Programmer's Manual ASPRINTF(3)NAME
asprintf, vasprintf - print to allocated string
SYNOPSIS
#define _GNU_SOURCE
#include <stdio.h>
int asprintf(char **strp, const char *fmt, ...);
int vasprintf(char **strp, const char *fmt, va_list ap);
DESCRIPTION
The functions asprintf() and vasprintf() are analogs of sprintf(3) and vsprintf(3), except that they allocate a string large enough to hold
the output including the terminating null byte, and return a pointer to it via the first argument. This pointer should be passed to
free(3) to release the allocated storage when it is no longer needed.
RETURN VALUE
When successful, these functions return the number of bytes printed, just like sprintf(3). If memory allocation wasn't possible, or some
other error occurs, these functions will return -1, and the contents of strp is undefined.
CONFORMING TO
These functions are GNU extensions, not in C or POSIX. They are also available under *BSD. The FreeBSD implementation sets strp to NULL
on error.
SEE ALSO free(3), malloc(3), printf(3), feature_test_macros(7)COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2001-12-18 ASPRINTF(3)
Check Out this Related Man Page
ASPRINTF(3) Linux Programmer's Manual ASPRINTF(3)NAME
asprintf, vasprintf - print to allocated string
SYNOPSIS
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <stdio.h>
int asprintf(char **strp, const char *fmt, ...);
int vasprintf(char **strp, const char *fmt, va_list ap);
DESCRIPTION
The functions asprintf() and vasprintf() are analogs of sprintf(3) and vsprintf(3), except that they allocate a string large enough to hold
the output including the terminating null byte, and return a pointer to it via the first argument. This pointer should be passed to
free(3) to release the allocated storage when it is no longer needed.
RETURN VALUE
When successful, these functions return the number of bytes printed, just like sprintf(3). If memory allocation wasn't possible, or some
other error occurs, these functions will return -1, and the contents of strp is undefined.
CONFORMING TO
These functions are GNU extensions, not in C or POSIX. They are also available under *BSD. The FreeBSD implementation sets strp to NULL
on error.
SEE ALSO free(3), malloc(3), printf(3)COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2001-12-18 ASPRINTF(3)
We are moving from old solaris to new version of solaris. I have copied the gcc compiler installed on old server to new solaris server. But just copying didn't work. So I am trying to build it on the new server. The server version is
sailfish@st-kvar02 -> uname -a
SunOS st-kvar02 5.10... (7 Replies)
Hi,
I want to install the gcc-3.4.6 on solaris 9.5 , in order to compile perl 5.8.8 . I have the following packages .
gcc-3.4.6.tar
ibiconv-1.11-sol9-sparc-local.gz
gcc-3.4.6-sol9-sparc-local
libiconv-1.11.tar.gz
Where can I find the necessary documents or... (4 Replies)
Hi ,
I am installing gcc 3.4.6 on SunOS labcvs001sm 5.9 Generic_117171-07 sun4u sparc
SUNW,Ultra-5_10 . The isa info is 'sparcv'.
I have the following with me
a)gcc-3.4.6.tar
b)gcc-3.4.6-sol9-sparc-local
c)libiconv-1.11-sol9-sparc-local
d) binutils-2.18.tar.gz
e)... (8 Replies)
I have put some yellow color codes and works well.
I call the funstion using
print_usage(stderr, 0);
I would like to know if there is any way, to store the ansi color codes in variables and then call them inside fprintf.
Or have a format followed by the strings I want to output.
... (5 Replies)
asprintf.c: In function 'vasprintf':
asprintf.c:58: error: 'SIZE_MAX' undeclared (first use in this function)
asprintf.c:58: error: (Each undeclared identifier is reported only once
asprintf.c:58: error: for each function it appears in.)
Someone know how to fix?
Thanks (2 Replies)
Someone, please help on this issue:-
Note : for security reason i didn't mention hostnames and ips.
==============================================================================
# ntpstat
unsynchronised
polling server every 1024 s
Ntpstat showing unsynchronised.
... (29 Replies)