Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

publib(3pub) [mojave man page]

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)
Man Page

14 More Discussions You Might Find Interesting

1. AIX

AIX Links

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)
Discussion started by: Perderabo
0 Replies

2. AIX

How to upgrade AIX Firmware & TL Maintenance Level in AIX

Steps to upgrade AIX TL ( technology Level ) / Maintenance Level in AIX ( including Firmware HMC VIOS ) This article or post covers upgrades for - Hardware Management Console ( HMC ) - Firmware ( also known as microcode ) - VIO ( Virtual I/O Server = PowerVM ) - AIX Version, Technology... (2 Replies)
Discussion started by: filosophizer
2 Replies

3. Shell Programming and Scripting

Signification of ## in line : device="${i##/sys/bolck/}" ???

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)
Discussion started by: freddie50
2 Replies

4. AIX

Required paging space recommandations on AIX5.3

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)
Discussion started by: murali969
12 Replies

5. AIX

GREP -p: first TWO lines

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)
Discussion started by: Mordaris
9 Replies

6. Emergency UNIX and Linux Support

AIX upgrade fails

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)
Discussion started by: gowthamakanthan
6 Replies

7. AIX

Where is smit.cat file ?

Someones know where is smit.cat file ? (the smit message catalog file) (1 Reply)
Discussion started by: Tharsan
1 Replies

8. AIX

Cluster failure reason

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)
Discussion started by: Tharsan
10 Replies

9. Hardware

Old RS/6000 lost its mind

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)
Discussion started by: drjohnnyfever
11 Replies

10. AIX

Regarding Upgrading RAM in AIX 6.1

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)
Discussion started by: sumanmca2006
11 Replies

11. AIX

IBM rs/6000 7026-c2

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)
Discussion started by: AIX5.2
12 Replies

12. AIX

AIX errpt

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)
Discussion started by: -=XrAy=-
5 Replies

13. Red Hat

Cannot see disks while tryin to install CentOS 7

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)
Discussion started by: nypreH
6 Replies

14. AIX

[Tip] HACMP 7.1.3 and DB/2-Installation

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)
Discussion started by: bakunin
2 Replies