PUBLIB(3pub)PUBLIB(3pub)NAME
publib - introduction to publib
SYNOPSIS
#include <publib.h>
DESCRIPTION
publib is a library of C functions that are useful in many of programs. It is an extension to the Standard C library (as defined by the
ISO/ANSI C standard 9899-1990). To use the functions in publib, #include <publib.h> and link with the libpub.a library (adding -lpub at
the end of the link command should work, if the library has been installed properly).
The library provides functions for
string and memory area manipulation
memory allocation
I/O
comparison functions for qsort, bsearch, and others
expression evaluation
AUTHOR
Publib was originally written by Lars Wirzenius. It is now maintained by Antti-Juhani Kaijanaho (antti-juhani@kaijanaho.fi).
PUBLIB(3pub)
Check Out this Related Man Page
XMALLOC(3pub) C Programmer's Manual XMALLOC(3pub)NAME
xmalloc, xrealloc, xfree, xstrdup, xmemdup, memdup - memory allocation functions for Publib
SYNOPSIS
#include <publib.h>
void *xmalloc(size_t bytes);
void *xrealloc(void *ptr, size_t bytes);
void xfree(void *ptr);
char *xstrdup(const char *string);
void *memdup(const void *mem, size_t bytes);
void *xmemdup(const void *mem, size_t bytes);
DESCRIPTION
These functions are utility functions for memory allocation from the publib library. xmalloc, xrealloc, and xfree are error checking ver-
sions of the standard library routines malloc, realloc, and free, respectively. They are guaranteed to never return unless there was no
problem: if, for example, xmalloc is unable to allocate the requested amount of memory, it prints an error message and terminates the pro-
gram. Hence, the caller does not need to check for a NULL return value, and the code that calls these functions is simpler due to the lack
of error checks.
Similarly, xstrdup is an error checking version of the common (though not standard) strdup routine, which creates a duplicate of a string
by allocating memory for the copy with malloc. (For systems that lack strdup, publib provides one in its portability module; it is always
declared in <publib.h>.)
memdup is similar to strdup, it creates a copy of an arbitrary memory area (the arguments are a pointer to the beginning of the area, and
its size) by allocating memory for the copy with malloc. xmemdup is its error checking version.
NOTE
xmalloc and xrealloc treat a request to allocate a block of 0 bytes as an error. xrealloc will allow its first argument to be NULL.
SEE ALSO publib(3), malloc(3), strdup(3)AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)
Publib C Programmer's Manual XMALLOC(3pub)
Manufacturer Links
General Information
Home Page: IBM United States
Documentation/Information: IBM System p - UNIX servers: Support and services
pSeries and AIX Information Center
Developerworks AIX Wiki: AIX Wiki
AIX for System Administrators
In-depth information from IBM:
IBM... (0 Replies)
Dear all,
I am trying to understand this script below:
#!/bin/bash
# can be executed as simple user?
for i in $(ls -ld /sys/block/?d? 2>/dev/null); do
device="${i##/sys/bolck/}"
DEVICELIST="$device"
DEVICELIST="$(cat $i/device/vendor 2>/dev/null) $(cat $i/device/model 2>/dev/null)... (2 Replies)
Hi Guys,
Can some one help me on what is the recommended (SWAP) Paging space required.
Below are the details of my environment
Currently The OS version AIX5.3
PHYSICAL RAM 32 gb
Because the page space is going high
Thanks
Murali (12 Replies)
Hello all. I have a flat text file, separated into paragraphs. I need to grep for all paragraphs containing a specific term (Flash, in this case), and first line in each paragraph containing that term, along with the line immediately preceding the first occurence.
Example paragraph:
Some... (9 Replies)
Hello Team,
Am trying to upgrade the AIX 6.1 TL 7 to TL 8. My rootvg is mirrored so i have unmirrored and taken out the secondary disk and trying to install the update via smitty alt_clone.
The filesets has been installed and finally when making the updated disk as bootable bosboot... (6 Replies)
Hi guys !
I'm a French IT student in AIX, and i'm note very fluent in english.
I have a task : Write a script to inform the administrator if on of a cluster UC is not working. I'm not going to ask you the script ^^'
But i want to make a list of the failure reason of a cluster (network,... (10 Replies)
Some time ago I bought an old microchannel RS/6000 39H as a hobby toy. I mostly deal with newer Sun/Oracle equipment so I'm a bit out of my element.
The machine was running, AIX 4.1.3 I believe. Using it via IBM terminal. I stored it for what was apparently too long, and now it stalls out... (11 Replies)
Hi Folks,
Currently we are having the below configuration in one of our AIX 6.1 server.
RAM:- 8 GB
Paging space :- 19 GB
CPU processor:- 1
CPU type: 64 bit
But we would like to upgrade the configuration to below to improve the system performance and resolve some memory issues.
... (11 Replies)
I have just purchased an old IBM RS/6000 7026-C2 with the intention of installing AIX 5.2 to do some testing.
I have no AIX or RS/6000 experience, but I have managed to access the console/service menu through a hyper terminal console via the com port.
I get the service processor menu and I can't... (12 Replies)
Hi,
just a short question:
Is a error label always equal to a error identifier?
So it does not matter if i search for an specific identifier (errpt -j) or a specific label (errpt -J)?
Regards
Ron (5 Replies)
Cannot see disks while tryin to install CentOS 7 at IBM X3550 M3
It shows that no disk present insystem, though 2 disks inserted (using RAID controller).
is ther e anything should be done so CentOS become to see disks? (6 Replies)
We just found out that the installation of DB/2 on a HACMP- (PowerHA-) Cluster running v7.1.3 is not possible due to a bug in HACMP. DB/2-version was 10.5 but this seems to apply to 10.1 too (and probably other versions as well).
The error message the DB/2-installer issues is something like:
... (2 Replies)