snprintf man page on DigitalUNIX

Man page or keyword search:  
man Server   12896 pages
apropos Keyword Search (all sections)
Output format
DigitalUNIX logo
[printable version]

snprintf(3scl)							snprintf(3scl)

NAME
       snprintf - print formatted output to a buffer

LIBRARY
       SCL Miscellaneous Library (libsolmisc.so, libsolmisc.a)

SYNOPSIS
       #include <stdio.h>

       int snprintf(char *string,
		    size_t n,
		    const char *format, ...);

PARAMETERS
       Pointer to buffer to contain formatted output string.  Size of the buf‐
       fer referred to by string.  Pointer to buffer containing a string spec‐
       ifying  the  characters	and  format of optional parameters (...) to be
       written to string.

DESCRIPTION
       The snprintf() function behaves	as  function  sprintf(3)  except  that
       parameter  n  restricts	the number of characters written to the output
       buffer.

SCL IMPLEMENTATION NOTES
       The output buffer is assumed to be large enough to contain the  format‐
       ted output, otherwise an error is returned. This is different behaviour
       to Solaris which returns the number of characters that should have been
       output if the buffer was sufficiently large.

       Tru64 UNIX version 5 implements the snprintf() function in the standard
       library, but Tru64 UNIX version 4  does	not,  hence  the  function  is
       implemented by the SCL.

       The  SCL-supplied  stdio.h  header  maps	 snprintf() to an SCL-specific
       implementation function. This  mapping  is  not	required  if  building
       applications  on	 Tru64	UNIX  version 5. Consequently, the header uses
       preprocessor statements to only map the definition when building	 on  a
       version 4 system.

       To  ensure that the correct preprocessor symbol is defined for the con‐
       ditional test within the header, use the tru64_version utility (in  the
       bin  directory  beneath	the  SCL  root directory) with the application
       build command (for example: cc -o myprog -D`tru64_version -m`  myprog.c
       -lsolmisc).   Alternatively,  remove  the definitions from the SCL-sup‐
       plied stdio.h on a version 5 system.

RETURN VALUES
       The number of characters written to the buffer, excluding the terminat‐
       ing null, if successful, otherwise a negative value is returned.

RELATED INFORMATION
       Functions: sprintf(3), vfprintf(3)

       Manual: Solaris Compatibility Library User's Guide

								snprintf(3scl)
[top]

List of man pages available for DigitalUNIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net