HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: vsnprintf
Operating System - HP-UX
1834645
Members
2857
Online
110069
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2001 03:41 AM
03-23-2001 03:41 AM
vsnprintf
hi
one of our programmers has started using vsnprintf which is available on HP-UX 11.00 We have to support products on HP-UX 10.20 as well, but the function doesn't seem to be publicly available in libc patches on 10.20.
Any advice?
thanks
-robert-
one of our programmers has started using vsnprintf which is available on HP-UX 11.00 We have to support products on HP-UX 10.20 as well, but the function doesn't seem to be publicly available in libc patches on 10.20.
Any advice?
thanks
-robert-
ask a question and look stupid for 5 minutes. Don't and remain stupid for life.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2001 04:34 AM
03-23-2001 04:34 AM
Re: vsnprintf
Robert,
Investigation of the libc.1 file shows that vsnprintf() is indeed in the library, even if it is not included in the correct header files. The following 3 lines at the beginning of your file should fix the problem:
#include
#include
extern int vsnprintf( char *, int, const char *, va_list );
I used the following piece of example code to illustrate the usage:
#include
#include
extern int vsnprintf( char *s, size_t maxsize, const char *format, va_list ap );
int call_it( char *s, size_t maxsize, const char *format, ... ) {
va_list ap;
int i;
va_start( ap, format );
i = vsnprintf( s, maxsize, format, ap );
va_end( ap );
}
int main( ) {
char buf[BUFSIZ];
call_it( buf, BUFSIZ-1, "This is a test %d %c %s\n", 123, 'a', "test" );
puts( buf );
}
Investigation of the libc.1 file shows that vsnprintf() is indeed in the library, even if it is not included in the correct header files. The following 3 lines at the beginning of your file should fix the problem:
#include
#include
extern int vsnprintf( char *, int, const char *, va_list );
I used the following piece of example code to illustrate the usage:
#include
#include
extern int vsnprintf( char *s, size_t maxsize, const char *format, va_list ap );
int call_it( char *s, size_t maxsize, const char *format, ... ) {
va_list ap;
int i;
va_start( ap, format );
i = vsnprintf( s, maxsize, format, ap );
va_end( ap );
}
int main( ) {
char buf[BUFSIZ];
call_it( buf, BUFSIZ-1, "This is a test %d %c %s\n", 123, 'a', "test" );
puts( buf );
}
I think, therefore I am... I think!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP