HP-UX Reference (11i v2 03/08) - 3 Library Functions A-M (vol 6)

g
getbootpent(3X) getbootpent(3X)
if (putbootpent (bp, fields, newfilep))
{
(handle error)
}
}
if (fields < 0) /* error reading file */
{
(handle error)
}
if (endbootpent())
{
(handle error)
}
if (fclose (newfilep))
{
(handle error)
}
The following code fragment saves a copy of a bootptab entry returned by
getbootpent()
.
#include <malloc.h>
#include <string.h>
#include <bootpent.h>
bpp_t bpnew;
unsigned size;
size = fields *BP_SIZE;
if ((bpnew = (bpp_t) malloc (size)) == BP_NULLP)
{
(handle error)
}
(void) memcpy ((void *)bpnew, (void *)bp, size);
WARNINGS
These functions are unsafe in multi-thread applications.
Calling
setbootpent() releases any locks on the file it opens.
AUTHOR
These functions were developed by HP.
FILES
/etc/bootptab control file for bootpd
SEE ALSO
bootpd(1M), errno(2), lockf(2), ferror(3S), fopen(3S), malloc(3C).
Section 3348 Hewlett-Packard Company 4 HP-UX 11i Version 2: August 2003